Build packages using new files attribute

This commit is contained in:
adisbladis 2019-06-24 12:31:59 +01:00
parent 74f996bc69
commit b4abe49e04
No known key found for this signature in database
GPG key ID: 110BFAD44C6249B7
7 changed files with 265 additions and 59 deletions

View file

@ -3,6 +3,9 @@ This is under _really_ early development, don't expect things to work.
** Missing
*** TODO Implement support for markers
Need to filter out certain deps like enum34
*** TODO Lock file hashes not distinguishable by origin
Reported upstream at https://github.com/sdispater/poetry/issues/1172 and fixed in https://github.com/sdispater/poetry/pull/1183

View file

@ -7,14 +7,12 @@ let
importTOML = path: builtins.fromTOML (builtins.readFile path);
# TODO: Because pip (and by extension poetry) supports wheels hashes are a list
# This list has determistic but non-distinguishable origins
# (we dont know what url the hashes corresponds to)
#
# Just grabbing the first possible hash only works ~50% of the time
getSha256 = pname: poetryLock: builtins.elemAt poetryLock.metadata.hashes."${pname}" 0;
getAttrDefault = attribute: set: default:
if builtins.hasAttr attribute set
then builtins.getAttr attribute set
else default;
defaultPoetryOverrides = import ./overrides.nix;
defaultPoetryOverrides = import ./overrides.nix { inherit pkgs; };
mkPoetryPackage = {
src,
@ -29,11 +27,7 @@ let
pyProject = importTOML pyproject;
poetryLock = importTOML poetrylock;
specialAttrs = [
"pyproject"
"poetrylock"
"overrides"
];
specialAttrs = [ "pyproject" "poetrylock" "overrides" ];
passedAttrs = builtins.removeAttrs attrs specialAttrs;
# Create an overriden version of pythonPackages
@ -50,16 +44,19 @@ let
doCheck = false; # We never get development deps
propagatedBuildInputs = let
dependencies =
if builtins.hasAttr "dependencies" pkgMeta
then builtins.attrNames pkgMeta.dependencies
else [];
depAttrs = getAttrDefault "dependencies" pkgMeta {};
dependencies = builtins.attrNames depAttrs;
in builtins.map (dep: self."${dep}") dependencies;
src = self.fetchPypi {
src = let
files = getAttrDefault "files" pkgMeta [];
files_sdist = builtins.filter (f: f.packagetype == "sdist") files;
files_tar = builtins.filter (f: (builtins.match "^.*?tar.gz$" f.name) != null) files_sdist;
file = assert builtins.length files_tar == 1; builtins.elemAt files_tar 0;
in self.fetchPypi {
pname = pkgMeta.name;
version = pkgMeta.version;
sha256 = getSha256 pkgMeta.name poetryLock;
sha256 = file.hash;
};
};
@ -67,10 +64,7 @@ let
name = pkgMeta.name;
value = let
drv = mkPoetryDep pkgMeta;
override =
if builtins.hasAttr pkgMeta.name overrides
then overrides."${pkgMeta.name}"
else _: _: drv: drv;
override = getAttrDefault pkgMeta.name overrides (_: _: drv: drv);
in override self super drv;
}) poetryLock.package;
@ -79,7 +73,12 @@ let
pytest_xdist = super.pytest_xdist.overrideAttrs(old: {
doInstallCheck = false;
});
} // builtins.listToAttrs lockPkgs;
} // builtins.listToAttrs lockPkgs // {
# Temporary hacks (Missing support for markers)
enum34 = null;
functools32 = null;
typing = null;
};
}).pkgs;

View file

@ -1 +0,0 @@
use nix

View file

@ -1 +1 @@
Note that this example project contains a hand-patched lock-file to work around https://github.com/sdispater/poetry/issues/1172
Note that this example project contains depends on a patched version of poetry

View file

