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

python3.pkgs.setuptools-git-versioning: init at 1.13.5 #248019

Merged
merged 1 commit into from
Aug 10, 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, build
, coverage
, git
, packaging
, pytestCheckHook
, pytest-rerunfailures
, pythonOlder
, setuptools
, toml
, wheel
}:

buildPythonPackage rec {
pname = "setuptools-git-versioning";
version = "1.13.5";
format = "pyproject";

src = fetchFromGitHub {
owner = "dolfinus";
repo = "setuptools-git-versioning";
rev = "refs/tags/v${version}";
hash = "sha256-MAHB6hMAcMo1+HCc6g7xQUD2sG+TLjM/6Oa/BKuXpRc=";
};

nativeBuildInputs = [
setuptools
wheel
];

propagatedBuildInputs = [
packaging
setuptools
] ++ lib.optionals (pythonOlder "3.11") [
toml
];

pythonImportsCheck = [
"setuptools_git_versioning"
];

nativeCheckInputs = [
build
coverage
git
pytestCheckHook
pytest-rerunfailures
toml
];

preCheck = ''
# so that its built binary is accessible by tests
export PATH="$out/bin:$PATH"
'';

# limit tests because the full suite takes several minutes to run
pytestFlagsArray = [ "-m" "important" ];

disabledTests = [
# runs an isolated build that uses internet to download dependencies
"test_config_not_used"
];

meta = with lib; {
description = "Use git repo data (latest tag, current commit hash, etc) for building a version number according PEP-440";
homepage = "https://github.com/dolfinus/setuptools-git-versioning";
changelog = "https://github.com/dolfinus/setuptools-git-versioning/blob/${src.rev}/CHANGELOG.rst";
license = licenses.mit;
maintainers = with maintainers; [ tjni ];
};
}
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11490,6 +11490,8 @@ self: super: with self; {

setuptools-git = callPackage ../development/python-modules/setuptools-git { };

setuptools-git-versioning = callPackage ../development/python-modules/setuptools-git-versioning { };

setuptools-lint = callPackage ../development/python-modules/setuptools-lint { };

setuptools-rust = callPackage ../development/python-modules/setuptools-rust { };
Expand Down