Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some more issues on staging-next related to Python bootstrap changes #251240

Merged
merged 15 commits into from
Aug 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkgs/development/python-modules/drms/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
, pandas
, six
, astropy
, oldest-supported-numpy
, pytestCheckHook
, pytest-doctestplus
, pythonOlder
, setuptools-scm
, wheel
}:

buildPythonPackage rec {
Expand All @@ -23,7 +25,10 @@ buildPythonPackage rec {
};

nativeBuildInputs = [
numpy
oldest-supported-numpy
setuptools-scm
wheel
];

propagatedBuildInputs = [
Expand Down
12 changes: 12 additions & 0 deletions pkgs/development/python-modules/fe25519/default.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{ lib
, bitlist
, buildPythonPackage
, fetchpatch
, fetchPypi
, fountains
, parts
, pytestCheckHook
, pythonOlder
, setuptools
, wheel
}:

buildPythonPackage rec {
Expand All @@ -21,8 +23,18 @@ buildPythonPackage rec {
hash = "sha256-VwCw/sS8Pzhscoa6yCRGbB9X+CtRVn8xyBEpKfGyhhY=";
};

patches = [
# https://github.com/nthparty/fe25519/pull/1
(fetchpatch {
name = "relax-setuptools-dependency.patch";
url = "https://github.com/nthparty/fe25519/commit/0565f60ddbb1aa4755c68edc85b7df12a3a7311e.patch";
hash = "sha256-FcqkHPdkYN6y+Pvviul2wDsmhhcycfRGqFhmX5sxo1k=";
})
];

nativeBuildInputs = [
setuptools
wheel
];

propagatedBuildInputs = [
Expand Down
12 changes: 12 additions & 0 deletions pkgs/development/python-modules/fountains/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{ lib
, buildPythonPackage
, fetchpatch
, fetchPypi
, setuptools
, wheel
, bitlist
, pythonOlder
}:
Expand All @@ -18,8 +20,18 @@ buildPythonPackage rec {
hash = "sha256-gYVguXMVrXxra/xy+R4RXVk9yDGKiKE8u3qWUk8sjt4=";
};

patches = [
# https://github.com/reity/fountains/pull/1
(fetchpatch {
name = "relax-setuptools-dependency.patch";
url = "https://github.com/reity/fountains/commit/50a6c0e5e0484ba1724320bf82facb29d2c7166e.patch";
hash = "sha256-TVWj1tRE+IJ/ukGf3PSdEhHR/oLjKbT9ExqM4iczu1Q=";
})
];

nativeBuildInputs = [
setuptools
wheel
];

propagatedBuildInputs = [
Expand Down
12 changes: 12 additions & 0 deletions pkgs/development/python-modules/ge25519/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
, bitlist
, buildPythonPackage
, fe25519
, fetchpatch
, fetchPypi
, fountains
, parts
, pytestCheckHook
, pythonOlder
, setuptools
, wheel
}:

buildPythonPackage rec {
Expand All @@ -22,8 +24,18 @@ buildPythonPackage rec {
hash = "sha256-oOvrfRSpvwfCcmpV7FOxcBOW8Ex89d2+otjORrzX4o0=";
};

patches = [
# https://github.com/nthparty/ge25519/pull/1
(fetchpatch {
name = "relax-setuptools-dependency.patch";
url = "https://github.com/nthparty/ge25519/commit/64de94aa67387a30905057c39729d24feaba9064.patch";
hash = "sha256-UTT7VD4lscEA2JiGLx9CRVD1ygXgzcOWqgh5jGMS64Y=";
})
];

nativeBuildInputs = [
setuptools
wheel
];

propagatedBuildInputs = [
Expand Down
16 changes: 12 additions & 4 deletions pkgs/development/python-modules/gpytorch/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
, fetchFromGitHub
, linear_operator
, scikit-learn
, setuptools
, setuptools-scm
, wheel
, torch
, pytestCheckHook
}:
Expand All @@ -19,10 +22,13 @@ buildPythonPackage rec {
hash = "sha256-cpkfjx5G/4duL1Rr4nkHTHi03TDcYbcx3bKP2Ny7Ijo=";
};

postPatch = ''
substituteInPlace setup.py \
--replace 'find_version("gpytorch", "version.py")' \"$version\"
'';
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;

nativeBuildInputs = [
setuptools
setuptools-scm
wheel
];

propagatedBuildInputs = [
linear_operator
Expand All @@ -33,7 +39,9 @@ buildPythonPackage rec {
checkInputs = [
pytestCheckHook
];

pythonImportsCheck = [ "gpytorch" ];

disabledTests = [
# AssertionError on number of warnings emitted
"test_deprecated_methods"
Expand Down
14 changes: 12 additions & 2 deletions pkgs/development/python-modules/mip/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
, numpy
, pytestCheckHook
, pythonOlder
, setuptools
, setuptools-scm
, wheel
, gurobi
, gurobipy
# Enable support for the commercial Gurobi solver (requires a license)
Expand All @@ -20,17 +23,24 @@
buildPythonPackage rec {
pname = "mip";
version = "1.15.0";
format = "pyproject";

disabled = pythonOlder "3.7";
format = "pyproject";

src = fetchPypi {
inherit pname version;
hash = "sha256-f28Dgc/ixSwbhkAgPaLLVpdLJuI5UN37GnazfZFvGX4=";
};

nativeCheckInputs = [ matplotlib networkx numpy pytestCheckHook ];
nativeBuildInputs = [ dos2unix ];

nativeBuildInputs = [
dos2unix
setuptools
setuptools-scm
wheel
];

propagatedBuildInputs = [
cffi
] ++ lib.optionals gurobiSupport ([
Expand Down
6 changes: 6 additions & 0 deletions pkgs/development/python-modules/pint-pandas/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
, buildPythonPackage
, fetchFromGitHub
, setuptools
, setuptools-scm
, wheel
, pint
, pandas
, pytestCheckHook
Expand All @@ -20,8 +22,12 @@ buildPythonPackage rec {
hash = "sha256-FuH6wksSCkkL2AyQN46hwTnfeAZFwkWRl6KEEhsxmUY=";
};

env.SETUPTOOLS_SCM_PRETEND_VERSION = version;

nativeBuildInputs = [
setuptools
setuptools-scm
wheel
];

propagatedBuildInputs = [
Expand Down
19 changes: 19 additions & 0 deletions pkgs/development/python-modules/proxy-py/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, bash
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, gnumake
, httpx
, openssl
Expand All @@ -13,6 +14,7 @@
, pythonOlder
, setuptools-scm
, typing-extensions
, wheel
}:

buildPythonPackage rec {
Expand All @@ -29,6 +31,22 @@ buildPythonPackage rec {
hash = "sha256-dA7a9RicBFCSf6IoGX/CdvI8x/xMOFfNtyuvFn9YmHI=";
};

patches = [
# this patch is so that the one following it applies cleanly
# https://github.com/abhinavsingh/proxy.py/pull/1209
(fetchpatch {
name = "update-build-dependencies.patch";
url = "https://github.com/abhinavsingh/proxy.py/commit/2e535360ce5ed9734f2c00dc6aefe5ebd281cea5.patch";
tjni marked this conversation as resolved.
Show resolved Hide resolved
hash = "sha256-eR3R4M7jwQMnY5ob0V6G71jXcrkV7YZvo1JOUG4gnrY=";
})
# https://github.com/abhinavsingh/proxy.py/pull/1345
(fetchpatch {
name = "remove-setuptools-scm-git-archive-dependency.patch";
url = "https://github.com/abhinavsingh/proxy.py/commit/027bfa6b912745f588d272f1a1082f6ca416f815.patch";
hash = "sha256-O2LlSrSrB3u2McAZRY+KviuU7Hv1tOuf0n+D/H4BWvI=";
})
];

postPatch = ''
substituteInPlace Makefile \
--replace "SHELL := /bin/bash" "SHELL := ${bash}/bin/bash"
Expand All @@ -40,6 +58,7 @@ buildPythonPackage rec {

nativeBuildInputs = [
setuptools-scm
wheel
];

propagatedBuildInputs = [
Expand Down
13 changes: 13 additions & 0 deletions pkgs/development/python-modules/pyairvisual/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, buildPythonPackage
, certifi
, fetchFromGitHub
, fetchpatch
, numpy
, poetry-core
, pygments
Expand All @@ -28,6 +29,15 @@ buildPythonPackage rec {
hash = "sha256-+yqN3q+uA/v01uCguzUSoeCJK9lRmiiYn8d272+Dd2M=";
};

patches = [
# https://github.com/bachya/pyairvisual/pull/298
(fetchpatch {
name = "clean-up-build-dependencies.patch";
url = "https://github.com/bachya/pyairvisual/commit/eb32beb7229a53ff81917cc417ed66b26aae47dd.patch";
hash = "sha256-RLRbHmaR2A8MNc96WHx0L8ccyygoBUaOulAuRJkFuUM=";
})
];

postPatch = ''
substituteInPlace pyproject.toml --replace \
'certifi = ">=2023.07.22"' \
Expand All @@ -46,6 +56,9 @@ buildPythonPackage rec {
pysmb
];

# this lets tests bind to localhost in sandbox mode on macOS
__darwinAllowLocalNetworking = true;
tjni marked this conversation as resolved.
Show resolved Hide resolved

nativeCheckInputs = [
aresponses
pytest-aiohttp
Expand Down
6 changes: 5 additions & 1 deletion pkgs/development/python-modules/pymilvus/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
, buildPythonPackage
, environs
, fetchFromGitHub
, gitpython
, grpcio
, grpcio-testing
, mmh3
Expand All @@ -13,6 +14,7 @@
, scikit-learn
, setuptools-scm
, ujson
, wheel
}:

buildPythonPackage rec {
Expand All @@ -29,15 +31,17 @@ buildPythonPackage rec {
hash = "sha256-wwhgO2iCzPXobyZI0narHPn2WCAB9sS1+AoLrP1Ih6Q=";
};

SETUPTOOLS_SCM_PRETEND_VERSION = version;
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;

pythonRelaxDeps = [
"grpcio"
];

nativeBuildInputs = [
gitpython
pythonRelaxDepsHook
setuptools-scm
wheel
];

propagatedBuildInputs = [
Expand Down
6 changes: 6 additions & 0 deletions pkgs/development/python-modules/pypandoc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, fetchFromGitHub
, pandoc
, pandocfilters
, poetry-core
, pythonOlder
, substituteAll
, texlive
Expand All @@ -11,6 +12,7 @@
buildPythonPackage rec {
pname = "pypandoc";
version = "1.10";
format = "pyproject";

disabled = pythonOlder "3.7";

Expand All @@ -30,6 +32,10 @@ buildPythonPackage rec {
./skip-tests.patch
];

nativeBuildInputs = [
poetry-core
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we don't use poetry during the build, it seems silly to depend on it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pyproject.toml build uses poetry-core instead of setuptools (defined on these lines). I chose to switch to it because the old setuptools build has some unnecessary dependencies (such as pip) in its setup_requires section. I'm not too sure why there are still two different ways to build the package.

];

nativeCheckInputs = [
texlive.combined.scheme-small
pandocfilters
Expand Down
4 changes: 4 additions & 0 deletions pkgs/development/python-modules/pytrends/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
, buildPythonPackage
, fetchPypi
, setuptools
, setuptools-scm
, wheel
, requests
, lxml
, pandas
Expand All @@ -27,6 +29,8 @@ buildPythonPackage rec {

nativeBuildInputs = [
setuptools
setuptools-scm
wheel
];

propagatedBuildInputs = [ requests lxml pandas ];
Expand Down
Loading