This commit is contained in:
2023-03-12 21:19:08 +02:00
parent 03557b463a
commit 56b18d31aa
339 changed files with 16782 additions and 918 deletions

View File

@@ -1,16 +1,41 @@
# $FreeBSD: head/devel/py-setuptools_scm/Makefile 466646 2018-04-06 15:43:40Z wg $
PORTNAME= setuptools_scm
PORTVERSION= 1.17.0
PORTVERSION= 6.4.2
CATEGORIES= devel python
MASTER_SITES= CHEESESHOP
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= wg@FreeBSD.org
MAINTAINER= python@FreeBSD.org
COMMENT= Setuptools plugin to manage your versions by scm tags
WWW= https://github.com/pypa/setuptools_scm
USES= python
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}packaging>=20.0:python/py-packaging@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}tomli>=1.0.0:python/py-tomli@${PY_FLAVOR}
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}packaging>=20.0:python/py-packaging@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}tomli>=1.0.0:python/py-tomli@${PY_FLAVOR}
#TEST_DEPENDS= git:python/git \
# ${PY_MERCURIAL} \
# ${PYTHON_PKGNAMEPREFIX}pip>=0:python/py-pip@${PY_FLAVOR} \
# ${PYTHON_PKGNAMEPREFIX}pytest>=0:python/py-pytest@${PY_FLAVOR}
USES= python:3.6+
USE_PYTHON= autoplist distutils
# Workaround to get a 100% working test suite. This can be removed once
# https://github.com/pypa/setuptools_scm/issues/353 is solved.
TEST_ENV= _PYTEST_SESSION=yes
NO_ARCH= yes
# Skip integration tests that require a more recent version of py-virtualenv
post-extract:
@${MV} ${WRKSRC}/testing/test_setuptools_support.py ${WRKSRC}/testing/test_setuptools_support.py.dist
post-patch:
@${REINPLACE_CMD} -e 's|%%PYTHON_CMD%%|${PYTHON_CMD}|' ${WRKSRC}/testing/test_integration.py
# Note: The test suite requires at least py-pytest >= 6.2.0 due changes to the
# "monkeypatch" functionality. Tests are fine with py-pytest 7.0.0.
do-test:
@cd ${WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest -v -rs
.include <bsd.port.mk>

View File

@@ -1,3 +1,3 @@
TIMESTAMP = 1523031316
SHA256 (setuptools_scm-1.17.0.tar.gz) = 70a4cf5584e966ae92f54a764e6437af992ba42ac4bca7eb37cc5d02b98ec40a
SIZE (setuptools_scm-1.17.0.tar.gz) = 29124
TIMESTAMP = 1644388030
SHA256 (setuptools_scm-6.4.2.tar.gz) = 6833ac65c6ed9711a4d5d2266f8024cfa07c533a0e55f4c12f6eff280a5a9e30
SIZE (setuptools_scm-6.4.2.tar.gz) = 61305

View File

@@ -0,0 +1,19 @@
Avoid errors during runtime if devel/py-packaging is not present.
The package is only required in "_version_cls.py" and falls back to
devel/py-setuptools (via "try ... except") if it's not available.
This is a workaround to remedy issues with upgrade runs that also update
devel/py-{packaging,pyparsing} in environments where devel/py-setuptools_scm is
already present.
--- setup.cfg.orig 2021-12-05 20:43:43 UTC
+++ setup.cfg
@@ -27,7 +27,6 @@ classifiers =
[options]
packages = find:
install_requires =
- packaging>=20.0
setuptools
tomli>=1.0.0 # keep in sync
python_requires = >=3.6

View File

@@ -0,0 +1,22 @@
Workaround for https://github.com/pypa/setuptools_scm/issues/353
Original version (without the check for test sessions) obtained from:
https://github.com/OpenIndiana/oi-userland/commit/7d928fa26c0c5e4c29b4826fe78dc42401730529
--- src/setuptools_scm/file_finder_git.py.orig 2021-10-20 09:27:26 UTC
+++ src/setuptools_scm/file_finder_git.py
@@ -18,7 +18,12 @@ def _git_toplevel(path):
stderr=devnull,
)
trace("find files toplevel", out)
- return os.path.normcase(os.path.realpath(out.strip()))
+ toplevel_path = os.path.normcase(os.path.realpath(out.strip()))
+ setup_py_path = os.path.join(toplevel_path, "setup.py")
+ if os.path.exists(setup_py_path) or os.environ.get("_PYTEST_SESSION"):
+ return toplevel_path
+ else:
+ return None
except subprocess.CalledProcessError:
# git returned error, we are not in a git repo
return None

View File

@@ -0,0 +1,22 @@
Workaround for https://github.com/pypa/setuptools_scm/issues/353
Original version (without the check for test sessions) obtained from:
https://github.com/OpenIndiana/oi-userland/commit/7d928fa26c0c5e4c29b4826fe78dc42401730529
--- src/setuptools_scm/file_finder_hg.py.orig 2021-10-20 09:29:52 UTC
+++ src/setuptools_scm/file_finder_hg.py
@@ -13,7 +13,12 @@ def _hg_toplevel(path):
universal_newlines=True,
stderr=devnull,
)
- return os.path.normcase(os.path.realpath(out.strip()))
+ toplevel_path = os.path.normcase(os.path.realpath(out.strip()))
+ setup_py_path = os.path.join(toplevel_path, "setup.py")
+ if os.path.exists(setup_py_path) or os.environ.get("_PYTEST_SESSION"):
+ return toplevel_path
+ else:
+ return None
except subprocess.CalledProcessError:
# hg returned error, we are not in a mercurial repo
return None

View File

@@ -0,0 +1,13 @@
Avoid hardcoded Python binary.
--- testing/test_integration.py.orig 2022-02-10 17:16:34 UTC
+++ testing/test_integration.py
@@ -119,7 +119,7 @@ def test_pretend_version_accepts_bad_string(monkeypatc
monkeypatch.setenv(PRETEND_KEY, "dummy")
wd.write("setup.py", SETUP_PY_PLAIN)
assert wd.get_version(write_to="test.py") == "dummy"
- assert wd("python setup.py --version") == "0.0.0"
+ assert wd("%%PYTHON_CMD%% setup.py --version") == "0.0.0"
def test_own_setup_fails_on_old_python(monkeypatch):

View File

@@ -1,4 +1,2 @@
Handles managing your python package versions in scm metadata instead of
declaring them as the version argument or in a scm managed file.
WWW: https://github.com/pypa/setuptools_scm/