Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade stream_data #149

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions .github/workflows/elixir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
elixir: [1.11]
otp: [23.3]
elixir: [1.16.1]
otp: [26.2]
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

steps:
- name: checkout
uses: actions/checkout@v2
Expand Down
30 changes: 0 additions & 30 deletions config/config.exs

This file was deleted.

2 changes: 1 addition & 1 deletion lib/norm/core/selection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ defmodule Norm.Core.Selection do
defp validate_selectors!([]), do: true
defp validate_selectors!([{_key, inner} | rest]), do: validate_selectors!(inner) and validate_selectors!(rest)
defp validate_selectors!([_key | rest]), do: validate_selectors!(rest)
defp validate_selectors!(other), do: raise ArgumentError, "select expects a list of keys but received: #{inspect other}"
defp validate_selectors!(other), do: raise(ArgumentError, "select expects a list of keys but received: #{inspect other}")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes the following compilation warning:

Screenshot 2024-05-29 at 1 19 53 PM


defp assert_spec!(%Schema{}=schema, key) do
case Schema.key_present?(schema, key) do
Expand Down
13 changes: 7 additions & 6 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@ defmodule Norm.MixProject do
use Mix.Project

@version "0.13.0"
@source_url "https://github.com/elixir-toniq/norm"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid duplicating this value, updated source url.


def project do
def(project) do
[
app: :norm,
version: @version,
elixir: "~> 1.7",
elixir: "~> 1.11",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GH workflow file seems to be testing this matrix: elixir: [1.11], otp: [23.3]

I guess that matrix should be updated, but I prefer to ask first here first.

elixirc_paths: elixirc_paths(Mix.env()),
start_permanent: Mix.env() == :prod,
deps: deps(),
description: description(),
package: package(),
name: "Norm",
source_url: "https://github.com/keathley/norm",
source_url: @source_url,
docs: docs()
]
end
Expand All @@ -31,7 +32,7 @@ defmodule Norm.MixProject do
defp deps do
[
{:credo, "~> 1.4", only: [:dev, :test], runtime: false},
{:stream_data, "~> 0.5", optional: true},
{:stream_data, "~> 0.6 or ~> 1.0", optional: true},
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main reason for this PR, updating stream_data that's causing some upgrade conflicts on my end.

{:ex_doc, "~> 0.19", only: [:dev, :test]}
]
end
Expand All @@ -49,14 +50,14 @@ defmodule Norm.MixProject do
[
name: "norm",
licenses: ["MIT"],
links: %{"GitHub" => "https://github.com/keathley/norm"}
links: %{"GitHub" => @source_url}
]
end

def docs do
[
source_ref: "v#{@version}",
source_url: "https://github.com/keathley/norm",
source_url: @source_url,
main: "Norm"
]
end
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
"makeup_elixir": {:hex, :makeup_elixir, "0.16.0", "f8c570a0d33f8039513fbccaf7108c5d750f47d8defd44088371191b76492b0b", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "28b2cbdc13960a46ae9a8858c4bebdec3c9a6d7b4b9e7f4ed1502f8159f338e7"},
"makeup_erlang": {:hex, :makeup_erlang, "0.1.1", "3fcb7f09eb9d98dc4d208f49cc955a34218fc41ff6b84df7c75b3e6e533cc65f", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "174d0809e98a4ef0b3309256cbf97101c6ec01c4ab0b23e926a9e17df2077cbb"},
"nimble_parsec": {:hex, :nimble_parsec, "1.2.3", "244836e6e3f1200c7f30cb56733fd808744eca61fd182f731eac4af635cc6d0b", [:mix], [], "hexpm", "c8d789e39b9131acf7b99291e93dae60ab48ef14a7ee9d58c6964f59efb570b0"},
"stream_data": {:hex, :stream_data, "0.5.0", "b27641e58941685c75b353577dc602c9d2c12292dd84babf506c2033cd97893e", [:mix], [], "hexpm", "012bd2eec069ada4db3411f9115ccafa38540a3c78c4c0349f151fc761b9e271"},
"stream_data": {:hex, :stream_data, "1.1.0", "ef3a7cac0f200c43caf3e6caf9be63115851b4f1cde3f21afaab220adc40e3d7", [:mix], [], "hexpm", "cccc411d5facf1bab86e7c671382d164f05f8992574c95349d3c8b317e14d953"},
}
4 changes: 2 additions & 2 deletions test/norm/core/schema_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ defmodule Norm.Core.SchemaTest do
assert input == conform!(input, User.s())
assert {:error, errors} = conform(%User{name: :foo, age: "31", email: 42}, User.s())

assert errors == [
assert MapSet.equal?(MapSet.new(errors), MapSet.new([
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit test failing locally, at least with 1.17.0-rc.0-otp-27

%{spec: "is_integer()", input: "31", path: [:age]},
%{spec: "is_binary()", input: 42, path: [:email]},
%{spec: "is_binary()", input: :foo, path: [:name]}
]
]))
end

test "only checks the keys that have specs" do
Expand Down
Loading