mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 06:45:16 +01:00
poetry2nix: 1.39.1 -> 1.40.0
This commit is contained in:
parent
a64e169e39
commit
096cb0ea37
13 changed files with 3144 additions and 1625 deletions
|
@ -1,10 +1,11 @@
|
|||
{ pkgs ? import <nixpkgs> { }
|
||||
, lib ? pkgs.lib
|
||||
, poetry ? null
|
||||
, poetryLib ? import ./lib.nix { inherit lib pkgs; stdenv = pkgs.stdenv; }
|
||||
}:
|
||||
let
|
||||
# Poetry2nix version
|
||||
version = "1.39.1";
|
||||
version = "1.40.1";
|
||||
|
||||
inherit (poetryLib) isCompatible readTOML normalizePackageName normalizePackageSet;
|
||||
|
||||
|
@ -27,6 +28,7 @@ let
|
|||
, includeBuildSystem ? true
|
||||
, groups ? [ ]
|
||||
, checkGroups ? [ "dev" ]
|
||||
, extras ? [ "*" ] # * means all extras, otherwise include the dependencies for a given extra
|
||||
}:
|
||||
let
|
||||
getInputs = attr: attrs.${attr} or [ ];
|
||||
|
@ -58,12 +60,26 @@ let
|
|||
|
||||
mkInput = attr: extraInputs: getInputs attr ++ extraInputs;
|
||||
|
||||
rawDeps = pyProject.tool.poetry."dependencies" or { };
|
||||
|
||||
rawRequiredDeps = lib.filterAttrs (_: v: !(v.optional or false)) rawDeps;
|
||||
|
||||
desiredExtrasDeps = lib.unique
|
||||
(lib.concatMap (extra: pyProject.tool.poetry.extras.${extra}) extras);
|
||||
|
||||
allRawDeps =
|
||||
if extras == [ "*" ] then
|
||||
rawDeps
|
||||
else
|
||||
rawRequiredDeps // lib.getAttrs desiredExtrasDeps rawDeps;
|
||||
checkInputs' = getDeps (pyProject.tool.poetry."dev-dependencies" or { }) # <poetry-1.2.0
|
||||
# >=poetry-1.2.0 dependency groups
|
||||
++ lib.flatten (map (g: getDeps (pyProject.tool.poetry.group.${g}.dependencies or { })) checkGroups);
|
||||
in
|
||||
{
|
||||
buildInputs = mkInput "buildInputs" (if includeBuildSystem then buildSystemPkgs else [ ]);
|
||||
propagatedBuildInputs = mkInput "propagatedBuildInputs" (
|
||||
(getDeps pyProject.tool.poetry."dependencies" or { })
|
||||
++ (
|
||||
getDeps allRawDeps ++ (
|
||||
# >=poetry-1.2.0 dependency groups
|
||||
if pyProject.tool.poetry.group or { } != { }
|
||||
then lib.flatten (map (g: getDeps pyProject.tool.poetry.group.${g}.dependencies) groups)
|
||||
|
@ -71,11 +87,8 @@ let
|
|||
)
|
||||
);
|
||||
nativeBuildInputs = mkInput "nativeBuildInputs" [ ];
|
||||
nativeCheckInputs = mkInput "nativeCheckInputs" (
|
||||
getDeps (pyProject.tool.poetry."dev-dependencies" or { }) # <poetry-1.2.0
|
||||
# >=poetry-1.2.0 dependency groups
|
||||
++ lib.flatten (map (g: getDeps (pyProject.tool.poetry.group.${g}.dependencies or { })) checkGroups)
|
||||
);
|
||||
checkInputs = mkInput "checkInputs" checkInputs';
|
||||
nativeCheckInputs = mkInput "nativeCheckInputs" checkInputs';
|
||||
};
|
||||
|
||||
|
||||
|
@ -124,6 +137,7 @@ lib.makeScope pkgs.newScope (self: {
|
|||
{ projectDir ? null
|
||||
, pyproject ? projectDir + "/pyproject.toml"
|
||||
, poetrylock ? projectDir + "/poetry.lock"
|
||||
, poetrylockPos ? { file = toString poetrylock; line = 0; column = 0; }
|
||||
, overrides ? self.defaultPoetryOverrides
|
||||
, python ? pkgs.python3
|
||||
, pwd ? projectDir
|
||||
|
@ -133,6 +147,7 @@ lib.makeScope pkgs.newScope (self: {
|
|||
, pyProject ? readTOML pyproject
|
||||
, groups ? [ ]
|
||||
, checkGroups ? [ "dev" ]
|
||||
, extras ? [ "*" ]
|
||||
}:
|
||||
let
|
||||
/* The default list of poetry2nix override overlays */
|
||||
|
@ -193,6 +208,7 @@ lib.makeScope pkgs.newScope (self: {
|
|||
value = self.mkPoetryDep (
|
||||
pkgMeta // {
|
||||
inherit pwd preferWheels;
|
||||
pos = poetrylockPos;
|
||||
source = pkgMeta.source or null;
|
||||
# Default to files from lock file version 2.0 and fall back to 1.1
|
||||
files = pkgMeta.files or lockFiles.${normalizedName};
|
||||
|
@ -221,6 +237,11 @@ lib.makeScope pkgs.newScope (self: {
|
|||
(
|
||||
[
|
||||
# Remove Python packages aliases with non-normalized names to avoid issues with infinite recursion (issue #750).
|
||||
(self: super: {
|
||||
# Upstream nixpkgs uses non canonical names
|
||||
async-generator = super.async-generator or super.async_generator or null;
|
||||
})
|
||||
|
||||
(self: super: lib.attrsets.mapAttrs
|
||||
(
|
||||
name: value:
|
||||
|
@ -248,7 +269,7 @@ lib.makeScope pkgs.newScope (self: {
|
|||
}
|
||||
)
|
||||
|
||||
# Fix infinite recursion in a lot of packages because of nativeCheckInputs
|
||||
# Fix infinite recursion in a lot of packages because of checkInputs
|
||||
(self: super: lib.mapAttrs
|
||||
(name: value: (
|
||||
if lib.isDerivation value && lib.hasAttr "overridePythonAttrs" value
|
||||
|
@ -268,7 +289,7 @@ lib.makeScope pkgs.newScope (self: {
|
|||
packageOverrides = lib.foldr lib.composeExtensions (self: super: { }) overlays;
|
||||
py = python.override { inherit packageOverrides; self = py; };
|
||||
|
||||
inputAttrs = mkInputAttrs { inherit py pyProject groups checkGroups; attrs = { }; includeBuildSystem = false; };
|
||||
inputAttrs = mkInputAttrs { inherit py pyProject groups checkGroups extras; attrs = { }; includeBuildSystem = false; };
|
||||
|
||||
requiredPythonModules = python.pkgs.requiredPythonModules;
|
||||
/* Include all the nested dependencies which are required for each package.
|
||||
|
@ -304,6 +325,7 @@ lib.makeScope pkgs.newScope (self: {
|
|||
, editablePackageSources ? { }
|
||||
, extraPackages ? ps: [ ]
|
||||
, groups ? [ "dev" ]
|
||||
, extras ? [ "*" ]
|
||||
}:
|
||||
let
|
||||
inherit (lib) hasAttr;
|
||||
|
@ -336,7 +358,7 @@ lib.makeScope pkgs.newScope (self: {
|
|||
excludedEditablePackageNames;
|
||||
|
||||
poetryPython = self.mkPoetryPackages {
|
||||
inherit pyproject poetrylock overrides python pwd preferWheels pyProject groups;
|
||||
inherit pyproject poetrylock overrides python pwd preferWheels pyProject groups extras;
|
||||
editablePackageSources = editablePackageSources';
|
||||
};
|
||||
|
||||
|
@ -371,11 +393,12 @@ lib.makeScope pkgs.newScope (self: {
|
|||
, preferWheels ? false
|
||||
, groups ? [ ]
|
||||
, checkGroups ? [ "dev" ]
|
||||
, extras ? [ "*" ]
|
||||
, ...
|
||||
}@attrs:
|
||||
let
|
||||
poetryPython = self.mkPoetryPackages {
|
||||
inherit pyproject poetrylock overrides python pwd preferWheels groups checkGroups;
|
||||
inherit pyproject poetrylock overrides python pwd preferWheels groups checkGroups extras;
|
||||
};
|
||||
py = poetryPython.python;
|
||||
|
||||
|
@ -392,7 +415,7 @@ lib.makeScope pkgs.newScope (self: {
|
|||
];
|
||||
passedAttrs = builtins.removeAttrs attrs specialAttrs;
|
||||
|
||||
inputAttrs = mkInputAttrs { inherit py pyProject attrs groups checkGroups; };
|
||||
inputAttrs = mkInputAttrs { inherit py pyProject attrs groups checkGroups extras; };
|
||||
|
||||
app = py.pkgs.buildPythonPackage (
|
||||
passedAttrs // inputAttrs // {
|
||||
|
@ -481,7 +504,7 @@ lib.makeScope pkgs.newScope (self: {
|
|||
/*
|
||||
The default list of poetry2nix override overlays
|
||||
|
||||
Can be overridden by calling defaultPoetryOverrides.overrideOverlay which takes an overlay function
|
||||
Can be overriden by calling defaultPoetryOverrides.overrideOverlay which takes an overlay function
|
||||
*/
|
||||
defaultPoetryOverrides = self.mkDefaultPoetryOverrides (import ./overrides { inherit pkgs lib poetryLib; });
|
||||
|
||||
|
@ -501,8 +524,8 @@ lib.makeScope pkgs.newScope (self: {
|
|||
combining it with poetry2nix default overrides
|
||||
*/
|
||||
withDefaults = overlay: [
|
||||
self.defaultPoetryOverrides
|
||||
overlay
|
||||
self.defaultPoetryOverrides
|
||||
];
|
||||
};
|
||||
})
|
||||
|
|
|
@ -60,6 +60,12 @@ context = ssl.create_default_context()
|
|||
context.check_hostname = False
|
||||
context.verify_mode = ssl.CERT_NONE
|
||||
|
||||
# Extract out username/password from index_url, if present.
|
||||
parsed_url = urlparse(index_url)
|
||||
username = parsed_url.username or username
|
||||
password = parsed_url.password or password
|
||||
index_url = parsed_url._replace(netloc=parsed_url.netloc.rpartition("@")[-1]).geturl()
|
||||
|
||||
req = urllib.request.Request(index_url)
|
||||
if username and password:
|
||||
import base64
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
{ python
|
||||
, stdenv
|
||||
, buildPackages
|
||||
, makeSetupHook
|
||||
, wheel
|
||||
, pip
|
||||
, pkgs
|
||||
, lib
|
||||
}:
|
||||
let
|
||||
callPackage = python.pythonForBuild.pkgs.callPackage;
|
||||
inherit (python.pythonForBuild.pkgs) callPackage;
|
||||
pythonInterpreter = python.pythonForBuild.interpreter;
|
||||
pythonSitePackages = python.sitePackages;
|
||||
|
||||
|
@ -14,23 +16,27 @@ let
|
|||
makeRemoveSpecialDependenciesHook = { fields, kind }:
|
||||
nonOverlayedPython.pkgs.callPackage
|
||||
(
|
||||
{}:
|
||||
_:
|
||||
makeSetupHook
|
||||
{
|
||||
name = "remove-path-dependencies.sh";
|
||||
propagatedBuildInputs = [ ];
|
||||
substitutions = {
|
||||
# NOTE: We have to use a non-overlayed Python here because otherwise we run into an infinite recursion
|
||||
# because building of tomlkit and its dependencies also use these hooks.
|
||||
pythonPath = nonOverlayedPython.pkgs.makePythonPath [ nonOverlayedPython ];
|
||||
pythonInterpreter = nonOverlayedPython.interpreter;
|
||||
pyprojectPatchScript = "${./pyproject-without-special-deps.py}";
|
||||
fields = fields;
|
||||
kind = kind;
|
||||
inherit fields;
|
||||
inherit kind;
|
||||
};
|
||||
} ./remove-special-dependencies.sh
|
||||
)
|
||||
{ };
|
||||
makeSetupHookArgs = deps:
|
||||
if lib.elem "propagatedBuildInputs" (builtins.attrNames (builtins.functionArgs makeSetupHook)) then
|
||||
{ propagatedBuildInputs = deps; }
|
||||
else
|
||||
{ inherit deps; };
|
||||
in
|
||||
{
|
||||
removePathDependenciesHook = makeRemoveSpecialDependenciesHook {
|
||||
|
@ -48,23 +54,21 @@ in
|
|||
(
|
||||
{ pip, wheel }:
|
||||
makeSetupHook
|
||||
{
|
||||
({
|
||||
name = "pip-build-hook.sh";
|
||||
propagatedBuildInputs = [ pip wheel ];
|
||||
substitutions = {
|
||||
inherit pythonInterpreter pythonSitePackages;
|
||||
};
|
||||
} ./pip-build-hook.sh
|
||||
} // (makeSetupHookArgs [ pip wheel ])) ./pip-build-hook.sh
|
||||
)
|
||||
{ };
|
||||
|
||||
poetry2nixFixupHook = callPackage
|
||||
(
|
||||
{}:
|
||||
_:
|
||||
makeSetupHook
|
||||
{
|
||||
name = "fixup-hook.sh";
|
||||
propagatedBuildInputs = [ ];
|
||||
substitutions = {
|
||||
inherit pythonSitePackages;
|
||||
filenames = builtins.concatStringsSep " " [
|
||||
|
@ -77,14 +81,51 @@ in
|
|||
)
|
||||
{ };
|
||||
|
||||
# As of 2023-03 a newer version of packaging introduced a new behaviour where python-requires
|
||||
# cannot contain version wildcards. This behaviour is complaint with PEP440
|
||||
#
|
||||
# The wildcards are a no-op anyway so we can work around this issue by just dropping the precision down to the last known number.
|
||||
poetry2nixPythonRequiresPatchHook = callPackage
|
||||
(
|
||||
_:
|
||||
let
|
||||
# Python pre 3.9 does not contain the ast.unparse method.
|
||||
# We can extract this from Python 3.8 for any
|
||||
unparser = stdenv.mkDerivation {
|
||||
name = "${python.name}-astunparse";
|
||||
inherit (python) src;
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/poetry2nix_astunparse
|
||||
cp ./Tools/parser/unparse.py $out/poetry2nix_astunparse/__init__.py
|
||||
'';
|
||||
};
|
||||
|
||||
pythonPath =
|
||||
[ ]
|
||||
++ lib.optional (lib.versionOlder python.version "3.9") unparser;
|
||||
|
||||
in
|
||||
makeSetupHook
|
||||
{
|
||||
name = "require-python-patch-hook.sh";
|
||||
substitutions = {
|
||||
inherit pythonInterpreter pythonPath;
|
||||
patchScript = ./python-requires-patch-hook.py;
|
||||
};
|
||||
} ./python-requires-patch-hook.sh
|
||||
)
|
||||
{ };
|
||||
|
||||
# When the "wheel" package itself is a wheel the nixpkgs hook (which pulls in "wheel") leads to infinite recursion
|
||||
# It doesn't _really_ depend on wheel though, it just copies the wheel.
|
||||
wheelUnpackHook = callPackage
|
||||
({}:
|
||||
(_:
|
||||
makeSetupHook
|
||||
{
|
||||
name = "wheel-unpack-hook.sh";
|
||||
propagatedBuildInputs = [ ];
|
||||
} ./wheel-unpack-hook.sh
|
||||
)
|
||||
{ };
|
||||
|
|
|
@ -0,0 +1,79 @@
|
|||
#!/usr/bin/env python
|
||||
import ast
|
||||
import sys
|
||||
import io
|
||||
|
||||
|
||||
# Python2 compat
|
||||
if sys.version_info[0] < 3:
|
||||
FileNotFoundError = IOError
|
||||
|
||||
|
||||
# Python <= 3.8 compat
|
||||
def astunparse(tree):
|
||||
# Use bundled unparse by default
|
||||
if hasattr(ast, "unparse"):
|
||||
return ast.unparse(tree)
|
||||
|
||||
# Use example tool from Python sources for older interpreter versions
|
||||
from poetry2nix_astunparse import Unparser
|
||||
|
||||
buf = io.StringIO()
|
||||
up = Unparser(tree, buf)
|
||||
|
||||
return buf.getvalue()
|
||||
|
||||
|
||||
class Rewriter(ast.NodeVisitor):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(Rewriter, self).__init__(*args, **kwargs)
|
||||
self.modified = False
|
||||
|
||||
def visit_Call(self, node):
|
||||
function_name = ""
|
||||
|
||||
if isinstance(node.func, ast.Name):
|
||||
function_name = node.func.id
|
||||
elif isinstance(node.func, ast.Attribute):
|
||||
function_name = node.func.attr
|
||||
else:
|
||||
return
|
||||
|
||||
if function_name != "setup":
|
||||
return
|
||||
|
||||
for kw in node.keywords:
|
||||
if kw.arg != "python_requires":
|
||||
continue
|
||||
|
||||
value = kw.value
|
||||
if not isinstance(value, ast.Constant):
|
||||
return
|
||||
|
||||
# Rewrite version constraints without wildcard characters.
|
||||
#
|
||||
# Only rewrite the file if the modified value actually differs, as we lose whitespace and comments when rewriting
|
||||
# with the AST module.
|
||||
python_requires = ", ".join(
|
||||
[v.strip().rstrip(".*") for v in value.value.split(",")]
|
||||
)
|
||||
if value.value != python_requires:
|
||||
value.value = python_requires
|
||||
self.modified = True
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.path.extend(sys.argv[1:])
|
||||
|
||||
try:
|
||||
with open("setup.py") as f:
|
||||
tree = ast.parse(f.read())
|
||||
except FileNotFoundError:
|
||||
exit(0)
|
||||
|
||||
r = Rewriter()
|
||||
r.visit(tree)
|
||||
|
||||
if r.modified:
|
||||
with open("setup.py", "w") as f:
|
||||
f.write(astunparse(tree))
|
|
@ -0,0 +1,7 @@
|
|||
poetry2nix-python-requires-patch-hook() {
|
||||
if [ -z "${dontFixupPythonRequires-}" ]; then
|
||||
@pythonInterpreter@ @patchScript@ @pythonPath@
|
||||
fi
|
||||
}
|
||||
|
||||
postPatchHooks+=(poetry2nix-python-requires-patch-hook)
|
|
@ -151,7 +151,7 @@ let
|
|||
(builtins.filter
|
||||
({ prefix, path }: "NETRC" == prefix)
|
||||
builtins.nixPath);
|
||||
netrc_file = lib.optionalString (pathParts != [ ]) (builtins.head pathParts).path;
|
||||
netrc_file = if (pathParts != [ ]) then (builtins.head pathParts).path else "";
|
||||
in
|
||||
pkgs.runCommand file
|
||||
{
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
}:
|
||||
{ name
|
||||
, version
|
||||
, pos ? __curPos
|
||||
, files
|
||||
, source
|
||||
, dependencies ? { }
|
||||
|
@ -45,6 +46,7 @@ pythonPackages.callPackage
|
|||
isSource = source != null;
|
||||
isGit = isSource && source.type == "git";
|
||||
isUrl = isSource && source.type == "url";
|
||||
isWheelUrl = isSource && source.type == "url" && lib.strings.hasSuffix ".whl" source.url;
|
||||
isDirectory = isSource && source.type == "directory";
|
||||
isFile = isSource && source.type == "file";
|
||||
isLegacy = isSource && source.type == "legacy";
|
||||
|
@ -61,6 +63,8 @@ pythonPackages.callPackage
|
|||
inherit pythonPackages pyProject;
|
||||
} else [ ];
|
||||
|
||||
pname = normalizePackageName name;
|
||||
preferWheel' = preferWheel && pname != "wheel";
|
||||
fileInfo =
|
||||
let
|
||||
isBdist = f: lib.strings.hasSuffix "whl" f.file;
|
||||
|
@ -69,7 +73,9 @@ pythonPackages.callPackage
|
|||
binaryDist = selectWheel fileCandidates;
|
||||
sourceDist = builtins.filter isSdist fileCandidates;
|
||||
eggs = builtins.filter isEgg fileCandidates;
|
||||
entries = (if preferWheel then binaryDist ++ sourceDist else sourceDist ++ binaryDist) ++ eggs;
|
||||
# the `wheel` package cannot be built from a wheel, since that requires the wheel package
|
||||
# this causes a circular dependency so we special-case ignore its `preferWheel` attribute value
|
||||
entries = (if preferWheel' then binaryDist ++ sourceDist else sourceDist ++ binaryDist) ++ eggs;
|
||||
lockFileEntry = (
|
||||
if lib.length entries > 0 then builtins.head entries
|
||||
else throw "Missing suitable source/wheel file entry for ${name}"
|
||||
|
@ -89,13 +95,12 @@ pythonPackages.callPackage
|
|||
else (builtins.elemAt (lib.strings.splitString "-" name) 2);
|
||||
};
|
||||
|
||||
format = if isDirectory || isGit || isUrl then "pyproject" else fileInfo.format;
|
||||
format = if isWheelUrl then "wheel" else if isDirectory || isGit || isUrl then "pyproject" else fileInfo.format;
|
||||
|
||||
hooks = python.pkgs.callPackage ./hooks { };
|
||||
in
|
||||
buildPythonPackage {
|
||||
pname = normalizePackageName name;
|
||||
version = version;
|
||||
inherit pname version;
|
||||
|
||||
# Circumvent output separation (https://github.com/NixOS/nixpkgs/pull/190487)
|
||||
format = if format == "pyproject" then "poetry2nix" else format;
|
||||
|
@ -108,6 +113,7 @@ pythonPackages.callPackage
|
|||
nativeBuildInputs = [
|
||||
hooks.poetry2nixFixupHook
|
||||
]
|
||||
++ lib.optional (!pythonPackages.isPy27) hooks.poetry2nixPythonRequiresPatchHook
|
||||
++ lib.optional (isLocked && (getManyLinuxDeps fileInfo.name).str != null) autoPatchelfHook
|
||||
++ lib.optionals (format == "wheel") [
|
||||
hooks.wheelUnpackHook
|
||||
|
@ -147,6 +153,8 @@ pythonPackages.callPackage
|
|||
in
|
||||
builtins.map (n: pythonPackages.${normalizePackageName n}) depAttrs;
|
||||
|
||||
inherit pos;
|
||||
|
||||
meta = {
|
||||
broken = ! isCompatible (poetryLib.getPythonVersion python) python-versions;
|
||||
license = [ ];
|
||||
|
@ -155,6 +163,7 @@ pythonPackages.callPackage
|
|||
|
||||
passthru = {
|
||||
inherit args;
|
||||
preferWheel = preferWheel';
|
||||
};
|
||||
|
||||
# We need to retrieve kind from the interpreter and the filename of the package
|
||||
|
@ -174,10 +183,17 @@ pythonPackages.callPackage
|
|||
}
|
||||
))
|
||||
)
|
||||
else if isWheelUrl then
|
||||
builtins.fetchurl
|
||||
{
|
||||
inherit (source) url;
|
||||
sha256 = fileInfo.hash;
|
||||
}
|
||||
else if isUrl then
|
||||
builtins.fetchTarball
|
||||
{
|
||||
inherit (source) url;
|
||||
sha256 = fileInfo.hash;
|
||||
}
|
||||
else if isDirectory then
|
||||
(poetryLib.cleanPythonSources { src = localDepPath; })
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -27,7 +27,7 @@ let
|
|||
true;
|
||||
intendedBuildSystem =
|
||||
if attr.buildSystem == "cython" then
|
||||
self.python.pythonForBuild.cython
|
||||
self.python.pythonForBuild.pkgs.cython
|
||||
else
|
||||
self.${attr.buildSystem};
|
||||
in
|
||||
|
@ -50,7 +50,7 @@ let
|
|||
{
|
||||
nativeBuildInputs =
|
||||
(old.nativeBuildInputs or [ ])
|
||||
++ lib.optionals (buildSystem != null) [ buildSystem ]
|
||||
++ lib.optionals (!(builtins.isNull buildSystem)) [ buildSystem ]
|
||||
++ map (a: self.${a}) extraAttrs;
|
||||
}
|
||||
)
|
||||
|
@ -99,7 +99,7 @@ lib.composeManyExtensions [
|
|||
|
||||
{
|
||||
automat = super.automat.overridePythonAttrs (
|
||||
old: {
|
||||
old: lib.optionalAttrs (lib.versionOlder old.version "22.10.0") {
|
||||
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.m2r ];
|
||||
}
|
||||
);
|
||||
|
@ -296,7 +296,7 @@ lib.composeManyExtensions [
|
|||
old: {
|
||||
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkg-config ];
|
||||
buildInputs = old.buildInputs or [ ] ++ [ pkgs.libffi ];
|
||||
prePatch = (old.prePatch or "") + lib.optionalString stdenv.isDarwin ''
|
||||
prePatch = (old.prePatch or "") + lib.optionalString (!(old.src.isWheel or false) && stdenv.isDarwin) ''
|
||||
# Remove setup.py impurities
|
||||
substituteInPlace setup.py --replace "'-iwithsysroot/usr/include/ffi'" ""
|
||||
substituteInPlace setup.py --replace "'/usr/include/ffi'," ""
|
||||
|
@ -345,7 +345,7 @@ lib.composeManyExtensions [
|
|||
LIB_DIR = "${lib.getLib pkgs.secp256k1}/lib";
|
||||
|
||||
# for actual C toolchain build
|
||||
env.NIX_CFLAGS_COMPILE = "-I ${lib.getDev pkgs.secp256k1}/include";
|
||||
NIX_CFLAGS_COMPILE = "-I ${lib.getDev pkgs.secp256k1}/include";
|
||||
NIX_LDFLAGS = "-L ${lib.getLib pkgs.secp256k1}/lib";
|
||||
}
|
||||
);
|
||||
|
@ -382,6 +382,8 @@ lib.composeManyExtensions [
|
|||
"38.0.1" = "sha256-o8l13fnfEUvUdDasq3LxSPArozRHKVsZfQg9DNR6M6Q=";
|
||||
"38.0.3" = "sha256-lzHLW1N4hZj+nn08NZiPVM/X+SEcIsuZDjEOy0OOkSc=";
|
||||
"38.0.4" = "sha256-BN0kOblUwgHj5QBf52RY2Jx0nBn03lwoN1O5PEohbwY=";
|
||||
"39.0.0" = "sha256-clorC0NtGukpE3DnZ84MSdGhJN+qC89DZPITZFuL01Q=";
|
||||
"39.0.2" = "sha256-Admz48/GS2t8diz611Ciin1HKQEyMDEwHxTpJ5tZ1ZA=";
|
||||
}.${version} or (
|
||||
lib.warn "Unknown cryptography version: '${version}'. Please update getCargoHash." lib.fakeHash
|
||||
);
|
||||
|
@ -443,6 +445,17 @@ lib.composeManyExtensions [
|
|||
buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools ];
|
||||
});
|
||||
|
||||
databricks-connect = super.databricks-connect.overridePythonAttrs (old: {
|
||||
sourceRoot = ".";
|
||||
});
|
||||
|
||||
dbt-extractor = super.dbt-extractor.overridePythonAttrs
|
||||
(
|
||||
old: {
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.cargo pkgs.rustc pkgs.maturin ];
|
||||
}
|
||||
);
|
||||
|
||||
dbus-python = super.dbus-python.overridePythonAttrs (old: {
|
||||
outputs = [ "out" "dev" ];
|
||||
|
||||
|
@ -457,9 +470,9 @@ lib.composeManyExtensions [
|
|||
|
||||
preConfigure = lib.concatStringsSep "\n" [
|
||||
(old.preConfigure or "")
|
||||
(lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11" && stdenv.isDarwin) ''
|
||||
(if (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11" && stdenv.isDarwin) then ''
|
||||
MACOSX_DEPLOYMENT_TARGET=10.16
|
||||
'')
|
||||
'' else "")
|
||||
];
|
||||
|
||||
preBuild = old.preBuild or "" + ''
|
||||
|
@ -562,6 +575,14 @@ lib.composeManyExtensions [
|
|||
)
|
||||
) else super.docutils;
|
||||
|
||||
duckdb = super.duckdb.overridePythonAttrs (old: {
|
||||
postPatch = lib.optionalString (!(old.src.isWheel or false)) ''
|
||||
substituteInPlace setup.py \
|
||||
--replace 'multiprocessing.cpu_count()' "$NIX_BUILD_CORES" \
|
||||
--replace 'setuptools_scm<7.0.0' 'setuptools_scm'
|
||||
'';
|
||||
});
|
||||
|
||||
# Environment markers are not always included (depending on how a dep was defined)
|
||||
enum34 = if self.pythonAtLeast "3.4" then null else super.enum34;
|
||||
|
||||
|
@ -608,7 +629,7 @@ lib.composeManyExtensions [
|
|||
|
||||
fancycompleter = super.fancycompleter.overridePythonAttrs (
|
||||
old: {
|
||||
postPatch = ''
|
||||
postPatch = lib.optionalString (!(old.src.isWheel or false)) ''
|
||||
substituteInPlace setup.py \
|
||||
--replace 'setup_requires="setupmeta"' 'setup_requires=[]' \
|
||||
--replace 'versioning="devcommit"' 'version="${old.version}"'
|
||||
|
@ -636,11 +657,12 @@ lib.composeManyExtensions [
|
|||
|
||||
fiona = super.fiona.overridePythonAttrs (
|
||||
old: {
|
||||
format = "setuptools";
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.gdal ];
|
||||
nativeBuildInputs = [
|
||||
pkgs.gdal # for gdal-config
|
||||
];
|
||||
format = lib.optionalString (!(old.src.isWheel or false)) "setuptools";
|
||||
buildInputs = old.buildInputs or [ ] ++ [ pkgs.gdal ];
|
||||
nativeBuildInputs = old.nativeBuildInputs or [ ]
|
||||
++ lib.optionals ((old.src.isWheel or false) && (!pkgs.stdenv.isDarwin)) [ pkgs.autoPatchelfHook ]
|
||||
# for gdal-config
|
||||
++ [ pkgs.gdal ];
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -648,14 +670,28 @@ lib.composeManyExtensions [
|
|||
VERSION = old.version;
|
||||
});
|
||||
|
||||
gdal = super.gdal.overridePythonAttrs (
|
||||
old: {
|
||||
preBuild = (old.preBuild or "") + ''
|
||||
substituteInPlace setup.cfg \
|
||||
--replace "../../apps/gdal-config" '${pkgs.gdal}/bin/gdal-config'
|
||||
'';
|
||||
}
|
||||
);
|
||||
gdal =
|
||||
let
|
||||
# Build gdal without python bindings to prevent version mixing
|
||||
# We're only interested in the native libraries, not the python ones
|
||||
# as we build that separately.
|
||||
gdal = pkgs.gdal.overrideAttrs (old: {
|
||||
doInstallCheck = false;
|
||||
doCheck = false;
|
||||
cmakeFlags = (old.cmakeFlags or [ ]) ++ [
|
||||
"-DBUILD_PYTHON_BINDINGS=OFF"
|
||||
];
|
||||
});
|
||||
in
|
||||
super.gdal.overridePythonAttrs (
|
||||
old: {
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ gdal ];
|
||||
preBuild = (old.preBuild or "") + ''
|
||||
substituteInPlace setup.cfg \
|
||||
--replace "../../apps/gdal-config" '${gdal}/bin/gdal-config'
|
||||
'';
|
||||
}
|
||||
);
|
||||
|
||||
grandalf = super.grandalf.overridePythonAttrs (
|
||||
old: {
|
||||
|
@ -664,6 +700,34 @@ lib.composeManyExtensions [
|
|||
}
|
||||
);
|
||||
|
||||
granian =
|
||||
let
|
||||
getRepoHash = version: {
|
||||
"0.2.1" = "sha256-XEhu6M1hFi3/gAKZcei7KJSrIhhlZhlvZvbfyA6VLR4=";
|
||||
"0.2.2" = "sha256-KWwefJ3CfOUGCgAm7AhFlIxRF9qxNEo3npGOxVJ23FY=";
|
||||
"0.2.3" = "sha256-2JnyO0wxkV49R/0wzDb/PnUWWHi3ckwK4nVe7dWeH1k=";
|
||||
"0.2.4" = "sha256-GdQJvVPsWgC1z7La9h11x2pRAP+L998yImhTFrFT5l8=";
|
||||
"0.2.5" = "sha256-vMXMxss77rmXSjoB53eE8XN2jXyIEf03WoQiDfvhDmw=";
|
||||
"0.2.6" = "sha256-l9W9+KDg/43mc0toEz1n1pqw+oQdiHdAxGlS+KLIGhw=";
|
||||
}.${version};
|
||||
sha256 = getRepoHash super.granian.version;
|
||||
in
|
||||
super.granian.overridePythonAttrs (old: rec {
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "emmett-framework";
|
||||
repo = "granian";
|
||||
rev = "v${old.version}";
|
||||
inherit sha256;
|
||||
};
|
||||
cargoDeps = pkgs.rustPlatform.importCargoLock {
|
||||
lockFile = "${src.out}/Cargo.lock";
|
||||
};
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
|
||||
pkgs.rustPlatform.cargoSetupHook
|
||||
pkgs.rustPlatform.maturinBuildHook
|
||||
];
|
||||
});
|
||||
|
||||
gitpython = super.gitpython.overridePythonAttrs (
|
||||
old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ self.typing-extensions ];
|
||||
|
@ -720,7 +784,7 @@ lib.composeManyExtensions [
|
|||
(old.propagatedBuildInputs or [ ])
|
||||
++ lib.optionals mpiSupport [ self.mpi4py self.openssh ]
|
||||
;
|
||||
preBuild = lib.optionalString mpiSupport "export CC=${mpi}/bin/mpicc";
|
||||
preBuild = if mpiSupport then "export CC=${mpi}/bin/mpicc" else "";
|
||||
HDF5_DIR = "${pkgs.hdf5}";
|
||||
HDF5_MPI = if mpiSupport then "ON" else "OFF";
|
||||
# avoid strict pinning of numpy
|
||||
|
@ -749,6 +813,18 @@ lib.composeManyExtensions [
|
|||
}
|
||||
);
|
||||
|
||||
hikari = super.hikari.overrideAttrs (
|
||||
old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools ];
|
||||
}
|
||||
);
|
||||
|
||||
hikari-lightbulb = super.hikari-lightbulb.overrideAttrs (
|
||||
old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools ];
|
||||
}
|
||||
);
|
||||
|
||||
horovod = super.horovod.overridePythonAttrs (
|
||||
old: {
|
||||
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ pkgs.mpi ];
|
||||
|
@ -864,6 +940,15 @@ lib.composeManyExtensions [
|
|||
}
|
||||
);
|
||||
|
||||
trio = super.trio.overridePythonAttrs (old: {
|
||||
propagatedBuildInputs = (old.propagatedBuildInputs or [ ])
|
||||
++ [ self.async-generator self.idna ];
|
||||
});
|
||||
|
||||
jeepney = super.jeepney.overridePythonAttrs (old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ self.outcome self.trio ];
|
||||
});
|
||||
|
||||
jinja2-ansible-filters = super.jinja2-ansible-filters.overridePythonAttrs (
|
||||
old: {
|
||||
preBuild = (old.preBuild or "") + ''
|
||||
|
@ -930,6 +1015,13 @@ lib.composeManyExtensions [
|
|||
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.setuptools self.wheel ];
|
||||
});
|
||||
|
||||
jupyter-server = super.jupyter-server.overridePythonAttrs (old: {
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ])
|
||||
++ [ self.hatchling ];
|
||||
buildInputs = (old.buildInputs or [ ])
|
||||
++ [ self.hatch-jupyter-builder ];
|
||||
});
|
||||
|
||||
jupyterlab-widgets = super.jupyterlab-widgets.overridePythonAttrs (
|
||||
old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ self.jupyter-packaging ];
|
||||
|
@ -964,6 +1056,15 @@ lib.composeManyExtensions [
|
|||
}
|
||||
);
|
||||
|
||||
libarchive = super.libarchive.overridePythonAttrs (old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace libarchive/library.py --replace \
|
||||
"_FILEPATH = find_and_load_library()" "_FILEPATH = '${pkgs.libarchive.lib}/lib/libarchive${stdenv.hostPlatform.extensions.sharedLibrary}'"
|
||||
'';
|
||||
});
|
||||
|
||||
libvirt-python = super.libvirt-python.overridePythonAttrs ({ nativeBuildInputs ? [ ], ... }: {
|
||||
nativeBuildInputs = nativeBuildInputs ++ [ pkg-config ];
|
||||
propagatedBuildInputs = [ pkgs.libvirt ];
|
||||
|
@ -1082,6 +1183,8 @@ lib.composeManyExtensions [
|
|||
pkgs.ghostscript
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
Cocoa
|
||||
] ++ lib.optionals (lib.versionAtLeast super.matplotlib.version "3.7.0") [
|
||||
self.pybind11
|
||||
];
|
||||
|
||||
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [
|
||||
|
@ -1137,11 +1240,6 @@ lib.composeManyExtensions [
|
|||
}
|
||||
);
|
||||
|
||||
# Calls Cargo at build time for source builds and is really tricky to package
|
||||
maturin = super.maturin.override {
|
||||
preferWheel = true;
|
||||
};
|
||||
|
||||
mccabe = super.mccabe.overridePythonAttrs (
|
||||
old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ self.pytest-runner ];
|
||||
|
@ -1308,6 +1406,9 @@ lib.composeManyExtensions [
|
|||
preBuild = ''
|
||||
ln -s ${cfg} site.cfg
|
||||
'';
|
||||
preConfigure = ''
|
||||
export NPY_NUM_BUILD_JOBS=$NIX_BUILD_CORES
|
||||
'';
|
||||
passthru = old.passthru // {
|
||||
blas = blas;
|
||||
inherit blasImplementation cfg;
|
||||
|
@ -1353,6 +1454,8 @@ lib.composeManyExtensions [
|
|||
autoPatchelfIgnoreMissingDeps = true;
|
||||
});
|
||||
|
||||
openbabel-wheel = super.openbabel-wheel.override { preferWheel = true; };
|
||||
|
||||
# Overrides for building packages based on OpenCV
|
||||
# These flags are inspired by the opencv 4.x package in nixpkgs
|
||||
_opencv-python-override =
|
||||
|
@ -1376,14 +1479,14 @@ lib.composeManyExtensions [
|
|||
|
||||
opencv-python = super.opencv-python.overridePythonAttrs self._opencv-python-override;
|
||||
|
||||
opencv-python-headless = super.opencv-python.overridePythonAttrs self._opencv-python-override;
|
||||
opencv-python-headless = super.opencv-python-headless.overridePythonAttrs self._opencv-python-override;
|
||||
|
||||
opencv-contrib-python = super.opencv-contrib-python.overridePythonAttrs self._opencv-python-override;
|
||||
|
||||
openexr = super.openexr.overridePythonAttrs (
|
||||
old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.openexr pkgs.ilmbase ];
|
||||
env.NIX_CFLAGS_COMPILE = toString [ "-I${pkgs.openexr.dev}/include/OpenEXR" "-I${pkgs.ilmbase.dev}/include/OpenEXR" ];
|
||||
NIX_CFLAGS_COMPILE = [ "-I${pkgs.openexr.dev}/include/OpenEXR" "-I${pkgs.ilmbase.dev}/include/OpenEXR" ];
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -1409,6 +1512,10 @@ lib.composeManyExtensions [
|
|||
"3.8.0" = "sha256-8k0DetamwLqkdcg8V/D2J5ja6IJSLi50CE+ZjFa7Hdc=";
|
||||
"3.8.1" = "sha256-QXguyDxQHW9Fd3Nhmi5JzSxZQuk3HGPhhh/RGuOTZNY=";
|
||||
"3.8.3" = "sha256-oSZO4cN1sJKd0T7pYrKG63is8AZMKaLRZqj5UCVY/14=";
|
||||
"3.8.4" = "sha256-O2W9zO7qHWG+78T+uECICAmecaSIbTTJPktJIPZYElE=";
|
||||
"3.8.5" = "sha256-JtUCJ3TP9EKGcddeyW1e/72k21uKneq9SnZJeLvn9Os=";
|
||||
"3.8.6" = "sha256-8T//q6nQoZhh8oJWDCeQf3gYRew58dXAaxkYELY4CJM=";
|
||||
"3.8.7" = "sha256-JBO8nl0sC+XIn17vI7hC8+nA1HYI9jfvZrl9nCE3k1s=";
|
||||
}.${version} or (
|
||||
lib.warn "Unknown orjson version: '${version}'. Please update getCargoHash." lib.fakeHash
|
||||
);
|
||||
|
@ -1444,7 +1551,7 @@ lib.composeManyExtensions [
|
|||
|
||||
# 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 ''
|
||||
postPatch = lib.optionalString (!(old.src.isWheel or false) && 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 \
|
||||
|
@ -1509,13 +1616,27 @@ lib.composeManyExtensions [
|
|||
nativeBuildInputs = (old.nativeBuildInputs or [ ])
|
||||
++ [ pkg-config self.pytest-runner ];
|
||||
buildInputs = with pkgs; (old.buildInputs or [ ])
|
||||
++ [ freetype libjpeg zlib libtiff libwebp tcl lcms2 ]
|
||||
++ [ freetype libjpeg zlib libtiff libxcrypt libwebp tcl lcms2 ]
|
||||
++ lib.optionals (lib.versionAtLeast old.version "7.1.0") [ xorg.libxcb ]
|
||||
++ lib.optionals (self.isPyPy) [ tk xorg.libX11 ];
|
||||
preConfigure = lib.optional (old.format != "wheel") preConfigure;
|
||||
}
|
||||
);
|
||||
|
||||
pip-requirements-parser = super.pip-requirements-parser.overridePythonAttrs (old: {
|
||||
dontConfigure = true;
|
||||
});
|
||||
|
||||
pluralizer = super.pluralizer.overridePythonAttrs (old: {
|
||||
preBuild = ''
|
||||
export PYPI_VERSION="${old.version}"
|
||||
'';
|
||||
});
|
||||
|
||||
poethepoet = super.poethepoet.overrideAttrs (old: {
|
||||
propagatedBuildInputs = old.propagatedBuildInputs ++ [ self.poetry ];
|
||||
});
|
||||
|
||||
poetry-core = super.poetry-core.overridePythonAttrs (old:
|
||||
let
|
||||
initFile =
|
||||
|
@ -1600,7 +1721,7 @@ lib.composeManyExtensions [
|
|||
);
|
||||
|
||||
pyarrow =
|
||||
if lib.versionAtLeast super.pyarrow.version "0.16.0" then
|
||||
if (!super.pyarrow.src.isWheel or false) && lib.versionAtLeast super.pyarrow.version "0.16.0" then
|
||||
super.pyarrow.overridePythonAttrs
|
||||
(
|
||||
old:
|
||||
|
@ -1662,7 +1783,7 @@ lib.composeManyExtensions [
|
|||
old: {
|
||||
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
|
||||
pkgs.meson
|
||||
self.meson
|
||||
pkgs.ninja
|
||||
pkg-config
|
||||
];
|
||||
|
@ -1838,7 +1959,7 @@ lib.composeManyExtensions [
|
|||
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ (
|
||||
if withApplePCSC then [ PCSC ] else [ pcsclite ]
|
||||
);
|
||||
env.NIX_CFLAGS_COMPILE = lib.optionalString (! withApplePCSC)
|
||||
NIX_CFLAGS_COMPILE = lib.optionalString (! withApplePCSC)
|
||||
"-I ${lib.getDev pcsclite}/include/PCSC";
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
|
||||
pkgs.swig
|
||||
|
@ -1868,6 +1989,18 @@ lib.composeManyExtensions [
|
|||
}
|
||||
);
|
||||
|
||||
python-snap7 = super.python-snap7.overridePythonAttrs (old: {
|
||||
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [
|
||||
pkgs.snap7
|
||||
];
|
||||
|
||||
postPatch = (old.postPatch or "") + ''
|
||||
echo "Patching find_library call."
|
||||
substituteInPlace snap7/common.py \
|
||||
--replace "find_library('snap7')" "\"${pkgs.snap7}/lib/libsnap7.so\""
|
||||
'';
|
||||
});
|
||||
|
||||
pytoml = super.pytoml.overridePythonAttrs (
|
||||
old: {
|
||||
doCheck = false;
|
||||
|
@ -2068,6 +2201,18 @@ lib.composeManyExtensions [
|
|||
}
|
||||
);
|
||||
|
||||
recommonmark = super.rich.overridePythonAttrs (
|
||||
old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ self.commonmark ];
|
||||
}
|
||||
);
|
||||
|
||||
rich = super.rich.overridePythonAttrs (
|
||||
old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ self.commonmark ];
|
||||
}
|
||||
);
|
||||
|
||||
rockset = super.rockset.overridePythonAttrs (
|
||||
old: {
|
||||
postPatch = ''
|
||||
|
@ -2098,9 +2243,24 @@ lib.composeManyExtensions [
|
|||
"-DPYBIND11_TEST=off"
|
||||
];
|
||||
doCheck = false; # Circular test dependency
|
||||
|
||||
# Link include and share so it can be used by packages that use pybind11 through cmake
|
||||
postInstall = ''
|
||||
ln -s $out/${self.python.sitePackages}/pybind11/{include,share} $out/
|
||||
'';
|
||||
}
|
||||
);
|
||||
|
||||
rasterio = super.rasterio.overridePythonAttrs (old: {
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.gdal ];
|
||||
});
|
||||
|
||||
rfc3986-validator = super.rfc3986-validator.overridePythonAttrs (old: {
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
|
||||
self.pytest-runner
|
||||
];
|
||||
});
|
||||
|
||||
rlp = super.rlp.overridePythonAttrs {
|
||||
preConfigure = ''
|
||||
substituteInPlace setup.py --replace \'setuptools-markdown\' ""
|
||||
|
@ -2134,6 +2294,7 @@ lib.composeManyExtensions [
|
|||
[ pkgs.gfortran ] ++
|
||||
lib.optionals (lib.versionAtLeast super.scipy.version "1.7.0") [ self.pythran ] ++
|
||||
lib.optionals (lib.versionAtLeast super.scipy.version "1.9.0") [ self.meson-python pkg-config ];
|
||||
dontUseMesonConfigure = true;
|
||||
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.pybind11 ];
|
||||
setupPyBuildFlags = [ "--fcompiler='gnu95'" ];
|
||||
enableParallelBuilding = true;
|
||||
|
@ -2185,17 +2346,31 @@ lib.composeManyExtensions [
|
|||
'';
|
||||
});
|
||||
|
||||
selenium =
|
||||
let
|
||||
v4orLater = lib.versionAtLeast super.selenium.version "4";
|
||||
selenium = super.selenium.override {
|
||||
# Selenium >=4 is built with Bazel
|
||||
preferWheel = v4orLater;
|
||||
};
|
||||
in
|
||||
selenium.overridePythonAttrs (old: {
|
||||
# Selenium <4 can be installed from sources, with setuptools
|
||||
buildInputs = old.buildInputs ++ (lib.optionals (!v4orLater) [ self.setuptools ]);
|
||||
});
|
||||
|
||||
shapely = super.shapely.overridePythonAttrs (
|
||||
old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ pkgs.geos ];
|
||||
inherit (pkgs.python3.pkgs.shapely) GEOS_LIBRARY_PATH;
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.geos ];
|
||||
|
||||
GEOS_LIBRARY_PATH = "${pkgs.geos}/lib/libgeos_c${stdenv.hostPlatform.extensions.sharedLibrary}";
|
||||
|
||||
GEOS_LIBC = lib.optionalString (!stdenv.isDarwin) "${lib.getLib stdenv.cc.libc}/lib/libc${stdenv.hostPlatform.extensions.sharedLibrary}.6";
|
||||
|
||||
# Fix library paths
|
||||
postPatch = old.postPatch or "" + ''
|
||||
postPatch = lib.optionalString (!(old.src.isWheel or false)) (old.postPatch or "" + ''
|
||||
${pkgs.python3.interpreter} ${./shapely-rewrite.py} shapely/geos.py
|
||||
'';
|
||||
'');
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -2410,7 +2585,9 @@ lib.composeManyExtensions [
|
|||
|
||||
# Stop infinite recursion by using bootstrapped pkg from nixpkgs
|
||||
bootstrapped-pip = super.bootstrapped-pip.override {
|
||||
wheel = self.python.pkgs.wheel;
|
||||
wheel = ((if self.python.isPy2 then pkgs.python2 else pkgs.python3).pkgs.override {
|
||||
python = self.python;
|
||||
}).wheel;
|
||||
};
|
||||
|
||||
watchfiles =
|
||||
|
@ -2481,27 +2658,15 @@ lib.composeManyExtensions [
|
|||
}
|
||||
);
|
||||
|
||||
wheel =
|
||||
let
|
||||
isWheel = super.wheel.src.isWheel or false;
|
||||
# If "wheel" is a pre-built binary wheel
|
||||
wheelPackage = super.buildPythonPackage {
|
||||
inherit (super.wheel) pname name version src;
|
||||
inherit (pkgs.python3.pkgs.wheel) meta;
|
||||
format = "wheel";
|
||||
};
|
||||
# If "wheel" is built from source
|
||||
sourcePackage = ((
|
||||
pkgs.python3.pkgs.override {
|
||||
python = self.python;
|
||||
}
|
||||
).wheel.override {
|
||||
inherit (self) buildPythonPackage bootstrapped-pip setuptools;
|
||||
}).overrideAttrs (old: {
|
||||
inherit (super.wheel) pname name version src;
|
||||
});
|
||||
in
|
||||
if isWheel then wheelPackage else sourcePackage;
|
||||
wheel = ((
|
||||
pkgs.python3.pkgs.override {
|
||||
python = self.python;
|
||||
}
|
||||
).wheel.override {
|
||||
inherit (self) buildPythonPackage bootstrapped-pip setuptools;
|
||||
}).overrideAttrs (old: {
|
||||
inherit (super.wheel) pname name version src;
|
||||
});
|
||||
|
||||
zipp = if super.zipp == null then null else
|
||||
super.zipp.overridePythonAttrs (
|
||||
|
@ -2600,6 +2765,13 @@ lib.composeManyExtensions [
|
|||
}
|
||||
);
|
||||
|
||||
minimal-snowplow-tracker = super.minimal-snowplow-tracker.overridePythonAttrs
|
||||
(
|
||||
old: {
|
||||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ super.setuptools ];
|
||||
}
|
||||
);
|
||||
|
||||
# nixpkgs has setuptools_scm 4.1.2
|
||||
# but newrelic has a seemingly unnecessary version constraint for <4
|
||||
# So we patch that out
|
||||
|
@ -2686,6 +2858,10 @@ lib.composeManyExtensions [
|
|||
'';
|
||||
});
|
||||
|
||||
pyyaml-include = super.pyyaml-include.overridePythonAttrs (old: {
|
||||
SETUPTOOLS_SCM_PRETEND_VERSION = old.version;
|
||||
});
|
||||
|
||||
selinux = super.selinux.overridePythonAttrs (old: {
|
||||
buildInputs = (old.buildInputs or [ ]) ++ [ self.setuptools-scm-git-archive ];
|
||||
});
|
||||
|
@ -2708,27 +2884,69 @@ lib.composeManyExtensions [
|
|||
buildInputs = (old.buildInputs or [ ]) ++ [ self.Babel ];
|
||||
});
|
||||
|
||||
nbconvert = super.nbconvert.overridePythonAttrs (_: {
|
||||
postPatch = lib.optionalString (lib.versionAtLeast self.nbconvert.version "6.5.0") ''
|
||||
substituteInPlace \
|
||||
./nbconvert/exporters/templateexporter.py \
|
||||
--replace \
|
||||
'root_dirs.extend(jupyter_path())' \
|
||||
'root_dirs.extend(jupyter_path() + [os.path.join("@out@", "share", "jupyter")])' \
|
||||
--subst-var out
|
||||
'' + lib.optionalString (lib.versionAtLeast self.nbconvert.version "7.0") ''
|
||||
substituteInPlace \
|
||||
./hatch_build.py \
|
||||
--replace \
|
||||
'if self.target_name not in ["wheel", "sdist"]:' \
|
||||
'if True:'
|
||||
'';
|
||||
nbconvert =
|
||||
let
|
||||
patchExporters = lib.optionalString (lib.versionAtLeast self.nbconvert.version "6.5.0") ''
|
||||
substituteInPlace \
|
||||
./nbconvert/exporters/templateexporter.py \
|
||||
--replace \
|
||||
'root_dirs.extend(jupyter_path())' \
|
||||
'root_dirs.extend(jupyter_path() + [os.path.join("@out@", "share", "jupyter")])' \
|
||||
--subst-var out
|
||||
'';
|
||||
in
|
||||
super.nbconvert.overridePythonAttrs (old: {
|
||||
postPatch = lib.optionalString (!(old.src.isWheel or false)) (
|
||||
patchExporters + lib.optionalString (lib.versionAtLeast self.nbconvert.version "7.0") ''
|
||||
substituteInPlace \
|
||||
./hatch_build.py \
|
||||
--replace \
|
||||
'if self.target_name not in ["wheel", "sdist"]:' \
|
||||
'if True:'
|
||||
''
|
||||
);
|
||||
postInstall = lib.optionalString (old.src.isWheel or false) ''
|
||||
pushd $out/${self.python.sitePackages}
|
||||
${patchExporters}
|
||||
popd
|
||||
'';
|
||||
});
|
||||
|
||||
meson-python = super.meson-python.overridePythonAttrs (old: {
|
||||
dontUseMesonConfigure = true;
|
||||
});
|
||||
|
||||
mkdocs = super.mkdocs.overridePythonAttrs (old: {
|
||||
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ self.babel ];
|
||||
});
|
||||
|
||||
# patch mkdocstrings to fix jinja2 imports
|
||||
mkdocstrings =
|
||||
let
|
||||
patchJinja2Imports = self.pkgs.fetchpatch {
|
||||
name = "fix-jinja2-imports.patch";
|
||||
url = "https://github.com/mkdocstrings/mkdocstrings/commit/b37722716b1e0ed6393ec71308dfb0f85e142f3b.patch";
|
||||
hash = "sha256-DD1SjEvs5HBlSRLrqP3jhF/yoeWkF7F3VXCD1gyt5Fc=";
|
||||
};
|
||||
in
|
||||
super.mkdocstrings.overridePythonAttrs (
|
||||
old: lib.optionalAttrs
|
||||
(lib.versionAtLeast old.version "0.17" && lib.versionOlder old.version "0.18")
|
||||
{
|
||||
patches = old.patches or [ ] ++ lib.optionals (!(old.src.isWheel or false)) [ patchJinja2Imports ];
|
||||
# strip the first two levels ("a/src/") when patching since we're in site-packages
|
||||
# just above mkdocstrings
|
||||
postInstall = lib.optionalString (old.src.isWheel or false) ''
|
||||
pushd "$out/${self.python.sitePackages}"
|
||||
patch -p2 < "${patchJinja2Imports}"
|
||||
popd
|
||||
'';
|
||||
}
|
||||
);
|
||||
|
||||
y-py = super.y-py.override {
|
||||
preferWheel = true;
|
||||
};
|
||||
}
|
||||
)
|
||||
|
||||
]
|
||||
|
|
|
@ -106,7 +106,7 @@ let
|
|||
filtered = builtins.filter filterWheel filesWithoutSources;
|
||||
choose = files:
|
||||
let
|
||||
osxMatches = [ "12_0" "11_0" "10_15" "10_12" "10_11" "10_10" "10_9" "10_8" "10_7" "any" ];
|
||||
osxMatches = [ "12_0" "11_0" "10_15" "10_14" "10_12" "10_11" "10_10" "10_9" "10_8" "10_7" "any" ];
|
||||
linuxMatches = [ "manylinux1_" "manylinux2010_" "manylinux2014_" "manylinux_" "any" ];
|
||||
chooseLinux = x: lib.take 1 (findBestMatches linuxMatches x);
|
||||
chooseOSX = x: lib.take 1 (findBestMatches osxMatches x);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
|||
[tool.poetry]
|
||||
name = "poetry"
|
||||
version = "1.3.0"
|
||||
version = "1.4.1"
|
||||
description = "Python dependency management and packaging made easy."
|
||||
authors = [
|
||||
"Sébastien Eustace <sebastien@eustace.io>",
|
||||
|
@ -47,23 +47,27 @@ generate-setup-file = false
|
|||
[tool.poetry.dependencies]
|
||||
python = "^3.7"
|
||||
|
||||
poetry-core = "1.4.0"
|
||||
poetry-plugin-export = "^1.2.0"
|
||||
poetry-core = "1.5.2"
|
||||
poetry-plugin-export = "^1.3.0"
|
||||
"backports.cached-property" = { version = "^1.0.2", python = "<3.8" }
|
||||
build = "^0.10.0"
|
||||
cachecontrol = { version = "^0.12.9", extras = ["filecache"] }
|
||||
cleo = "^2.0.0"
|
||||
crashtest = "^0.4.1"
|
||||
dulwich = "^0.20.46"
|
||||
dulwich = "^0.21.2"
|
||||
filelock = "^3.8.0"
|
||||
html5lib = "^1.0"
|
||||
importlib-metadata = { version = "^4.4", python = "<3.10" }
|
||||
importlib-metadata = { version = ">=4.4", python = "<3.10" }
|
||||
installer = "^0.7.0"
|
||||
jsonschema = "^4.10.0"
|
||||
keyring = "^23.9.0"
|
||||
lockfile = "^0.12.2"
|
||||
# packaging uses calver, so version is unclamped
|
||||
packaging = ">=20.4"
|
||||
pexpect = "^4.7.0"
|
||||
pkginfo = "^1.5"
|
||||
pkginfo = "^1.9.4"
|
||||
platformdirs = "^2.5.2"
|
||||
pyproject-hooks = "^1.0.0"
|
||||
requests = "^2.18"
|
||||
requests-toolbelt = ">=0.9.1,<0.11.0"
|
||||
shellingham = "^1.5"
|
||||
|
@ -74,9 +78,9 @@ tomlkit = ">=0.11.1,<1.0.0,!=0.11.2,!=0.11.3"
|
|||
trove-classifiers = ">=2022.5.19"
|
||||
# exclude 20.4.5 - 20.4.6 due to https://github.com/pypa/pip/issues/9953
|
||||
virtualenv = [
|
||||
{ version = "^20.4.3,!=20.4.5,!=20.4.6", markers = "sys_platform != 'win32' or python_version != '3.9'" },
|
||||
{ version = "^20.4.3,!=20.4.5,!=20.4.6" },
|
||||
# see https://github.com/python-poetry/poetry/pull/6950 for details
|
||||
{ version = "^20.4.3,!=20.4.5,!=20.4.6,<20.16.6", markers = "sys_platform == 'win32' and python_version == '3.9'" },
|
||||
{ version = "<20.16.6", markers = "sys_platform == 'win32' and python_version == '3.9'" },
|
||||
]
|
||||
xattr = { version = "^0.10.0", markers = "sys_platform == 'darwin'" }
|
||||
urllib3 = "^1.26.0"
|
||||
|
@ -87,18 +91,22 @@ pre-commit = "^2.6"
|
|||
[tool.poetry.group.test.dependencies]
|
||||
# Cachy frozen to test backwards compatibility for `poetry.utils.cache`.
|
||||
cachy = "0.3.0"
|
||||
deepdiff = "^5.0"
|
||||
flatdict = "^4.0.1"
|
||||
deepdiff = [
|
||||
{ version = "^6.2" },
|
||||
# avoid orjson, which is required by deepdiff 6.2.3, on FreeBSD
|
||||
# because it requires a rust compiler
|
||||
{ version = "<6.2.3", markers = "platform_system == 'FreeBSD'"},
|
||||
]
|
||||
httpretty = "^1.0"
|
||||
pytest = "^7.1"
|
||||
pytest-cov = "^4.0"
|
||||
pytest-mock = "^3.9"
|
||||
pytest-randomly = "^3.12"
|
||||
pytest-xdist = { version = "^2.5", extras = ["psutil"] }
|
||||
pytest-xdist = { version = "^3.1", extras = ["psutil"] }
|
||||
zipp = { version = "^3.4", python = "<3.8" }
|
||||
|
||||
[tool.poetry.group.typing.dependencies]
|
||||
mypy = ">=0.990"
|
||||
mypy = ">=1.0"
|
||||
types-html5lib = ">=1.1.9"
|
||||
types-jsonschema = ">=4.9.0"
|
||||
types-requests = ">=2.28.8"
|
||||
|
@ -161,25 +169,22 @@ enable_error_code = [
|
|||
# warning.
|
||||
[[tool.mypy.overrides]]
|
||||
module = [
|
||||
'poetry.console.commands.self.show.plugins',
|
||||
'poetry.installation.executor',
|
||||
'poetry.mixology.version_solver',
|
||||
'poetry.plugins.plugin_manager',
|
||||
'poetry.repositories.installed_repository',
|
||||
'poetry.utils.env',
|
||||
'poetry.console.commands.self.show.plugins',
|
||||
'poetry.plugins.plugin_manager',
|
||||
'poetry.repositories.installed_repository',
|
||||
'poetry.utils.env',
|
||||
]
|
||||
warn_unused_ignores = false
|
||||
|
||||
[[tool.mypy.overrides]]
|
||||
module = [
|
||||
'cachecontrol.*',
|
||||
'lockfile.*',
|
||||
'pexpect.*',
|
||||
'pkginfo.*',
|
||||
'requests_toolbelt.*',
|
||||
'shellingham.*',
|
||||
'virtualenv.*',
|
||||
'xattr.*',
|
||||
'cachecontrol.*',
|
||||
'lockfile.*',
|
||||
'pexpect.*',
|
||||
'requests_toolbelt.*',
|
||||
'shellingham.*',
|
||||
'virtualenv.*',
|
||||
'xattr.*',
|
||||
]
|
||||
ignore_missing_imports = true
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"owner": "python-poetry",
|
||||
"repo": "poetry",
|
||||
"rev": "1.3.0",
|
||||
"sha256": "16ng59ykm7zkjizmwb482y0hawpjjr5mvl0ahjd790xzxcc2bbbv",
|
||||
"rev": "1.4.1",
|
||||
"sha256": "09mqabplg5kprs6qgjj2c2xvm1w43ibsawb18swh3css92s4bm4c",
|
||||
"fetchSubmodules": true
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue