Merge pull request #513 from nix-community/no-dontprefersetuppy

Remove dontPreferSetupPy & don't remove pyproject.toml
This commit is contained in:
adisbladis 2022-01-18 22:26:55 +12:00 committed by GitHub
commit 1c4a1a2232
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 189 additions and 245 deletions

View file

@ -5,14 +5,6 @@ pipBuildPhase() {
echo "Executing pipBuildPhase" echo "Executing pipBuildPhase"
runHook preBuild runHook preBuild
# Prefer using setup.py to avoid build-system dependencies if we have a setup.py
if [ -z "${dontPreferSetupPy-}" ]; then
if test -e setup.py && test -e pyproject.toml; then
echo "Removing pyproject.toml..."
rm -f pyproject.toml
fi
fi
mkdir -p dist mkdir -p dist
echo "Creating a wheel..." echo "Creating a wheel..."
@pythonInterpreter@ -m pip wheel --verbose --no-index --no-deps --no-clean --no-build-isolation --wheel-dir dist . @pythonInterpreter@ -m pip wheel --verbose --no-index --no-deps --no-clean --no-build-isolation --wheel-dir dist .

View file

@ -5,10 +5,10 @@
"homepage": "https://github.com/NixOS/nixpkgs", "homepage": "https://github.com/NixOS/nixpkgs",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "eac07edbd20ed4908b98790ba299250b5527ecdf", "rev": "5aaed40d22f0d9376330b6fa413223435ad6fee5",
"sha256": "11r1b0kpyls2w4n7s9xkj2kim715vrk6aj7ackia4f8s9imachk6", "sha256": "0bs8sr92lzz7mdrlv143draq3j7l42dj69w3px1x31qcr3n5pgcv",
"type": "tarball", "type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/eac07edbd20ed4908b98790ba299250b5527ecdf.tar.gz", "url": "https://github.com/NixOS/nixpkgs/archive/5aaed40d22f0d9376330b6fa413223435ad6fee5.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz" "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
} }
} }

View file

