diff --git a/Add-option-git_describe_command.patch b/Add-option-git_describe_command.patch deleted file mode 100644 index 66d64b0dd31ef961cea7963369e94571daa688cb..0000000000000000000000000000000000000000 --- a/Add-option-git_describe_command.patch +++ /dev/null @@ -1,122 +0,0 @@ -From f79598b7acc17b8d6c05d7a9fec502f41b7e8be5 Mon Sep 17 00:00:00 2001 -From: Luciano Bello -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 `_). - -+: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 `_). - - 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" -+ ) diff --git a/python-setuptools_scm.spec b/python-setuptools_scm.spec index b95c923e44f4aeaf8a8e9a97fda37a6bcdf7be37..f3f993cdd31f8bfe439cd3ba9430e41fb2de0e6b 100644 --- a/python-setuptools_scm.spec +++ b/python-setuptools_scm.spec @@ -1,11 +1,10 @@ Name: python-setuptools_scm -Version: 3.1.0 -Release: 3 +Version: 3.4.1 +Release: 1 Summary: Manage your Python package versions in SCM metadata License: MIT 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 -Patch0: Add-option-git_describe_command.patch BuildArch: noarch BuildRequires: git-core mercurial @@ -19,7 +18,7 @@ It also handles file finders for the supported SCMs. %package -n python2-setuptools_scm Summary: %{summary} BuildRequires: python2-devel python2-setuptools -BuildRequires: python2-pytest +BuildRequires: python2-pytest python2-toml %{?python_provide:%python_provide python2-setuptools_scm} %description -n python2-setuptools_scm @@ -32,6 +31,7 @@ Summary: %{summary} BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-pytest +BuildRequires: python%{python3_pkgversion}-toml %{?python_provide:%python_provide python%{python3_pkgversion}-setuptools_scm} 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 %changelog +* Thu Sep 23 2021 chenchen - 3.4.1-1 +- update to 3.4.1 + * Thu Sep 09 2021 huanghaitao - 3.1.0-3 - Add option git_describe_command to fix python-cmd2 build error diff --git a/setuptools_scm-3.1.0.tar.gz b/setuptools_scm-3.1.0.tar.gz deleted file mode 100644 index edb4b76366bb95416ac8e8371532da4f6757b57b..0000000000000000000000000000000000000000 Binary files a/setuptools_scm-3.1.0.tar.gz and /dev/null differ diff --git a/setuptools_scm-3.4.1.tar.gz b/setuptools_scm-3.4.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..70f02c1e0eb03c4a699b5e340dd9c44fe5cefe3e Binary files /dev/null and b/setuptools_scm-3.4.1.tar.gz differ