update to 3.4.1
(cherry picked from commit d880a853bc8f84e5766e5b673db0a7fe2f65355c)
This commit is contained in:
parent
d548801c88
commit
8468c0a69b
@ -1,122 +0,0 @@
|
|||||||
From f79598b7acc17b8d6c05d7a9fec502f41b7e8be5 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Luciano Bello <luciano@debian.org>
|
|
||||||
Date: Sat, 27 Oct 2018 16:11:55 -0400
|
|
||||||
Subject: [PATCH] Add option git_describe_command
|
|
||||||
|
|
||||||
The option git_describe_command is added to allow the user to manipulate how `git describe` is called.
|
|
||||||
|
|
||||||
Fixes #303
|
|
||||||
Fixes #283
|
|
||||||
---
|
|
||||||
CHANGELOG.rst | 2 ++
|
|
||||||
README.rst | 7 +++++++
|
|
||||||
src/setuptools_scm/__init__.py | 2 ++
|
|
||||||
src/setuptools_scm/config.py | 1 +
|
|
||||||
src/setuptools_scm/git.py | 5 ++++-
|
|
||||||
testing/test_git.py | 15 +++++++++++++++
|
|
||||||
6 files changed, 31 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
|
|
||||||
index 75ba683f..daa64e6e 100644
|
|
||||||
--- a/CHANGELOG.rst
|
|
||||||
+++ b/CHANGELOG.rst
|
|
||||||
@@ -4,6 +4,8 @@ v3.1.0
|
|
||||||
* fix #297 - correct the invocation in version_from_scm and deprecate it as its exposed by accident
|
|
||||||
* fix #298 - handle git file listing on empty repositories
|
|
||||||
* fix #268 - deprecate ScmVersion.extra
|
|
||||||
+* fix #303 and #283 by adding the option `git_describe_command` to allow the user to control the
|
|
||||||
+way that `git describe` is called.
|
|
||||||
|
|
||||||
v3.0.6
|
|
||||||
======
|
|
||||||
diff --git a/README.rst b/README.rst
|
|
||||||
index 4765803b..dc7a4d7d 100644
|
|
||||||
--- a/README.rst
|
|
||||||
+++ b/README.rst
|
|
||||||
@@ -210,6 +210,13 @@ The currently supported configuration keys are:
|
|
||||||
defaults to the value of ``setuptools_scm.config.DEFAULT_TAG_REGEX``
|
|
||||||
(see `config.py <src/setuptools_scm/config.py>`_).
|
|
||||||
|
|
||||||
+:git_describe_command:
|
|
||||||
+ This command will be used instead the default `git describe` command.
|
|
||||||
+ Use with caution, this is a function for advanced use, and you should be
|
|
||||||
+ familiar with the setuptools_scm internals to use it.
|
|
||||||
+
|
|
||||||
+ The default value is set by ``setuptools_scm.git.DEFAULT_DESCRIBE``
|
|
||||||
+ (see `git.py <src/setuptools_scm/git.py>`_).
|
|
||||||
|
|
||||||
To use setuptools_scm in other Python code you can use the
|
|
||||||
``get_version`` function:
|
|
||||||
diff --git a/src/setuptools_scm/__init__.py b/src/setuptools_scm/__init__.py
|
|
||||||
index 1a39ac0b..f49cce40 100644
|
|
||||||
--- a/src/setuptools_scm/__init__.py
|
|
||||||
+++ b/src/setuptools_scm/__init__.py
|
|
||||||
@@ -121,6 +121,7 @@ def get_version(
|
|
||||||
relative_to=None,
|
|
||||||
tag_regex=None,
|
|
||||||
parse=None,
|
|
||||||
+ git_describe_command=None,
|
|
||||||
):
|
|
||||||
"""
|
|
||||||
If supplied, relative_to should be a file from which root may
|
|
||||||
@@ -138,6 +139,7 @@ def get_version(
|
|
||||||
config.relative_to = relative_to
|
|
||||||
config.tag_regex = tag_regex
|
|
||||||
config.parse = parse
|
|
||||||
+ config.git_describe_command = git_describe_command
|
|
||||||
|
|
||||||
parsed_version = _do_parse(config)
|
|
||||||
|
|
||||||
diff --git a/src/setuptools_scm/config.py b/src/setuptools_scm/config.py
|
|
||||||
index f62f467d..796dd0ba 100644
|
|
||||||
--- a/src/setuptools_scm/config.py
|
|
||||||
+++ b/src/setuptools_scm/config.py
|
|
||||||
@@ -61,6 +61,7 @@ def __init__(self, relative_to=None, root="."):
|
|
||||||
self.write_to_template = None
|
|
||||||
self.parse = None
|
|
||||||
self.tag_regex = DEFAULT_TAG_REGEX
|
|
||||||
+ self.git_describe_command = None
|
|
||||||
|
|
||||||
@property
|
|
||||||
def absolute_root(self):
|
|
||||||
diff --git a/src/setuptools_scm/git.py b/src/setuptools_scm/git.py
|
|
||||||
index 8a91ff3c..91644c7f 100644
|
|
||||||
--- a/src/setuptools_scm/git.py
|
|
||||||
+++ b/src/setuptools_scm/git.py
|
|
||||||
@@ -101,9 +101,12 @@ def parse(
|
|
||||||
if pre_parse:
|
|
||||||
pre_parse(wd)
|
|
||||||
|
|
||||||
+ if config.git_describe_command:
|
|
||||||
+ describe_command = config.git_describe_command
|
|
||||||
+
|
|
||||||
out, unused_err, ret = wd.do_ex(describe_command)
|
|
||||||
if ret:
|
|
||||||
- # If 'git describe' failed, try to get the information otherwise.
|
|
||||||
+ # If 'git git_describe_command' failed, try to get the information otherwise.
|
|
||||||
rev_node = wd.node()
|
|
||||||
dirty = wd.is_dirty()
|
|
||||||
|
|
||||||
diff --git a/testing/test_git.py b/testing/test_git.py
|
|
||||||
index 11e2d7b5..a889293b 100644
|
|
||||||
--- a/testing/test_git.py
|
|
||||||
+++ b/testing/test_git.py
|
|
||||||
@@ -191,3 +191,18 @@ def test_git_feature_branch_increments_major(wd):
|
|
||||||
wd("git checkout -b feature/fun")
|
|
||||||
wd.commit_testfile()
|
|
||||||
assert wd.get_version(version_scheme="python-simplified-semver").startswith("1.1.0")
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+@pytest.mark.issue("https://github.com/pypa/setuptools_scm/issues/303")
|
|
||||||
+def test_not_matching_tags(wd):
|
|
||||||
+ wd.commit_testfile()
|
|
||||||
+ wd("git tag apache-arrow-0.11.1")
|
|
||||||
+ wd.commit_testfile()
|
|
||||||
+ wd("git tag apache-arrow-js-0.9.9")
|
|
||||||
+ wd.commit_testfile()
|
|
||||||
+ assert wd.get_version(
|
|
||||||
+ tag_regex=r"^apache-arrow-([\.0-9]+)$",
|
|
||||||
+ git_describe_command="git describe --dirty --tags --long --exclude *js* ",
|
|
||||||
+ ).startswith(
|
|
||||||
+ "0.11.2"
|
|
||||||
+ )
|
|
||||||
@ -1,11 +1,10 @@
|
|||||||
Name: python-setuptools_scm
|
Name: python-setuptools_scm
|
||||||
Version: 3.1.0
|
Version: 3.4.1
|
||||||
Release: 3
|
Release: 1
|
||||||
Summary: Manage your Python package versions in SCM metadata
|
Summary: Manage your Python package versions in SCM metadata
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://pypi.python.org/pypi/setuptools_scm
|
URL: https://pypi.python.org/pypi/setuptools_scm
|
||||||
Source0: https://files.pythonhosted.org/packages/source/%(n=setuptools_scm; echo ${n:0:1})/setuptools_scm/setuptools_scm-%{version}.tar.gz
|
Source0: https://files.pythonhosted.org/packages/source/%(n=setuptools_scm; echo ${n:0:1})/setuptools_scm/setuptools_scm-%{version}.tar.gz
|
||||||
Patch0: Add-option-git_describe_command.patch
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
BuildRequires: git-core mercurial
|
BuildRequires: git-core mercurial
|
||||||
|
|
||||||
@ -19,7 +18,7 @@ It also handles file finders for the supported SCMs.
|
|||||||
%package -n python2-setuptools_scm
|
%package -n python2-setuptools_scm
|
||||||
Summary: %{summary}
|
Summary: %{summary}
|
||||||
BuildRequires: python2-devel python2-setuptools
|
BuildRequires: python2-devel python2-setuptools
|
||||||
BuildRequires: python2-pytest
|
BuildRequires: python2-pytest python2-toml
|
||||||
%{?python_provide:%python_provide python2-setuptools_scm}
|
%{?python_provide:%python_provide python2-setuptools_scm}
|
||||||
|
|
||||||
%description -n python2-setuptools_scm
|
%description -n python2-setuptools_scm
|
||||||
@ -32,6 +31,7 @@ Summary: %{summary}
|
|||||||
BuildRequires: python%{python3_pkgversion}-devel
|
BuildRequires: python%{python3_pkgversion}-devel
|
||||||
BuildRequires: python%{python3_pkgversion}-setuptools
|
BuildRequires: python%{python3_pkgversion}-setuptools
|
||||||
BuildRequires: python%{python3_pkgversion}-pytest
|
BuildRequires: python%{python3_pkgversion}-pytest
|
||||||
|
BuildRequires: python%{python3_pkgversion}-toml
|
||||||
%{?python_provide:%python_provide python%{python3_pkgversion}-setuptools_scm}
|
%{?python_provide:%python_provide python%{python3_pkgversion}-setuptools_scm}
|
||||||
Obsoletes: platform-python-setuptools_scm < %{version}-%{release}
|
Obsoletes: platform-python-setuptools_scm < %{version}-%{release}
|
||||||
|
|
||||||
@ -71,6 +71,9 @@ PYTHONPATH=%{buildroot}%{python2_sitelib} py.test-%{python3_version} -v -k 'not
|
|||||||
%{python3_sitelib}/setuptools_scm-*.egg-info
|
%{python3_sitelib}/setuptools_scm-*.egg-info
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Sep 23 2021 chenchen <chen_aka_jan@163.com> - 3.4.1-1
|
||||||
|
- update to 3.4.1
|
||||||
|
|
||||||
* Thu Sep 09 2021 huanghaitao <huanghaitao8@huawei.com> - 3.1.0-3
|
* Thu Sep 09 2021 huanghaitao <huanghaitao8@huawei.com> - 3.1.0-3
|
||||||
- Add option git_describe_command to fix python-cmd2 build error
|
- Add option git_describe_command to fix python-cmd2 build error
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
BIN
setuptools_scm-3.4.1.tar.gz
Normal file
BIN
setuptools_scm-3.4.1.tar.gz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user