@ -5,6 +5,45 @@
self: super: self: super:
let
addFlit =
{ drv
, cond ? true
, flitDrv ? self.flit-core
}: (
# Flit isn't available on Python2
if (cond && self.isPy3k) then
drv.overridePythonAttrs
(
old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ flitDrv ];
}
) else drv
);
addPoetry =
{ drv
, cond ? true
, poetryDrv ? self.poetry-core
}: (
if cond then
drv.overridePythonAttrs
(
old: {
buildInputs = (old.buildInputs or [ ]) ++ [ poetryDrv ];
}
) else drv
);
addPbr = drv: drv.overridePythonAttrs (
old: {
buildInputs = (old.buildInputs or [ ]) ++ [ self.pbr ];
}
);
in
{ {
automat = super.automat.overridePythonAttrs ( automat = super.automat.overridePythonAttrs (
old: rec { old: rec {
@ -50,12 +89,6 @@ self: super:
} }
); );
anyio = super.anyio.overridePythonAttrs (old: {
postPatch = ''
substituteInPlace setup.py --replace 'setup()' 'setup(version="${old.version}")'
'';
});
argcomplete = super.argcomplete.overridePythonAttrs ( argcomplete = super.argcomplete.overridePythonAttrs (
old: rec { old: rec {
buildInputs = (old.buildInputs or [ ]) ++ [ self.importlib-metadata ]; buildInputs = (old.buildInputs or [ ]) ++ [ self.importlib-metadata ];
@ -83,28 +116,12 @@ self: super:
} }
); );
argon2-cffi = super.argon2-cffi.overridePythonAttrs ( argon2-cffi = addFlit {
old: { drv = super.argon2-cffi;
buildInputs = (old.buildInputs or [ ]) ++ cond = lib.versionAtLeast super.argon2-cffi.version "21.2.0";
lib.optional (lib.versionAtLeast old.version "21.2.0") [ self.flit-core ]; };
}
);
backports-entry-points-selectable = super.backports-entry-points-selectable.overridePythonAttrs (old: { backcall = addFlit { drv = super.backcall; };
postPatch = ''
substituteInPlace setup.py --replace \
'setuptools.setup()' \
'setuptools.setup(version="${old.version}")'
'';
});
backports-functools-lru-cache = super.backports-functools-lru-cache.overridePythonAttrs (old: {
postPatch = ''
substituteInPlace setup.py --replace \
'setuptools.setup()' \
'setuptools.setup(version="${old.version}")'
'';
});
bcrypt = super.bcrypt.overridePythonAttrs ( bcrypt = super.bcrypt.overridePythonAttrs (
old: { old: {
@ -118,12 +135,6 @@ self: super:
} }
); );
black = super.black.overridePythonAttrs (
old: {
dontPreferSetupPy = true;
}
);
borgbackup = super.borgbackup.overridePythonAttrs ( borgbackup = super.borgbackup.overridePythonAttrs (
old: { old: {
BORG_OPENSSL_PREFIX = pkgs.openssl.dev; BORG_OPENSSL_PREFIX = pkgs.openssl.dev;
@ -149,7 +160,10 @@ self: super:
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ];
}); });
cssselect2 = super.cssselect2.overridePythonAttrs ( cssselect2 = (addFlit {
drv = super.cssselect2;
flitDrv = self.flit;
}).overridePythonAttrs (
old: { old: {
buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ];
} }
@ -174,11 +188,9 @@ self: super:
} }
); );
cheroot = super.cheroot.overridePythonAttrs ( cleo = addPoetry { drv = super.cleo; };
old: {
dontPreferSetupPy = true; clikit = addPoetry { drv = super.clikit; };
}
);
cloudflare = super.cloudflare.overridePythonAttrs ( cloudflare = super.cloudflare.overridePythonAttrs (
old: { old: {
@ -199,19 +211,17 @@ self: super:
buildInputs = (old.buildInputs or [ ]) ++ [ buildInputs = (old.buildInputs or [ ]) ++ [
self.toml self.toml
]; ];
postPatch = ''
substituteInPlace setup.py --replace 'setuptools.setup()' 'setuptools.setup(version="${old.version}")'
'';
} }
); );
crashtest = addPoetry { drv = super.crashtest; };
cryptography = super.cryptography.overridePythonAttrs ( cryptography = super.cryptography.overridePythonAttrs (
old: { old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) nativeBuildInputs = (old.nativeBuildInputs or [ ])
++ lib.optional (lib.versionAtLeast old.version "3.4") [ self.setuptools-rust ] ++ lib.optional (lib.versionAtLeast old.version "3.4") [ self.setuptools-rust ]
++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) self.python.pythonForBuild.pkgs.cffi ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) self.python.pythonForBuild.pkgs.cffi
++ lib.optional (lib.versionAtLeast old.version "3.5") ++ lib.optional (lib.versionAtLeast old.version "3.5")
(with pkgs.rustPlatform; [ cargoSetupHook rust.cargo rust.rustc ]); (with pkgs.rustPlatform; [ cargoSetupHook rust.cargo rust.rustc ]);
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.openssl ]; buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.openssl ];
} // lib.optionalAttrs (lib.versionAtLeast old.version "3.4" && lib.versionOlder old.version "3.5") { } // lib.optionalAttrs (lib.versionAtLeast old.version "3.4" && lib.versionOlder old.version "3.5") {
@ -238,7 +248,7 @@ self: super:
cwcwidth = super.cwcwidth.overridePythonAttrs (old: { cwcwidth = super.cwcwidth.overridePythonAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) nativeBuildInputs = (old.nativeBuildInputs or [ ])
++ [ self.cython ]; ++ [ self.cython ];
}); });
cyclonedx-python-lib = super.cyclonedx-python-lib.overridePythonAttrs (old: { cyclonedx-python-lib = super.cyclonedx-python-lib.overridePythonAttrs (old: {
@ -294,9 +304,9 @@ self: super:
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.pkg-config ]; nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.pkg-config ];
buildInputs = old.buildInputs or [ ] ++ [ pkgs.dbus pkgs.dbus-glib ] buildInputs = old.buildInputs or [ ] ++ [ pkgs.dbus pkgs.dbus-glib ]
# My guess why it's sometimes trying to -lncurses. # My guess why it's sometimes trying to -lncurses.
# It seems not to retain the dependency anyway. # It seems not to retain the dependency anyway.
++ lib.optional (! self.python ? modules) pkgs.ncurses; ++ lib.optional (! self.python ? modules) pkgs.ncurses;
}); });
dcli = super.dcli.overridePythonAttrs (old: { dcli = super.dcli.overridePythonAttrs (old: {
@ -305,7 +315,7 @@ self: super:
ddtrace = super.ddtrace.overridePythonAttrs (old: { ddtrace = super.ddtrace.overridePythonAttrs (old: {
buildInputs = (old.buildInputs or [ ]) ++ buildInputs = (old.buildInputs or [ ]) ++
(pkgs.lib.optionals pkgs.stdenv.isDarwin [ pkgs.darwin.IOKit ]) ++ [ self.cython ]; (pkgs.lib.optionals pkgs.stdenv.isDarwin [ pkgs.darwin.IOKit ]) ++ [ self.cython ];
}); });
dictdiffer = super.dictdiffer.overridePythonAttrs ( dictdiffer = super.dictdiffer.overridePythonAttrs (
@ -319,7 +329,7 @@ self: super:
super.django.overridePythonAttrs ( super.django.overridePythonAttrs (
old: { old: {
propagatedNativeBuildInputs = (old.propagatedNativeBuildInputs or [ ]) propagatedNativeBuildInputs = (old.propagatedNativeBuildInputs or [ ])
++ [ pkgs.gettext self.pytest-runner ]; ++ [ pkgs.gettext self.pytest-runner ];
} }
) )
); );
@ -419,18 +429,16 @@ self: super:
old: { old: {
postPatch = '' postPatch = ''
substituteInPlace setup.py \ substituteInPlace setup.py \
--replace 'setup_requires="setupmeta"' 'setup_requires=[]' \ --replace 'setup_requires="setupmeta"' 'setup_requires=[]'
--replace 'versioning="devcommit"' 'version="${old.version}"'
''; '';
} }
); );
fastapi = super.fastapi.overridePythonAttrs ( fastapi = addFlit {
old: { drv = super.fastapi;
# Note: requires full flit, not just flit-core # Note: requires full flit, not just flit-core
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.flit ]; flitDrv = self.flit;
} };
);
fastecdsa = super.fastecdsa.overridePythonAttrs (old: { fastecdsa = super.fastecdsa.overridePythonAttrs (old: {
buildInputs = old.buildInputs ++ [ pkgs.gmp.dev ]; buildInputs = old.buildInputs ++ [ pkgs.gmp.dev ];
@ -442,12 +450,6 @@ self: super:
} }
); );
filelock = super.filelock.overridePythonAttrs (old: {
postPatch = ''
substituteInPlace setup.py --replace 'setup()' 'setup(version="${old.version}")'
'';
});
fiona = super.fiona.overridePythonAttrs ( fiona = super.fiona.overridePythonAttrs (
old: { old: {
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.gdal_2 ]; buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.gdal_2 ];
@ -477,6 +479,10 @@ self: super:
} }
); );
graphql-core = addPoetry { drv = super.graphql-core; };
graphql-relay = addPoetry { drv = super.graphql-relay; };
gitpython = super.gitpython.overridePythonAttrs ( gitpython = super.gitpython.overridePythonAttrs (
old: { old: {
buildInputs = (old.buildInputs or [ ]) ++ [ self.typing-extensions ]; buildInputs = (old.buildInputs or [ ]) ++ [ self.typing-extensions ];
@ -563,10 +569,14 @@ self: super:
} }
); );
html5lib = addFlit { drv = super.html5lib; };
httplib2 = super.httplib2.overridePythonAttrs (old: { httplib2 = super.httplib2.overridePythonAttrs (old: {
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.pyparsing ]; propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.pyparsing ];
}); });
hypothesis-graphql = addPoetry { drv = super.hypothesis-graphql; poetryDrv = self.poetry; };
icecream = super.icecream.overridePythonAttrs (old: { icecream = super.icecream.overridePythonAttrs (old: {
# # ERROR: Could not find a version that satisfies the requirement executing>=0.3.1 (from icecream) (from versions: none) # # ERROR: Could not find a version that satisfies the requirement executing>=0.3.1 (from icecream) (from versions: none)
postPatch = '' postPatch = ''
@ -635,20 +645,6 @@ self: super:
importlib-metadata = super.importlib-metadata.overridePythonAttrs ( importlib-metadata = super.importlib-metadata.overridePythonAttrs (
old: { old: {
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ lib.optional self.python.isPy2 self.pathlib2; propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ lib.optional self.python.isPy2 self.pathlib2;
# disable the removal of pyproject.toml, required because of setuptools_scm
dontPreferSetupPy = true;
postPatch = old.postPatch or "" + (lib.optionalString ((old.format or "") != "wheel") ''
substituteInPlace setup.py --replace 'setuptools.setup()' 'setuptools.setup(version="${old.version}")'
'');
}
);
importlib-resources = super.importlib-resources.overridePythonAttrs (
old: {
# disable the removal of pyproject.toml, required because of setuptools_scm
dontPreferSetupPy = true;
} }
); );
@ -670,11 +666,11 @@ self: super:
buildInputs = (old.buildInputs or [ ]) ++ [ buildInputs = (old.buildInputs or [ ]) ++ [
self.toml self.toml
]; ];
# disable the removal of pyproject.toml, required because of setuptools_scm
dontPreferSetupPy = true;
} }
); );
jeepney = addFlit { drv = super.jeepney; };
jira = super.jira.overridePythonAttrs ( jira = super.jira.overridePythonAttrs (
old: { old: {
inherit (pkgs.python3Packages.jira) patches; inherit (pkgs.python3Packages.jira) patches;
@ -706,12 +702,6 @@ self: super:
} }
); );
jsonpickle = super.jsonpickle.overridePythonAttrs (
old: {
dontPreferSetupPy = true;
}
);
jsonslicer = super.jsonslicer.overridePythonAttrs (old: { jsonslicer = super.jsonslicer.overridePythonAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkgconfig ]; nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkgconfig ];
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.yajl ]; buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.yajl ];
@ -741,9 +731,6 @@ self: super:
buildInputs = (old.buildInputs or [ ]) ++ [ buildInputs = (old.buildInputs or [ ]) ++ [
self.toml self.toml
]; ];
postPatch = ''
substituteInPlace setup.py --replace 'setuptools.setup()' 'setuptools.setup(version="${old.version}")'
'';
} }
); );
@ -768,10 +755,6 @@ self: super:
propagatedBuildInputs = [ pkgs.libvirt ]; propagatedBuildInputs = [ pkgs.libvirt ];
}); });
licensecheck = super.licensecheck.overridePythonAttrs (old: {
dontPreferSetupPy = true;
});
llvmlite = super.llvmlite.overridePythonAttrs ( llvmlite = super.llvmlite.overridePythonAttrs (
old: old:
let let
@ -815,11 +798,7 @@ self: super:
} }
); );
lockfile = super.lockfile.overridePythonAttrs ( lockfile = addPbr super.lockfile;
old: {
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.pbr ];
}
);
lxml = super.lxml.overridePythonAttrs ( lxml = super.lxml.overridePythonAttrs (
old: { old: {
@ -850,9 +829,9 @@ self: super:
XDG_RUNTIME_DIR = "/tmp"; XDG_RUNTIME_DIR = "/tmp";
buildInputs = (old.buildInputs or [ ]) buildInputs = (old.buildInputs or [ ])
++ lib.optional enableGhostscript pkgs.ghostscript ++ lib.optional enableGhostscript pkgs.ghostscript
++ lib.optional stdenv.isDarwin [ Cocoa ] ++ lib.optional stdenv.isDarwin [ Cocoa ]
++ [ self.certifi ]; ++ [ self.certifi ];
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
pkgs.pkg-config pkgs.pkg-config
@ -875,9 +854,9 @@ self: super:
pkgs.freetype pkgs.freetype
pkgs.qhull pkgs.qhull
] ]
++ lib.optionals enableGtk3 [ pkgs.cairo self.pycairo pkgs.gtk3 pkgs.gobject-introspection self.pygobject3 ] ++ lib.optionals enableGtk3 [ pkgs.cairo self.pycairo pkgs.gtk3 pkgs.gobject-introspection self.pygobject3 ]
++ lib.optionals enableTk [ pkgs.tcl pkgs.tk self.tkinter pkgs.libX11 ] ++ lib.optionals enableTk [ pkgs.tcl pkgs.tk self.tkinter pkgs.libX11 ]
++ lib.optionals enableQt [ self.pyqt5 ] ++ lib.optionals enableQt [ self.pyqt5 ]
; ;
preBuild = '' preBuild = ''
@ -933,9 +912,7 @@ self: super:
buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools-scm-git-archive ]; buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools-scm-git-archive ];
}); });
mongomock = super.mongomock.overridePythonAttrs (oa: { mongomock = addPbr super.mongomock;
buildInputs = oa.buildInputs ++ [ self.pbr ];
});
mpi4py = super.mpi4py.overridePythonAttrs ( mpi4py = super.mpi4py.overridePythonAttrs (
old: old:
@ -968,11 +945,7 @@ self: super:
} }
); );
munch = super.munch.overridePythonAttrs ( munch = addPbr super.munch;
old: {
buildInputs = (old.buildInputs or [ ]) ++ [ self.pbr ];
}
);
mypy = super.mypy.overridePythonAttrs ( mypy = super.mypy.overridePythonAttrs (
old: { old: {
@ -1087,6 +1060,8 @@ self: super:
''; '';
}); });
pastel = addPoetry { drv = super.pastel; };
paramiko = super.paramiko.overridePythonAttrs (old: { paramiko = super.paramiko.overridePythonAttrs (old: {
doCheck = false; # requires networking doCheck = false; # requires networking
}); });
@ -1112,8 +1087,8 @@ self: super:
{ {
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.sqlite ]; buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.sqlite ];
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) propagatedBuildInputs = (old.propagatedBuildInputs or [ ])
++ lib.optional withPostgres self.psycopg2 ++ lib.optional withPostgres self.psycopg2
++ lib.optional withMysql self.mysql-connector; ++ lib.optional withMysql self.mysql-connector;
} }
); );
@ -1124,12 +1099,6 @@ self: super:
} }
); );
platformdirs = super.platformdirs.overridePythonAttrs (old: {
postPatch = ''
substituteInPlace setup.py --replace 'setup()' 'setup(version="${old.version}")'
'';
});
poetry-core = super.poetry-core.overridePythonAttrs (old: { poetry-core = super.poetry-core.overridePythonAttrs (old: {
# "Vendor" dependencies (for build-system support) # "Vendor" dependencies (for build-system support)
postPatch = '' postPatch = ''
@ -1152,8 +1121,6 @@ self: super:
buildInputs = (old.buildInputs or [ ]) ++ [ buildInputs = (old.buildInputs or [ ]) ++ [
self.toml self.toml
]; ];
# disable the removal of pyproject.toml, required because of setuptools_scm
dontPreferSetupPy = true;
} }
); );
@ -1164,7 +1131,7 @@ self: super:
psycopg2 = super.psycopg2.overridePythonAttrs ( psycopg2 = super.psycopg2.overridePythonAttrs (
old: { old: {
buildInputs = (old.buildInputs or [ ]) buildInputs = (old.buildInputs or [ ])
++ lib.optional stdenv.isDarwin pkgs.openssl; ++ lib.optional stdenv.isDarwin pkgs.openssl;
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.postgresql ]; nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.postgresql ];
} }
); );
@ -1172,7 +1139,7 @@ self: super:
psycopg2-binary = super.psycopg2-binary.overridePythonAttrs ( psycopg2-binary = super.psycopg2-binary.overridePythonAttrs (
old: { old: {
buildInputs = (old.buildInputs or [ ]) buildInputs = (old.buildInputs or [ ])
++ lib.optional stdenv.isDarwin pkgs.openssl; ++ lib.optional stdenv.isDarwin pkgs.openssl;
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.postgresql ]; nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.postgresql ];
} }
); );
@ -1341,9 +1308,9 @@ self: super:
pymssql = super.pymssql.overridePythonAttrs (old: { pymssql = super.pymssql.overridePythonAttrs (old: {
buildInputs = (old.buildInputs or [ ]) buildInputs = (old.buildInputs or [ ])
++ [ self.cython pkgs.openssl ]; ++ [ self.cython pkgs.openssl ];
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) propagatedBuildInputs = (old.propagatedBuildInputs or [ ])
++ [ pkgs.freetds ]; ++ [ pkgs.freetds ];
}); });
pyopenssl = super.pyopenssl.overridePythonAttrs ( pyopenssl = super.pyopenssl.overridePythonAttrs (
@ -1355,18 +1322,14 @@ self: super:
pyproj = super.pyproj.overridePythonAttrs ( pyproj = super.pyproj.overridePythonAttrs (
old: { old: {
buildInputs = (old.buildInputs or [ ]) ++ buildInputs = (old.buildInputs or [ ]) ++
[ self.cython ]; [ self.cython ];
PROJ_DIR = "${pkgs.proj}"; PROJ_DIR = "${pkgs.proj}";
PROJ_LIBDIR = "${pkgs.proj}/lib"; PROJ_LIBDIR = "${pkgs.proj}/lib";
PROJ_INCDIR = "${pkgs.proj.dev}/include"; PROJ_INCDIR = "${pkgs.proj.dev}/include";
} }
); );
pyproject-flake8 = super.pyproject-flake8.overridePythonAttrs ( pyproject-flake8 = addFlit { drv = super.pyproject-flake8; };
old: {
buildInputs = (old.buildInputs or [ ]) ++ [ self.flit-core ];
}
);
pyrfr = super.pyrfr.overridePythonAttrs (old: { pyrfr = super.pyrfr.overridePythonAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.swig ]; nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.swig ];
@ -1400,6 +1363,8 @@ self: super:
} }
); );
pytzdata = addPoetry { drv = super.pytzdata; poetryDrv = self.poetry; };
pyqt5 = pyqt5 =
let let
drv = super.pyqt5; drv = super.pyqt5;
@ -1426,10 +1391,10 @@ self: super:
# self.pyqt5-sip # self.pyqt5-sip
self.sip self.sip
] ]
++ lib.optional withConnectivity pkgs.qt5.qtconnectivity ++ lib.optional withConnectivity pkgs.qt5.qtconnectivity
++ lib.optional withMultimedia pkgs.qt5.qtmultimedia ++ lib.optional withMultimedia pkgs.qt5.qtmultimedia
++ lib.optional withWebKit pkgs.qt5.qtwebkit ++ lib.optional withWebKit pkgs.qt5.qtwebkit
++ lib.optional withWebSockets pkgs.qt5.qtwebsockets ++ lib.optional withWebSockets pkgs.qt5.qtwebsockets
; ;
buildInputs = (old.buildInputs or [ ]) ++ [ buildInputs = (old.buildInputs or [ ]) ++ [
@ -1439,9 +1404,9 @@ self: super:
pkgs.qt5.qtdeclarative pkgs.qt5.qtdeclarative
self.sip self.sip
] ]
++ lib.optional withConnectivity pkgs.qt5.qtconnectivity ++ lib.optional withConnectivity pkgs.qt5.qtconnectivity
++ lib.optional withWebKit pkgs.qt5.qtwebkit ++ lib.optional withWebKit pkgs.qt5.qtwebkit
++ lib.optional withWebSockets pkgs.qt5.qtwebsockets ++ lib.optional withWebSockets pkgs.qt5.qtwebsockets
; ;
# Fix dbus mainloop # Fix dbus mainloop
@ -1531,6 +1496,8 @@ self: super:
} }
); );
pytest-httpserver = addPoetry { drv = super.pytest-httpserver; };
pytest-randomly = super.pytest-randomly.overrideAttrs (old: { pytest-randomly = super.pytest-randomly.overrideAttrs (old: {
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [
self.importlib-metadata self.importlib-metadata
@ -1672,21 +1639,11 @@ self: super:
} }
); );
requests-mock = super.requests-mock.overridePythonAttrs ( requests-mock = addPbr super.requests-mock;
old: {
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ super.pbr ];
}
);
requests-unixsocket = super.requests-unixsocket.overridePythonAttrs ( requests-unixsocket = addPbr super.requests-unixsocket;
old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.pbr ];
}
);
requestsexceptions = super.requestsexceptions.overridePythonAttrs (old: { requestsexceptions = addPbr super.requestsexceptions;
nativeBuildInputs = old.nativeBuildInputs ++ [ self.pbr ];
});
rlp = super.rlp.overridePythonAttrs { rlp = super.rlp.overridePythonAttrs {
preConfigure = '' preConfigure = ''
@ -1694,8 +1651,15 @@ self: super:
''; '';
}; };
rsa = addPoetry { drv = super.rsa; };
rmfuse = super.rmfuse.overridePythonAttrs (old: { rich = addPoetry { drv = super.rich; };
rmcl = addPoetry { drv = super.rmcl; };
rmrl = addPoetry { drv = super.rmrl; };
rmfuse = (addPoetry { drv = super.rmfuse; }).overridePythonAttrs (old: {
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ]; propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools ];
}); });
@ -1711,7 +1675,7 @@ self: super:
ruamel-yaml = super.ruamel-yaml.overridePythonAttrs ( ruamel-yaml = super.ruamel-yaml.overridePythonAttrs (
old: { old: {
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) propagatedBuildInputs = (old.propagatedBuildInputs or [ ])
++ [ self.ruamel-yaml-clib ]; ++ [ self.ruamel-yaml-clib ];
} }
); );
@ -1719,8 +1683,8 @@ self: super:
old: old:
if old.format != "wheel" then { if old.format != "wheel" then {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++
[ pkgs.gfortran ] ++ [ pkgs.gfortran ] ++
lib.optional (lib.versionAtLeast super.scipy.version "1.7.0") [ self.cython self.pythran ]; lib.optional (lib.versionAtLeast super.scipy.version "1.7.0") [ self.cython self.pythran ];
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.pybind11 ]; propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.pybind11 ];
setupPyBuildFlags = [ "--fcompiler='gnu95'" ]; setupPyBuildFlags = [ "--fcompiler='gnu95'" ];
enableParallelBuilding = true; enableParallelBuilding = true;
@ -1816,8 +1780,6 @@ self: super:
buildInputs = (old.buildInputs or [ ]) ++ [ buildInputs = (old.buildInputs or [ ]) ++ [
self.toml self.toml
]; ];
# disable the removal of pyproject.toml, required because of setuptools_scm
dontPreferSetupPy = true;
} }
); );
@ -1859,7 +1821,11 @@ self: super:
} }
); );
tinycss2 = super.tinycss2.overridePythonAttrs ( tinycss2 = (addFlit {
drv = super.tinycss2;
# Note: requires full flit, not just flit-core
flitDrv = self.flit;
}).overridePythonAttrs (
old: { old: {
buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ]; buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ];
} }
@ -1916,8 +1882,8 @@ self: super:
# without that autoPatchelfHook will fail because cudatoolkit is not in LD_LIBRARY_PATH # without that autoPatchelfHook will fail because cudatoolkit is not in LD_LIBRARY_PATH
autoPatchelfIgnoreMissingDeps = true; autoPatchelfIgnoreMissingDeps = true;
buildInputs = (old.buildInputs or [ ]) buildInputs = (old.buildInputs or [ ])
++ [ self.torch ] ++ [ self.torch ]
++ lib.optionals enableCuda [ ++ lib.optionals enableCuda [
cudatoolkit cudatoolkit
]; ];
preConfigure = preConfigure =
@ -1929,26 +1895,21 @@ self: super:
})) }))
{ }; { };
typeguard = super.typeguard.overridePythonAttrs (old: {
postPatch = ''
substituteInPlace setup.py \
--replace 'setup()' 'setup(version="${old.version}")'
'';
});
typed_ast = super.typed-ast.overridePythonAttrs (old: { typed_ast = super.typed-ast.overridePythonAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
self.pytest-runner self.pytest-runner
]; ];
}); });
# nix uses a dash, poetry uses an underscore typing-extensions =
typing-extensions = (super.typing_extensions or super.typing-extensions).overridePythonAttrs ( let
old: { # nix uses a dash, poetry uses an underscore
buildInputs = (old.buildInputs or [ ]) ++ old = super.typing_extensions or super.typing-extensions;
lib.optional (lib.versionAtLeast old.version "4.0.0") [ self.flit-core ]; in
} addFlit {
); drv = old;
cond = lib.versionAtLeast old.version "4.0.0";
};
urwidtrees = super.urwidtrees.overridePythonAttrs ( urwidtrees = super.urwidtrees.overridePythonAttrs (
old: { old: {
@ -2038,21 +1999,7 @@ self: super:
if isWheel then wheelPackage else sourcePackage; if isWheel then wheelPackage else sourcePackage;
zipp = if super.zipp == null then null else zipp = if super.zipp == null then null else
( super.zipp.overridePythonAttrs (
if lib.versionAtLeast super.zipp.version "2.0.0" then
(
super.zipp.overridePythonAttrs (
old:
if (old.format or "pyproject") != "wheel" then {
prePatch = ''
substituteInPlace setup.py --replace \
'setuptools.setup()' \
'setuptools.setup(version="${super.zipp.version}")'
'';
} else old
)
) else super.zipp
).overridePythonAttrs (
old: { old: {
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [
self.toml self.toml
@ -2066,25 +2013,23 @@ self: super:
} }
); );
hashids = super.hashids.overridePythonAttrs ( hashids = addFlit { drv = super.hashids; };
old: {
buildInputs = (old.buildInputs or [ ]) ++ [ self.flit-core ];
}
);
packaging = super.packaging.overridePythonAttrs ( packaging =
old: { let
buildInputs = (old.buildInputs or [ ]) ++ old = super.packaging;
# From 20.5 until 20.7, packaging used flit for packaging (heh) in
# See https://github.com/pypa/packaging/pull/352 and https://github.com/pypa/packaging/pull/367 addFlit {
lib.optional (lib.versionAtLeast old.version "20.5" && lib.versionOlder old.version "20.8") [ self.flit-core ]; drv = old;
} # From 20.5 until 20.7, packaging used flit for packaging (heh)
); # See https://github.com/pypa/packaging/pull/352 and https://github.com/pypa/packaging/pull/367
cond = lib.versionAtLeast old.version "20.5" && lib.versionOlder old.version "20.8";
};
psutil = super.psutil.overridePythonAttrs ( psutil = super.psutil.overridePythonAttrs (
old: { old: {
buildInputs = (old.buildInputs or [ ]) ++ buildInputs = (old.buildInputs or [ ]) ++
lib.optional stdenv.isDarwin pkgs.darwin.apple_sdk.frameworks.IOKit; lib.optional stdenv.isDarwin pkgs.darwin.apple_sdk.frameworks.IOKit;
} }
); );
@ -2137,7 +2082,7 @@ self: super:
watchdog = super.watchdog.overrideAttrs ( watchdog = super.watchdog.overrideAttrs (
old: { old: {
buildInputs = (old.buildInputs or [ ]) buildInputs = (old.buildInputs or [ ])
++ pkgs.lib.optional pkgs.stdenv.isDarwin pkgs.darwin.apple_sdk.frameworks.CoreServices; ++ pkgs.lib.optional pkgs.stdenv.isDarwin pkgs.darwin.apple_sdk.frameworks.CoreServices;
} }
); );
@ -2166,6 +2111,9 @@ self: super:
} }
); );
# NixOps >=2 dependency
nixos-modules-contrib = addPoetry { drv = super.nixos-modules-contrib; poetryDrv = self.poetry; };
wxpython = super.wxpython.overridePythonAttrs (old: wxpython = super.wxpython.overridePythonAttrs (old:
let let
localPython = self.python.withPackages (ps: with ps; [ localPython = self.python.withPackages (ps: with ps; [
@ -2226,13 +2174,6 @@ self: super:
} }
); );
lazy-object-proxy = super.lazy-object-proxy.overridePythonAttrs (
old: {
# disable the removal of pyproject.toml, required because of setuptools_scm
dontPreferSetupPy = true;
}
);
pendulum = super.pendulum.overridePythonAttrs (old: { pendulum = super.pendulum.overridePythonAttrs (old: {
buildInputs = (old.buildInputs or [ ]) ++ [ self.poetry ]; buildInputs = (old.buildInputs or [ ]) ++ [ self.poetry ];
# Technically incorrect, but fixes the build error.. # Technically incorrect, but fixes the build error..
@ -2241,22 +2182,18 @@ self: super:
''; '';
}); });
ptyprocess = addFlit { drv = super.ptyprocess; };
pygraphviz = super.pygraphviz.overridePythonAttrs (old: { pygraphviz = super.pygraphviz.overridePythonAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkg-config ]; nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.pkg-config ];
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.graphviz ]; buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.graphviz ];
}); });
pyjsg = super.pyjsg.overridePythonAttrs (old: { pyjsg = addPbr super.pyjsg;
buildInputs = (old.buildInputs or [ ]) ++ [ self.pbr ];
});
pyshex = super.pyshex.overridePythonAttrs (old: { pyshex = addPbr super.pyshex;
buildInputs = (old.buildInputs or [ ]) ++ [ self.pbr ];
});
pyshexc = super.pyshexc.overridePythonAttrs (old: { pyshexc = addPbr super.pyshexc;
buildInputs = (old.buildInputs or [ ]) ++ [ self.pbr ];
});
pysqlite = super.pysqlite.overridePythonAttrs (old: { pysqlite = super.pysqlite.overridePythonAttrs (old: {
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.sqlite ]; buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.sqlite ];
@ -2266,17 +2203,13 @@ self: super:
buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools-scm-git-archive ]; buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools-scm-git-archive ];
}); });
shexjsg = super.shexjsg.overridePythonAttrs (old: { shexjsg = addPbr super.shexjsg;
buildInputs = (old.buildInputs or [ ]) ++ [ self.pbr ];
});
sparqlslurper = super.sparqlslurper.overridePythonAttrs (old: { sparqlslurper = addPbr super.sparqlslurper;
buildInputs = (old.buildInputs or [ ]) ++ [ self.pbr ];
});
tomli = super.tomli.overridePythonAttrs (old: { tomlkit = addPoetry { drv = super.tomlkit; };
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.flit-core ];
}); tomli = addFlit { drv = super.tomli; };
uwsgi = super.uwsgi.overridePythonAttrs (old: { uwsgi = super.uwsgi.overridePythonAttrs (old: {
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.ncurses ]; buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.ncurses ];
@ -2285,11 +2218,17 @@ self: super:
wcwidth = super.wcwidth.overridePythonAttrs (old: { wcwidth = super.wcwidth.overridePythonAttrs (old: {
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++
lib.optional self.isPy27 (self.backports-functools-lru-cache or self.backports_functools_lru_cache) lib.optional self.isPy27 (self.backports-functools-lru-cache or self.backports_functools_lru_cache)
; ;
}); });
wtforms = super.wtforms.overridePythonAttrs (old: { wtforms = super.wtforms.overridePythonAttrs (old: {
buildInputs = (old.buildInputs or [ ]) ++ [ self.Babel ]; buildInputs = (old.buildInputs or [ ]) ++ [ self.Babel ];
}); });
}
xdg = addPoetry { drv = super.xdg; };
} // (
# NixOps
(lib.mapAttrs (_: v: addPoetry { drv = v; poetryDrv = self.poetry; }) (lib.filterAttrs (n: _: lib.strings.hasPrefix "nixops" n) super))
)

