python3Packages.sanic: 21.3.2 -> 21.3.4; fix tests#120881
python3Packages.sanic: 21.3.2 -> 21.3.4; fix tests#120881dotlambda merged 4 commits intoNixOS:masterfrom
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
There was a problem hiding this comment.
This is the wrong way round: We should only override packages that are not in propagatedBuildInputs.
There was a problem hiding this comment.
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.
sanic-routing and sanic-testing have sanic in their checkInputs, so we can override their input sanic.
There was a problem hiding this comment.
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.
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.
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:
saniconly depends onsanic-testingfor tests and some backwards compatibility (see also Remove test client sanic-org/sanic#2009);sanic-testingdoes depend onsanicat 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 |
dotlambda
left a comment
There was a problem hiding this comment.
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 = falsehere 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-sanicas broken and override that insanicinstead.cc @costrouc
Motivation for this change
@dotlambda discovered that
python3Packages.sanicwas broken in #120447 (comment).Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)