python3Packages.setuptools-git: hardcode path to git executable (#427223)

dotlambda 4509e75a 03c31646

Changed files
+83 -39
pkgs
development
python-modules
backtesting
daltonlens
pdoc3
pypiserver
pytest-fixture-config
pytest-shutil
setuptools-git
+5 -2
pkgs/development/python-modules/backtesting/default.nix
···
fetchPypi,
setuptools,
setuptools-scm,
-
setuptools-git,
numpy,
pandas,
bokeh,
···
hash = "sha256-c4od7ij8U98u2jXqLy0aHDfdugHfFCI/yeh9gKHvvC4=";
};
+
postPatch = ''
+
substituteInPlace setup.py \
+
--replace-fail "'setuptools_git'," ""
+
'';
+
build-system = [
setuptools
setuptools-scm
-
setuptools-git
];
dependencies = [
+5 -2
pkgs/development/python-modules/daltonlens/default.nix
···
buildPythonPackage,
fetchPypi,
setuptools,
-
setuptools-git,
numpy,
pillow,
pytestCheckHook,
···
hash = "sha256-T7fXlRdFtcVw5WURPqZhCmulUi1ZnCfCXgcLtTHeNas=";
};
+
postPatch = ''
+
substituteInPlace setup.cfg \
+
--replace-fail "setup_requires = setuptools_git" ""
+
'';
+
build-system = [
setuptools
-
setuptools-git
];
dependencies = [
+8 -7
pkgs/development/python-modules/pdoc3/default.nix
···
lib,
buildPythonPackage,
fetchFromGitHub,
-
pythonOlder,
mako,
markdown,
-
setuptools-git,
setuptools-scm,
unittestCheckHook,
}:
buildPythonPackage rec {
pname = "pdoc3";
-
version = "0.11.1";
+
version = "0.11.6";
pyproject = true;
-
disabled = pythonOlder "3.9";
src = fetchFromGitHub {
owner = "pdoc3";
repo = "pdoc";
tag = version;
-
hash = "sha256-Opj1fU1eZvqsYJGCBliVwugxFV4H1hzOOTkjs4fOEWA=";
+
hash = "sha256-I8EPsjwA9dHOLvM2Oa4dbtB0N4dVczeGfzk+BVyfBcQ=";
};
+
postPatch = ''
+
substituteInPlace setup.py \
+
--replace-fail "'setuptools_git'," ""
+
'';
+
build-system = [
-
setuptools-git
setuptools-scm
];
···
nativeCheckInputs = [ unittestCheckHook ];
meta = {
-
changelog = "https://github.com/pdoc3/pdoc/blob/${src.rev}/CHANGELOG";
+
changelog = "https://github.com/pdoc3/pdoc/blob/${src.tag}/CHANGELOG";
description = "Auto-generate API documentation for Python projects";
homepage = "https://pdoc3.github.io/pdoc/";
license = lib.licenses.agpl3Plus;
+5 -4
pkgs/development/python-modules/pypiserver/default.nix
···
pip,
pytestCheckHook,
pythonOlder,
-
setuptools-git,
setuptools,
twine,
watchdog,
webtest,
-
wheel,
build,
importlib-resources,
}:
···
hash = "sha256-ODwDYAEAqel31+kR/BE1yBfgOZOtPz3iaCLg/d6jbb4=";
};
+
postPatch = ''
+
substituteInPlace setup.py \
+
--replace-fail '"setuptools-git>=0.3",' ""
+
'';
+
build-system = [
setuptools
-
setuptools-git
-
wheel
];
dependencies = [
+7 -4
pkgs/development/python-modules/pytest-fixture-config/default.nix
···
buildPythonPackage,
fetchFromGitHub,
setuptools,
-
setuptools-git,
pytest,
+
pytestCheckHook,
+
six,
}:
buildPythonPackage rec {
···
cd pytest-fixture-config
'';
-
nativeBuildInputs = [
+
build-system = [
setuptools
-
setuptools-git
];
buildInputs = [ pytest ];
-
doCheck = false;
+
nativeCheckInputs = [
+
pytestCheckHook
+
six
+
];
meta = with lib; {
changelog = "https://github.com/man-group/pytest-plugins/blob/${src.tag}/CHANGES.md";
+1 -10
pkgs/development/python-modules/pytest-shutil/default.nix
···
# build-time
setuptools,
-
setuptools-git,
# runtime
pytest,
-
mock,
-
path,
execnet,
termcolor,
six,
···
build-system = [
setuptools
-
setuptools-git
];
buildInputs = [ pytest ];
dependencies = [
-
mock
-
path
execnet
termcolor
six
···
nativeCheckInputs = [ pytestCheckHook ];
-
disabledTests = [
-
"test_pretty_formatter"
-
]
-
++ lib.optionals isPyPy [
+
disabledTests = lib.optionals isPyPy [
"test_run"
"test_run_integration"
];
+21 -10
pkgs/development/python-modules/setuptools-git/default.nix
···
{
lib,
buildPythonPackage,
-
fetchPypi,
-
pkgs,
+
fetchFromGitHub,
+
gitMinimal,
+
replaceVars,
+
setuptools,
}:
buildPythonPackage rec {
pname = "setuptools-git";
version = "1.2";
-
format = "setuptools";
+
pyproject = true;
-
src = fetchPypi {
-
inherit pname version;
-
sha256 = "ff64136da01aabba76ae88b050e7197918d8b2139ccbf6144e14d472b9c40445";
+
src = fetchFromGitHub {
+
owner = "msabramo";
+
repo = "setuptools-git";
+
tag = version;
+
hash = "sha256-dbQ15y62nanuWgh2puLYSio391Ja3SF+HrafvTBVNbk=";
};
-
propagatedBuildInputs = [ pkgs.git ];
+
patches = [
+
(replaceVars ./hardcode-git-path.patch {
+
git = lib.getExe gitMinimal;
+
})
+
];
+
+
build-system = [ setuptools ];
+
doCheck = false;
-
meta = with lib; {
+
meta = {
description = "Setuptools revision control system plugin for Git";
-
homepage = "https://pypi.python.org/pypi/setuptools-git";
-
license = licenses.bsd3;
+
homepage = "https://github.com/msabramo/setuptools-git";
+
license = lib.licenses.bsd3;
};
}
+31
pkgs/development/python-modules/setuptools-git/hardcode-git-path.patch
···
+
diff --git a/setuptools_git/__init__.py b/setuptools_git/__init__.py
+
index 24c9b8c..a289aca 100644
+
--- a/setuptools_git/__init__.py
+
+++ b/setuptools_git/__init__.py
+
@@ -28,7 +28,7 @@ def version_calc(dist, attr, value):
+
+
+
def calculate_version():
+
- return check_output(['git', 'describe', '--tags', '--dirty']).strip()
+
+ return check_output(['@git@', 'describe', '--tags', '--dirty']).strip()
+
+
+
def ntfsdecode(path):
+
@@ -64,7 +64,7 @@ def gitlsfiles(dirname=''):
+
+
try:
+
topdir = check_output(
+
- ['git', 'rev-parse', '--show-toplevel'], cwd=dirname or None,
+
+ ['@git@', 'rev-parse', '--show-toplevel'], cwd=dirname or None,
+
stderr=PIPE).strip()
+
+
if sys.platform == 'win32':
+
@@ -73,7 +73,7 @@ def gitlsfiles(dirname=''):
+
cwd = topdir
+
+
filenames = check_output(
+
- ['git', 'ls-files', '-z'], cwd=cwd, stderr=PIPE)
+
+ ['@git@', 'ls-files', '-z'], cwd=cwd, stderr=PIPE)
+
except (CalledProcessError, OSError):
+
# Setuptools mandates we fail silently
+
return res