View file

@ -65,6 +65,9 @@ builtins.removeAttrs
aiopath = callTest ./aiopath { }; aiopath = callTest ./aiopath { };
fetched-projectdir = callTest ./fetched-projectdir { }; fetched-projectdir = callTest ./fetched-projectdir { };
# Inherit test cases from nixpkgs
inherit (pkgs) nixops nixopsUnstable rmfuse;
# Test building poetry # Test building poetry
inherit poetry; inherit poetry;

View file

@ -6,4 +6,9 @@ poetry2nix.mkPoetryApplication {
poetrylock = ./poetry.lock; poetrylock = ./poetry.lock;
src = lib.cleanSource ./.; src = lib.cleanSource ./.;
pwd = ./.; pwd = ./.;
overrides = poetry2nix.overrides.withDefaults (self: super: {
trivial = super.trivial.overridePythonAttrs (old: {
buildInputs = old.buildInputs or [ ] ++ [ self.poetry ];
});
});
} }

View file

@ -6,4 +6,9 @@ poetry2nix.mkPoetryApplication {
poetrylock = ./poetry.lock; poetrylock = ./poetry.lock;
src = lib.cleanSource ./.; src = lib.cleanSource ./.;
pwd = ./.; pwd = ./.;
overrides = poetry2nix.overrides.withDefaults (self: super: {
trivial = super.trivial.overridePythonAttrs (old: {
buildInputs = old.buildInputs or [ ] ++ [ self.poetry ];
});
});
} }