-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
python3Packages.sanic: 21.3.2 -> 21.3.4; fix tests #120881
Conversation
Result of 2 packages failed to build:12 packages built successfully:
2 suggestions:
Note that build failures may predate this PR, and could be nondeterministic or hardware dependent. Result of 6 packages failed to build:8 packages built successfully:
2 suggestions:
Note that build failures may predate this PR, and could be nondeterministic or hardware dependent. |
5923f77
to
c535004
Compare
|
c535004
to
049d419
Compare
pkgs/top-level/python-packages.nix
Outdated
sanic = callPackage ../development/python-modules/sanic { | ||
# Disable tests to prevent loops, as they require Sanic itself. | ||
sanic-routing = self.sanic-routing.overridePythonAttrs (oldAttrs: { | ||
doCheck = false; | ||
}); | ||
sanic-testing = self.sanic-testing.overridePythonAttrs (oldAttrs: { | ||
doCheck = false; | ||
dontUsePythonImportsCheck = true; | ||
}); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the wrong way round: We should only override packages that are not in propagatedBuildInputs
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any suggestions? Off the top of my head, tests have to be disabled either here or at the top level, or else we have to build everything twice (first with tests off, then use those to build with tests on).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sanic-routing
and sanic-testing
have sanic
in their checkInputs
, so we can override their input sanic
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I got this right, it'd the last option I proposed: 1) build sanic-routing
and sanic-testing
without tests; 2) use those as input to an intermediate sanic
; 3) use it to build sanic-routing
and sanic-testing
with tests; and 4) use those as inputs to the final sanic
.
And the lines you highlighted go into the overrides for sanic-routing
and sanic-testing
, leaving the top-level sanic
with no overrides.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, true. I forgot that sanic
doesn't build without those dependencies. If there's no way to do that we should just turn off sanic-routing
's and sanic-testing
's tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it turns out that sanic-routing
doesn't actually depend on sanic
for anything, despite it being listed in tests_require
, so that package is no longer an issue.
As for sanic-testing
, my reading of the situation is:
sanic
only depends onsanic-testing
for tests and some backwards compatibility (see also Remove test client sanic-org/sanic#2009);sanic-testing
does depend onsanic
at runtime (the imports check can't even be done when it's not present).
Therefore I've added sanic
as a propagated build input of sanic-testing
, with special logic to disable all testing when the former is explicitly set to null
(which we do when building sanic
). Said special logic is only to avoid having to call both override
and overridePythonAttrs
in sequence in python-packages.nix
.
All in all, this should give us three fully tested packages at the top level.
049d419
to
3cf763a
Compare
I went ahead and marked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for finding a good solution!
pytest-sanic is incompatible with the current version of Sanic, see sanic-org/sanic#2095 and yunstanford/pytest-sanic#50. While it is broken, we also need it to run Sanic's tests (for which case it works just fine).
While we're at it, revise the dependencies lists; there's been a couple of break-ups with 21.3.0.
3cf763a
to
bd815d2
Compare
If want to make another PR fixing |
After NixOS#120881, packages using Sanic's `app.test_client` or `app.asgi_client` need to depend on `sanic-testing` as well.
After #120881, packages using Sanic's `app.test_client` or `app.asgi_client` need to depend on `sanic-testing` as well.
Sanic 21.3.0 split up parts of itself into new packages that are consumed as dependencies, while those packages themselves need Sanic for testing, so we need a few
doCheck = false
here and there to break loops.pytest-sanic is in the odd situation that it doesn't work with Sanic 21.3 (yunstanford/pytest-sanic#50) yet it is needed to run Sanic's tests. Right now I'm just disabling checks for this combination of versions, but it might be better to mark
pytest-sanic
as broken and override that insanic
instead.cc @costrouc
Motivation for this change
@dotlambda discovered that
python3Packages.sanic
was broken in #120447 (comment).Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)