@ -6,6 +6,16 @@ optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
version = "1.3.0"
[[package.files]]
hash = "03472c30eb2c5d1ba9227e4c2ca66ab8287fbfbbda3888aa93dc2e28fc6811b4"
name = "atomicwrites-1.3.0-py2.py3-none-any.whl"
packagetype = "bdist_wheel"
[[package.files]]
hash = "75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6"
name = "atomicwrites-1.3.0.tar.gz"
packagetype = "sdist"
[[package]]
category = "dev"
description = "Classes Without Boilerplate"
@ -14,6 +24,21 @@ optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
version = "19.1.0"
[[package.files]]
hash = "69c0dbf2ed392de1cb5ec704444b08a5ef81680a61cb899dc08127123af36a79"
name = "attrs-19.1.0-py2.py3-none-any.whl"
packagetype = "bdist_wheel"
[[package.files]]
hash = "f0b870f674851ecbfbbbd364d6b5cbdff9dcedbc7f3f5e18a6891057f21fe399"
name = "attrs-19.1.0.tar.gz"
packagetype = "sdist"
[package.extras]
dev = ["coverage", "hypothesis", "pympler", "pytest", "six", "zope.interface", "sphinx", "pre-commit"]
docs = ["sphinx", "zope.interface"]
tests = ["coverage", "hypothesis", "pympler", "pytest", "six", "zope.interface"]
[[package]]
category = "main"
description = "Python package for providing Mozilla's CA Bundle."
@ -22,6 +47,16 @@ optional = false
python-versions = "*"
version = "2019.6.16"
[[package.files]]
hash = "046832c04d4e752f37383b628bc601a7ea7211496b4638f6514d0e5b9acc4939"
name = "certifi-2019.6.16-py2.py3-none-any.whl"
packagetype = "bdist_wheel"
[[package.files]]
hash = "945e3ba63a0b9f577b1395204e13c3a231f9bc0223888be653286534e5873695"
name = "certifi-2019.6.16.tar.gz"
packagetype = "sdist"
[[package]]
category = "main"
description = "Universal encoding detector for Python 2 and 3"
@ -30,6 +65,16 @@ optional = false
python-versions = "*"
version = "3.0.4"
[[package.files]]
hash = "fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"
name = "chardet-3.0.4-py2.py3-none-any.whl"
packagetype = "bdist_wheel"
[[package.files]]
hash = "84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"
name = "chardet-3.0.4.tar.gz"
packagetype = "sdist"
[[package]]
category = "dev"
description = "Cross-platform colored terminal text."
@ -39,6 +84,16 @@ optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
version = "0.4.1"
[[package.files]]
hash = "f8ac84de7840f5b9c4e3347b3c1eaa50f7e49c2b07596221daec5edaabbd7c48"
name = "colorama-0.4.1-py2.py3-none-any.whl"
packagetype = "bdist_wheel"
[[package.files]]
hash = "05eed71e2e327246ad6b38c540c4a3117230b19679b875190486ddd2d721422d"
name = "colorama-0.4.1.tar.gz"
packagetype = "sdist"
[[package]]
category = "main"
description = "Internationalized Domain Names in Applications (IDNA)"
@ -47,6 +102,16 @@ optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
version = "2.8"
[[package.files]]
hash = "ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c"
name = "idna-2.8-py2.py3-none-any.whl"
packagetype = "bdist_wheel"
[[package.files]]
hash = "c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407"
name = "idna-2.8.tar.gz"
packagetype = "sdist"
[[package]]
category = "dev"
description = "Read metadata from Python packages"
@ -55,9 +120,22 @@ optional = false
python-versions = ">=2.7,!=3.0,!=3.1,!=3.2,!=3.3"
version = "0.18"
[[package.files]]
hash = "6dfd58dfe281e8d240937776065dd3624ad5469c835248219bd16cf2e12dbeb7"
name = "importlib_metadata-0.18-py2.py3-none-any.whl"
packagetype = "bdist_wheel"
[[package.files]]
hash = "cb6ee23b46173539939964df59d3d72c3e0c1b5d54b84f1d8a7e912fe43612db"
name = "importlib_metadata-0.18.tar.gz"
packagetype = "sdist"
[package.dependencies]
zipp = ">=0.5"
[package.extras]
docs = ["sphinx", "docutils (0.12)", "rst.linker"]
[[package]]
category = "dev"
description = "More routines for operating on iterables, beyond itertools"
@ -67,6 +145,16 @@ optional = false
python-versions = ">=3.4"
version = "7.0.0"
[[package.files]]
hash = "c3e4748ba1aad8dba30a4886b0b1a2004f9a863837b8654e7059eebf727afa5a"
name = "more-itertools-7.0.0.tar.gz"
packagetype = "sdist"
[[package.files]]
hash = "2112d2ca570bb7c3e53ea1a35cd5df42bb0fd10c45f0fb97178679c3c03d64c7"
name = "more_itertools-7.0.0-py3-none-any.whl"
packagetype = "bdist_wheel"
[[package]]
category = "dev"
description = "Core utilities for Python packages"
@ -75,6 +163,16 @@ optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
version = "19.0"
[[package.files]]
hash = "9e1cbf8c12b1f1ce0bb5344b8d7ecf66a6f8a6e91bcb0c84593ed6d3ab5c4ab3"
name = "packaging-19.0-py2.py3-none-any.whl"
packagetype = "bdist_wheel"
[[package.files]]
hash = "0c98a5d0be38ed775798ece1b9727178c4469d9c3b4ada66e8e6b7849f8732af"
name = "packaging-19.0.tar.gz"
packagetype = "sdist"
[package.dependencies]
pyparsing = ">=2.0.2"
six = "*"
@ -87,9 +185,22 @@ optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
version = "0.12.0"
[[package.files]]
hash = "b9817417e95936bf75d85d3f8767f7df6cdde751fc40aed3bb3074cbcb77757c"
name = "pluggy-0.12.0-py2.py3-none-any.whl"
packagetype = "bdist_wheel"
[[package.files]]
hash = "0825a152ac059776623854c1543d65a4ad408eb3d33ee114dff91e57ec6ae6fc"
name = "pluggy-0.12.0.tar.gz"
packagetype = "sdist"
[package.dependencies]
importlib-metadata = ">=0.12"
[package.extras]
dev = ["pre-commit", "tox"]
[[package]]
category = "dev"
description = "library with cross-python path, ini-parsing, io, code, log facilities"
@ -98,6 +209,16 @@ optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
version = "1.8.0"
[[package.files]]
hash = "64f65755aee5b381cea27766a3a147c3f15b9b6b9ac88676de66ba2ae36793fa"
name = "py-1.8.0-py2.py3-none-any.whl"
packagetype = "bdist_wheel"
[[package.files]]
hash = "dc639b046a6e2cff5bbe40194ad65936d6ba360b52b3c3fe1d08a82dd50b5e53"
name = "py-1.8.0.tar.gz"
packagetype = "sdist"
[[package]]
category = "dev"
description = "Python parsing module"
@ -106,6 +227,16 @@ optional = false
python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*"
version = "2.4.0"
[[package.files]]
hash = "9b6323ef4ab914af344ba97510e966d64ba91055d6b9afa6b30799340e89cc03"
name = "pyparsing-2.4.0-py2.py3-none-any.whl"
packagetype = "bdist_wheel"
[[package.files]]
hash = "1873c03321fc118f4e9746baf201ff990ceb915f433f23b395f5580d1840cb2a"
name = "pyparsing-2.4.0.tar.gz"
packagetype = "sdist"
[[package]]
category = "dev"
description = "pytest: simple powerful testing with Python"
@ -114,6 +245,16 @@ optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
version = "4.6.3"
[[package.files]]
hash = "926855726d8ae8371803f7b2e6ec0a69953d9c6311fa7c3b6c1b929ff92d27da"
name = "pytest-4.6.3-py2.py3-none-any.whl"
packagetype = "bdist_wheel"
[[package.files]]
hash = "4a784f1d4f2ef198fe9b7aef793e9fa1a3b2f84e822d9b3a64a181293a572d45"
name = "pytest-4.6.3.tar.gz"
packagetype = "sdist"
[package.dependencies]
atomicwrites = ">=1.0"
attrs = ">=17.4.0"
@ -129,6 +270,9 @@ wcwidth = "*"
python = ">=2.8"
version = ">=4.0.0"
[package.extras]
testing = ["argcomplete", "hypothesis (>=3.56)", "nose", "requests", "mock"]
[[package]]
category = "main"
description = "Python HTTP for Humans."
@ -137,12 +281,26 @@ optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
version = "2.22.0"
[[package.files]]
hash = "9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31"
name = "requests-2.22.0-py2.py3-none-any.whl"
packagetype = "bdist_wheel"
[[package.files]]
hash = "11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4"
name = "requests-2.22.0.tar.gz"
packagetype = "sdist"
[package.dependencies]
certifi = ">=2017.4.17"
chardet = ">=3.0.2,<3.1.0"
idna = ">=2.5,<2.9"
urllib3 = ">=1.21.1,<1.25.0 || >1.25.0,<1.25.1 || >1.25.1,<1.26"
[package.extras]
security = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)"]
socks = ["PySocks (>=1.5.6,<1.5.7 || >1.5.7)", "win-inet-pton"]
[[package]]
category = "dev"
description = "Python 2 and 3 compatibility utilities"
@ -151,6 +309,16 @@ optional = false
python-versions = ">=2.6, !=3.0.*, !=3.1.*"
version = "1.12.0"
[[package.files]]
hash = "3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c"
name = "six-1.12.0-py2.py3-none-any.whl"
packagetype = "bdist_wheel"
[[package.files]]
hash = "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"
name = "six-1.12.0.tar.gz"
packagetype = "sdist"
[[package]]
category = "main"
description = "HTTP library with thread-safe connection pooling, file post, and more."
@ -159,6 +327,21 @@ optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, <4"
version = "1.25.3"
[[package.files]]
hash = "b246607a25ac80bedac05c6f282e3cdaf3afb65420fd024ac94435cabe6e18d1"
name = "urllib3-1.25.3-py2.py3-none-any.whl"
packagetype = "bdist_wheel"
[[package.files]]
hash = "dbe59173209418ae49d485b87d1681aefa36252ee85884c31346debd19463232"
name = "urllib3-1.25.3.tar.gz"
packagetype = "sdist"
[package.extras]
brotli = ["brotlipy (>=0.6.0)"]
secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "ipaddress"]
socks = ["PySocks (>=1.5.6,<1.5.7 || >1.5.7,<2.0)"]
[[package]]
category = "dev"
description = "Measures number of Terminal column cells of wide-character codes"
@ -167,6 +350,16 @@ optional = false
python-versions = "*"
version = "0.1.7"
[[package.files]]
hash = "f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c"
name = "wcwidth-0.1.7-py2.py3-none-any.whl"
packagetype = "bdist_wheel"
[[package.files]]
hash = "3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e"
name = "wcwidth-0.1.7.tar.gz"
packagetype = "sdist"
[[package]]
category = "dev"
description = "Backport of pathlib-compatible object wrapper for zip files"
@ -175,26 +368,40 @@ optional = false
python-versions = ">=2.7"
version = "0.5.1"
[[package.files]]
hash = "8c1019c6aad13642199fbe458275ad6a84907634cc9f0989877ccc4a2840139d"
name = "zipp-0.5.1-py2.py3-none-any.whl"
packagetype = "bdist_wheel"
[[package.files]]
hash = "ca943a7e809cc12257001ccfb99e3563da9af99d52f261725e96dfe0f9275bc3"
name = "zipp-0.5.1.tar.gz"
packagetype = "sdist"
[package.extras]
docs = ["sphinx", "jaraco.packaging (>=3.2)", "rst.linker (>=1.9)"]
testing = ["pathlib2", "contextlib2", "unittest2"]
[metadata]
content-hash = "81f5e454b0b11af37c64b11a6288cf92768a311f72008b4ff858b804c22d4f6c"
python-versions = "^3.7"
[metadata.hashes]
atomicwrites = ["75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6", "03472c30eb2c5d1ba9227e4c2ca66ab8287fbfbbda3888aa93dc2e28fc6811b4"]
attrs = ["f0b870f674851ecbfbbbd364d6b5cbdff9dcedbc7f3f5e18a6891057f21fe399", "69c0dbf2ed392de1cb5ec704444b08a5ef81680a61cb899dc08127123af36a79"]
certifi = ["945e3ba63a0b9f577b1395204e13c3a231f9bc0223888be653286534e5873695", "046832c04d4e752f37383b628bc601a7ea7211496b4638f6514d0e5b9acc4939"]
atomicwrites = ["03472c30eb2c5d1ba9227e4c2ca66ab8287fbfbbda3888aa93dc2e28fc6811b4", "75a9445bac02d8d058d5e1fe689654ba5a6556a1dfd8ce6ec55a0ed79866cfa6"]
attrs = ["69c0dbf2ed392de1cb5ec704444b08a5ef81680a61cb899dc08127123af36a79", "f0b870f674851ecbfbbbd364d6b5cbdff9dcedbc7f3f5e18a6891057f21fe399"]
certifi = ["046832c04d4e752f37383b628bc601a7ea7211496b4638f6514d0e5b9acc4939", "945e3ba63a0b9f577b1395204e13c3a231f9bc0223888be653286534e5873695"]
chardet = ["84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", "fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691"]
colorama = ["05eed71e2e327246ad6b38c540c4a3117230b19679b875190486ddd2d721422d", "f8ac84de7840f5b9c4e3347b3c1eaa50f7e49c2b07596221daec5edaabbd7c48"]
idna = ["c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407", "ea8b7f6188e6fa117537c3df7da9fc686d485087abf6ac197f9c46432f7e4a3c"]
importlib-metadata = ["cb6ee23b46173539939964df59d3d72c3e0c1b5d54b84f1d8a7e912fe43612db", "6dfd58dfe281e8d240937776065dd3624ad5469c835248219bd16cf2e12dbeb7"]
more-itertools = ["c3e4748ba1aad8dba30a4886b0b1a2004f9a863837b8654e7059eebf727afa5a", "2112d2ca570bb7c3e53ea1a35cd5df42bb0fd10c45f0fb97178679c3c03d64c7"]
importlib-metadata = ["6dfd58dfe281e8d240937776065dd3624ad5469c835248219bd16cf2e12dbeb7", "cb6ee23b46173539939964df59d3d72c3e0c1b5d54b84f1d8a7e912fe43612db"]
more-itertools = ["2112d2ca570bb7c3e53ea1a35cd5df42bb0fd10c45f0fb97178679c3c03d64c7", "c3e4748ba1aad8dba30a4886b0b1a2004f9a863837b8654e7059eebf727afa5a"]
packaging = ["0c98a5d0be38ed775798ece1b9727178c4469d9c3b4ada66e8e6b7849f8732af", "9e1cbf8c12b1f1ce0bb5344b8d7ecf66a6f8a6e91bcb0c84593ed6d3ab5c4ab3"]
pluggy = ["0825a152ac059776623854c1543d65a4ad408eb3d33ee114dff91e57ec6ae6fc", "b9817417e95936bf75d85d3f8767f7df6cdde751fc40aed3bb3074cbcb77757c"]
py = ["dc639b046a6e2cff5bbe40194ad65936d6ba360b52b3c3fe1d08a82dd50b5e53", "64f65755aee5b381cea27766a3a147c3f15b9b6b9ac88676de66ba2ae36793fa"]
py = ["64f65755aee5b381cea27766a3a147c3f15b9b6b9ac88676de66ba2ae36793fa", "dc639b046a6e2cff5bbe40194ad65936d6ba360b52b3c3fe1d08a82dd50b5e53"]
pyparsing = ["1873c03321fc118f4e9746baf201ff990ceb915f433f23b395f5580d1840cb2a", "9b6323ef4ab914af344ba97510e966d64ba91055d6b9afa6b30799340e89cc03"]
pytest = ["4a784f1d4f2ef198fe9b7aef793e9fa1a3b2f84e822d9b3a64a181293a572d45", "926855726d8ae8371803f7b2e6ec0a69953d9c6311fa7c3b6c1b929ff92d27da"]
requests = ["11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4", "9cf5292fcd0f598c671cfc1e0d7d1a7f13bb8085e9a590f48c010551dc6c4b31"]
six = ["d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73", "3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c"]
urllib3 = ["dbe59173209418ae49d485b87d1681aefa36252ee85884c31346debd19463232", "b246607a25ac80bedac05c6f282e3cdaf3afb65420fd024ac94435cabe6e18d1"]
six = ["3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"]
urllib3 = ["b246607a25ac80bedac05c6f282e3cdaf3afb65420fd024ac94435cabe6e18d1", "dbe59173209418ae49d485b87d1681aefa36252ee85884c31346debd19463232"]
wcwidth = ["3df37372226d6e63e1b1e1eda15c594bca98a22d33a23832a90998faa96bc65e", "f4ebe71925af7b40a864553f761ed559b43544f8f71746c2d756c7fe788ade7c"]
zipp = ["ca943a7e809cc12257001ccfb99e3563da9af99d52f261725e96dfe0f9275bc3", "8c1019c6aad13642199fbe458275ad6a84907634cc9f0989877ccc4a2840139d"]
zipp = ["8c1019c6aad13642199fbe458275ad6a84907634cc9f0989877ccc4a2840139d", "ca943a7e809cc12257001ccfb99e3563da9af99d52f261725e96dfe0f9275bc3"]

