Merge pull request #171580 from adisbladis/poetry2nix-1_28_0

poetry2nix: 1.27.1 -> 1.28.0
This commit is contained in:
adisbladis 2022-05-05 10:55:52 +07:00 committed by GitHub
commit 98df69fed4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 262 additions and 12 deletions

View file

@ -5,7 +5,7 @@
}:
let
# Poetry2nix version
version = "1.27.1";
version = "1.28.0";
inherit (poetryLib) isCompatible readTOML moduleName;
@ -287,12 +287,20 @@ lib.makeScope pkgs.newScope (self: {
(name: value: projectDir + "/${value.path}")
(lib.filterAttrs (name: dep: dep.develop or false && hasAttr "path" dep) set);
editablePackageSources' = (
excludedEditablePackageNames = builtins.filter
(pkg: editablePackageSources."${pkg}" == null)
(builtins.attrNames editablePackageSources);
allEditablePackageSources = (
(getEditableDeps (pyProject.tool.poetry."dependencies" or { }))
// (getEditableDeps (pyProject.tool.poetry."dev-dependencies" or { }))
// editablePackageSources
);
editablePackageSources' = builtins.removeAttrs
allEditablePackageSources
excludedEditablePackageNames;
poetryPython = self.mkPoetryPackages {
inherit pyproject poetrylock overrides python pwd preferWheels pyProject;
editablePackageSources = editablePackageSources';

View file

@ -180,7 +180,7 @@ let
hasGitIgnore = builtins.pathExists gitIgnore;
gitIgnores = if hasGitIgnore then [ gitIgnore ] else [ ];
in
lib.optionals (builtins.toString path != "/" && ! isGitRoot) (findGitIgnores parent) ++ gitIgnores;
lib.optionals (builtins.pathExists path && builtins.toString path != "/" && ! isGitRoot) (findGitIgnores parent) ++ gitIgnores;
/*
Provides a source filtering mechanism that:

View file

@ -29,6 +29,9 @@
"aioflo": [
"poetry-core"
],
"aiogithubapi": [
"poetry-core"
],
"aioguardian": [
"poetry-core"
],
@ -89,9 +92,21 @@
"amqtt": [
"poetry-core"
],
"ansible-doctor": [
"poetry-core"
],
"ansible-later": [
"poetry-core"
],
"ansible-runner": [
"pbr"
],
"apache-beam": [
"cython"
],
"aplpy": [
"cython"
],
"argon2_cffi": [
"flitBuildHook"
],
@ -114,15 +129,24 @@
"atomman": [
"cython"
],
"atpublic": [
"pdm-pep517"
],
"autarco": [
"poetry-core"
],
"authcaptureproxy": [
"poetry-core"
],
"av": [
"cython"
],
"awesomeversion": [
"poetry-core"
],
"aws-adfs": [
"poetry-core"
],
"aws-error-utils": [
"poetry"
],
@ -147,6 +171,9 @@
"boltztrap2": [
"cython"
],
"bsblan": [
"poetry-core"
],
"build": [
"flit-core"
],
@ -183,6 +210,9 @@
"clikit": [
"poetry-core"
],
"cloudflare-dyndns": [
"poetry"
],
"collections-extended": [
"poetry-core"
],
@ -210,7 +240,8 @@
"poetry-core"
],
"cssselect2": [
"flit"
"flit",
"flit-core"
],
"cwcwidth": [
"cython"
@ -224,9 +255,15 @@
"cypari2": [
"cython"
],
"cypherpunkpay": [
"poetry-core"
],
"cysignals": [
"cython"
],
"datadog": [
"hatchling"
],
"datrie": [
"cython"
],
@ -260,6 +297,9 @@
"doc8": [
"pbr"
],
"docstring-parser": [
"poetry-core"
],
"dtlssocket": [
"cython"
],
@ -301,7 +341,8 @@
"poetry-core"
],
"entrypoints": [
"flit"
"flit",
"flit-core"
],
"enturclient": [
"poetry-core"
@ -309,6 +350,13 @@
"enumatch": [
"poetry"
],
"exceptiongroup": [
"flit-core",
"flitBuildHook"
],
"falcon": [
"cython"
],
"fastapi": [
"flitBuildHook"
],
@ -378,6 +426,9 @@
"generic": [
"poetry-core"
],
"gensim": [
"cython"
],
"glances-api": [
"poetry-core"
],
@ -492,9 +543,15 @@
"ipwhl": [
"flitBuildHook"
],
"iso8601": [
"poetry-core"
],
"isort": [
"poetry-core"
],
"jarowinkler": [
"cython"
],
"jedi-language-server": [
"poetry"
],
@ -519,6 +576,12 @@
"jupyterlab": [
"jupyter-packaging"
],
"jupyterlab-code-formatter": [
"jupyter-packaging"
],
"jupyterlab-pygments": [
"jupyter-packaging"
],
"keystoneauth1": [
"pbr"
],
@ -537,6 +600,9 @@
"ldappool": [
"pbr"
],
"levenshtein": [
"cython"
],
"libgpuarray": [
"cython"
],
@ -564,6 +630,9 @@
"lockfile": [
"pbr"
],
"lsassy": [
"poetry-core"
],
"luftdaten": [
"poetry-core"
],
@ -585,6 +654,9 @@
"marisa-trie": [
"cython"
],
"markdown-it-py": [
"flit-core"
],
"mask-rcnn": [
"cython"
],
@ -607,6 +679,9 @@
"memory-allocator": [
"cython"
],
"meteofrance-api": [
"poetry"
],
"metprint": [
"poetry-core"
],
@ -618,6 +693,7 @@
"poetry"
],
"mkdocs-jupyter": [
"ipython_genutils",
"poetry-core"
],
"mkdocs-literate-nav": [
@ -674,6 +750,9 @@
"netdata": [
"poetry-core"
],
"netutils": [
"poetry-core"
],
"newversion": [
"poetry-core"
],
@ -689,6 +768,9 @@
"nkdfu": [
"flitBuildHook"
],
"notebook-shim": [
"jupyter-packaging"
],
"notus-scanner": [
"poetry-core"
],
@ -728,6 +810,9 @@
"openvino": [
"cython"
],
"ordered-set": [
"flit-core"
],
"ormar": [
"poetry-core"
],
@ -807,6 +892,9 @@
"poetry": [
"poetry-core"
],
"poetry-dynamic-versioning": [
"poetry-core"
],
"poetry2conda": [
"poetry"
],
@ -930,6 +1018,9 @@
"pymaven-patch": [
"pbr"
],
"pymdown-extensions": [
"hatchling"
],
"pymfy": [
"poetry-core"
],
@ -954,6 +1045,9 @@
"pyoverkiz": [
"poetry-core"
],
"pyparsing": [
"flit-core"
],
"pypass": [
"pbr"
],
@ -978,12 +1072,21 @@
"pyproject-flake8": [
"flit-core"
],
"pypsrp": [
"poetry-core"
],
"pyquil": [
"poetry-core"
],
"pyrad": [
"poetry-core"
],
"pyregion": [
"cython"
],
"pyrevolve": [
"cython"
],
"pyrmvtransport": [
"flit"
],
@ -999,6 +1102,9 @@
"pysigma": [
"poetry-core"
],
"pysigma-backend-insightidr": [
"poetry-core"
],
"pysigma-backend-splunk": [
"poetry-core"
],
@ -1008,14 +1114,30 @@
"pysigma-pipeline-sysmon": [
"poetry-core"
],
"pysigma-pipeline-windows": [
"poetry-core"
],
"pyslurm": [
"cython"
],
"pysmf": [
"cython"
],
"pysml": [
"poetry-core"
],
"pysnmp-pyasn1": [
"poetry-core"
],
"pysnmp-pysmi": [
"poetry-core"
],
"pysnmplib": [
"poetry-core"
],
"pysnow": [
"poetry"
"poetry",
"poetry-core"
],
"pysptk": [
"cython"
@ -1035,6 +1157,9 @@
"pytest-httpserver": [
"poetry-core"
],
"pytest-isort": [
"poetry-core"
],
"pytest-mockservers": [
"poetry-core"
],
@ -1097,6 +1222,9 @@
"python-openstackclient": [
"pbr"
],
"python-pae": [
"poetry-core"
],
"python-pkcs11": [
"cython"
],
@ -1215,7 +1343,8 @@
"poetry-core"
],
"rokuecp": [
"poetry"
"poetry",
"poetry-core"
],
"roombapy": [
"poetry-core"
@ -1280,6 +1409,9 @@
"sentinel": [
"poetry-core"
],
"seventeentrack": [
"poetry-core"
],
"sfepy": [
"cython"
],
@ -1301,9 +1433,15 @@
"slowapi": [
"poetry-core"
],
"socksio": [
"flit-core"
],
"solo-python": [
"flitBuildHook"
],
"soupsieve": [
"hatchling"
],
"spacy-pkuseg": [
"cython"
],
@ -1425,7 +1563,8 @@
"cython"
],
"testpath": [
"flit"
"flit",
"flit-core"
],
"testrepository": [
"pbr"
@ -1505,6 +1644,9 @@
"typing-extensions": [
"flit-core"
],
"uharfbuzz": [
"cython"
],
"unpaddedbase64": [
"poetry-core"
],
@ -1550,8 +1692,14 @@
"yoda": [
"cython"
],
"yte": [
"poetry-core"
],
"zeversolarlocal": [
"flit-core",
"flitBuildHook"
],
"zwave-me-ws": [
"poetry-core"
]
}

View file

@ -8,13 +8,14 @@ let
{ self
, drv
, attr
, extraAttrs ? [ ]
}:
let
buildSystem = if attr == "cython" then self.python.pythonForBuild.pkgs.cython else self.${attr};
in
(
# Flit only works on Python3
if (attr == "flit-core" || attr == "flit") && !self.isPy3k then drv
if (attr == "flit-core" || attr == "flit" || attr == "hatchling") && !self.isPy3k then drv
else
drv.overridePythonAttrs (
old:
@ -23,7 +24,7 @@ let
{ }
else
{
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.${attr} ];
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ self.${attr} ] ++ map (a: self.${a}) extraAttrs;
}
)
);
@ -55,6 +56,16 @@ lib.composeManyExtensions [
systems)
buildSystems)
# Build systems with conditionals
(self: super: {
platformdirs =
if lib.versionAtLeast super.platformdirs.version "2.5.2"
then addBuildSystem { inherit self; drv = super.platformdirs; attr = "hatchling"; extraAttrs = [ "hatch-vcs" ]; }
else super.platformdirs;
})
# Build fixes
(self: super:
let
@ -437,6 +448,17 @@ lib.composeManyExtensions [
}
);
# Setuptools >= 60 broke build_py_2to3
docutils =
if lib.versionOlder super.docutils.version "0.16" && lib.versionAtLeast super.setuptools.version "60" then
(
super.docutils.overridePythonAttrs (
old: {
SETUPTOOLS_USE_DISTUTILS = "stdlib";
}
)
) else super.docutils;
# Environment markers are not always included (depending on how a dep was defined)
enum34 = if self.pythonAtLeast "3.4" then null else super.enum34;
@ -844,6 +866,17 @@ lib.composeManyExtensions [
}
);
lsassy =
if super.lsassy.version == "3.1.1" then
super.lsassy.overridePythonAttrs
(old: {
# pyproject.toml contains a constraint `rich = "^10.6.0"` which is not replicated in setup.py
# hence pypi misses it and poetry pins rich to 11.0.0
preConfigure = (old.preConfigure or "") + ''
rm pyproject.toml
'';
}) else super.lsassy;
lxml = super.lxml.overridePythonAttrs (
old: {
nativeBuildInputs = with pkgs.buildPackages; (old.nativeBuildInputs or [ ]) ++ [ pkg-config libxml2.dev libxslt.dev ] ++ lib.optionals stdenv.isDarwin [ xcodebuild ];
@ -1143,6 +1176,26 @@ lib.composeManyExtensions [
}
);
orjson =
let
getCargoHash = version: {
"3.6.7" = "sha256-sz2k9podPB6QSptkyOu7+BoVTrKhefizRtYU+MICPt4=";
"3.6.8" = "sha256-vpfceVtYkU09xszNIihY1xbqGWieqDquxwsAmDH8jd4=";
}.${version} or null;
in
super.orjson.overridePythonAttrs (old: {
cargoDeps = pkgs.rustPlatform.fetchCargoTarball {
inherit (old) src;
name = "${old.pname}-${old.version}";
hash = getCargoHash old.version;
};
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
pkgs.rustPlatform.cargoSetupHook
pkgs.rustPlatform.maturinBuildHook
];
buildInputs = (old.buildInputs or [ ]) ++ lib.optional pkgs.stdenv.isDarwin pkgs.libiconv;
});
osqp = super.osqp.overridePythonAttrs (
old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.cmake ];
@ -1150,6 +1203,29 @@ lib.composeManyExtensions [
}
);
pandas = super.pandas.overridePythonAttrs (old: {
buildInputs = old.buildInputs or [ ] ++ lib.optional stdenv.isDarwin pkgs.libcxx;
# Doesn't work with -Werror,-Wunused-command-line-argument
# https://github.com/NixOS/nixpkgs/issues/39687
hardeningDisable = lib.optional stdenv.cc.isClang "strictoverflow";
# For OSX, we need to add a dependency on libcxx, which provides
# `complex.h` and other libraries that pandas depends on to build.
postPatch = lib.optionalString stdenv.isDarwin ''
cpp_sdk="${lib.getDev pkgs.libcxx}/include/c++/v1";
echo "Adding $cpp_sdk to the setup.py common_include variable"
substituteInPlace setup.py \
--replace "['pandas/src/klib', 'pandas/src']" \
"['pandas/src/klib', 'pandas/src', '$cpp_sdk']"
'';
enableParallelBuilding = true;
});
pantalaimon = super.pantalaimon.overridePythonAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.installShellFiles ];
postInstall = old.postInstall or "" + ''
@ -1196,8 +1272,12 @@ lib.composeManyExtensions [
pillow = super.pillow.overridePythonAttrs (
old: {
nativeBuildInputs = [ pkg-config self.pytest-runner ] ++ (old.nativeBuildInputs or [ ]);
buildInputs = with pkgs; [ freetype libjpeg zlib libtiff libwebp tcl lcms2 ] ++ (old.buildInputs or [ ]);
nativeBuildInputs = (old.nativeBuildInputs or [ ])
++ [ pkg-config self.pytest-runner ];
buildInputs = with pkgs; (old.buildInputs or [ ])
++ [ freetype libjpeg zlib libtiff libwebp tcl lcms2 ]
++ lib.optionals (lib.versionAtLeast old.version "7.1.0") [ xorg.libxcb ]
++ lib.optionals (self.isPyPy) [ tk xorg.libX11 ];
}
);
@ -1246,6 +1326,14 @@ lib.composeManyExtensions [
}
);
psycopg2cffi = super.psycopg2cffi.overridePythonAttrs (
old: {
buildInputs = (old.buildInputs or [ ])
++ lib.optional stdenv.isDarwin pkgs.openssl;
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.postgresql ];
}
);
py-solc-x = super.py-solc-x.overridePythonAttrs (
old: {
preConfigure = ''
@ -1860,6 +1948,12 @@ lib.composeManyExtensions [
});
soundfile = super.soundfile.overridePythonAttrs (old: {
postPatch = ''
substituteInPlace soundfile.py --replace "_find_library('sndfile')" "'${pkgs.libsndfile.out}/lib/libsndfile${stdenv.hostPlatform.extensions.sharedLibrary}'"
'';
});
systemd-python = super.systemd-python.overridePythonAttrs (old: {
buildInputs = old.buildInputs ++ [ pkgs.systemd ];
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.pkg-config ];