Skip to content

Commit

Permalink
pythonPackages.trio: fix build (#46342)
Browse files Browse the repository at this point in the history
Fixes the build for `python3Packages.trio' for the next ZHF iteration.
Please refer to the Hydra build for further reference: https://hydra.nixos.org/build/80617356

`python3Packages.sniffio` is needed for the build, otherwise the build
aborts with an error like this:

```
  Could not find a version that satisfies the requirement sniffio (from trio==0.6.0) (from versions: )
No matching distribution found for sniffio (from trio==0.6.0)
```

See #45960
  • Loading branch information
Ma27 authored and xeji committed Sep 7, 2018
1 parent 56d0a70 commit 218ac50
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
30 changes: 30 additions & 0 deletions pkgs/development/python-modules/sniffio/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{ buildPythonPackage, lib, fetchPypi, glibcLocales, isPy3k, contextvars
, pythonOlder
}:

buildPythonPackage rec {
pname = "sniffio";
version = "1.0.0";

src = fetchPypi {
inherit pname version;
sha256 = "1dzb0nx3m1hpjgsv6s6w5ac2jcmywcz6gqnfkw8rwz1vkr1836rf";
};

# breaks with the following error:
# > TypeError: 'encoding' is an invalid keyword argument for this function
disabled = !isPy3k;

buildInputs = [ glibcLocales ];

propagatedBuildInputs = lib.optionals (pythonOlder "3.7") [ contextvars ];

# no tests distributed with PyPI
doCheck = false;

meta = with lib; {
homepage = https://github.com/python-trio/sniffio;
license = licenses.asl20;
description = "Sniff out which async library your code is running under";
};
}
2 changes: 2 additions & 0 deletions pkgs/development/python-modules/trio/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
, pytest
, pyopenssl
, trustme
, sniffio
}:

buildPythonPackage rec {
Expand All @@ -31,6 +32,7 @@ buildPythonPackage rec {
async_generator
idna
outcome
sniffio
] ++ lib.optionals (pythonOlder "3.7") [ contextvars ];

meta = {
Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,8 @@ in {

trio = callPackage ../development/python-modules/trio {};

sniffio = callPackage ../development/python-modules/sniffio { };

tokenserver = callPackage ../development/python-modules/tokenserver {};

toml = callPackage ../development/python-modules/toml { };
Expand Down

0 comments on commit 218ac50

Please sign in to comment.