View file

@ -1,15 +0,0 @@
with import <nixpkgs> {};
let
# TODO: Stop propagating PYTHONPATH
pythonEnv = (python3.withPackages(ps: [
ps.poetry
])).override (args: {
ignoreCollisions = true;
});
in mkShell {
buildInputs = [
pythonEnv
];
}

View file

@ -1,10 +1,25 @@
{ pkgs ? import <nixpkgs> { }}:
let
addSetupTools = self: super: drv: drv.overrideAttrs(old: {
buildInputs = old.buildInputs ++ [
self.setuptools_scm
];
});
renameUnderscore = self: super: drv: drv.overrideAttrs(old: {
src = self.fetchPypi {
pname = builtins.replaceStrings ["-"] ["_"] old.pname;
version = old.version;
sha256 = old.src.outputHash;
};
});
# Chain multiple overrides into a single one
composeOverrides = overrides:
(self: super: drv: builtins.foldl' (drv: override: override self super drv) drv overrides);
in {
pytest = addSetupTools;
@ -15,18 +30,16 @@ in {
zipp = addSetupTools;
importlib-metadata = self: super: drv: drv.overrideAttrs(old: {
src = self.fetchPypi {
pname = "importlib_metadata";
version = old.version;
sha256 = old.src.outputHash;
};
importlib-metadata = composeOverrides [ renameUnderscore addSetupTools ];
buildInputs = old.buildInputs ++ [
self.setuptools_scm
];
});
typing-extensions = renameUnderscore;
pluggy = addSetupTools;
jsonschema = addSetupTools;
lockfile = self: super: drv: drv.overrideAttrs(old: {
propagatedBuildInputs = old.propagatedBuildInputs ++ [ self.pbr ];
});
}