Repackage an old version since the Python 2 version is still needed
Julien Puydt
4 years ago
0 | setuptools-scm (3.4.3+really3.3.3-1) UNRELEASED; urgency=medium | |
1 | ||
2 | * Re-upload an old version since the Python 2 version is | |
3 | still needed. | |
4 | ||
5 | -- Julien Puydt <jpuydt@debian.org> Fri, 31 Jan 2020 22:39:11 +0100 | |
6 | ||
0 | 7 | setuptools-scm (3.4.3-1) unstable; urgency=medium |
1 | 8 | |
2 | 9 | * Document the patch was forwarded and is from me. |
8 | 8 | dh-python, |
9 | 9 | git, |
10 | 10 | mercurial, |
11 | python, | |
12 | python-py, | |
13 | python-pytest, | |
14 | python-setuptools, | |
11 | 15 | python3-all, |
12 | 16 | python3-py, |
13 | 17 | python3-pytest, |
16 | 20 | Vcs-Git: https://salsa.debian.org/python-team/modules/setuptools-scm.git |
17 | 21 | Vcs-Browser: https://salsa.debian.org/python-team/modules/setuptools-scm |
18 | 22 | |
23 | Package: python-setuptools-scm | |
24 | Architecture: all | |
25 | Depends: python-pkg-resources, | |
26 | ${misc:Depends}, | |
27 | ${python:Depends} | |
28 | Description: blessed package to manage your versions by scm tags for Python 2 | |
29 | setuptools_scm handles managing your Python package versions in scm metadata. | |
30 | It also handles file finders for the suppertes scm's. | |
31 | . | |
32 | This package installs the library for Python 2. | |
33 | ||
19 | 34 | Package: python3-setuptools-scm |
20 | 35 | Architecture: all |
21 | 36 | Depends: python3-distutils, |
22 | 37 | python3-pkg-resources, |
23 | python3-toml, | |
24 | 38 | ${misc:Depends}, |
25 | 39 | ${python3:Depends} |
26 | 40 | Description: blessed package to manage your versions by scm tags for Python 3 |
11 | 11 | |
12 | 12 | log = logging.getLogger(__name__) |
13 | 13 | |
14 | @@ -50,6 +51,7 @@ | |
15 | return _git_interpret_archive(proc.stdout, toplevel) | |
16 | finally: | |
17 | # ensure we avoid resource warnings by cleaning up the process | |
18 | + proc.stdout.close() | |
19 | proc.terminate() | |
14 | @@ -28,16 +29,16 @@ | |
15 | ||
16 | ||
17 | def _git_interpret_archive(fd, toplevel): | |
18 | - tf = tarfile.open(fileobj=fd, mode="r|*") | |
19 | - git_files = set() | |
20 | - git_dirs = {toplevel} | |
21 | - for member in tf.getmembers(): | |
22 | - name = os.path.normcase(member.name).replace("/", os.path.sep) | |
23 | - if member.type == tarfile.DIRTYPE: | |
24 | - git_dirs.add(name) | |
25 | - else: | |
26 | - git_files.add(name) | |
27 | - return git_files, git_dirs | |
28 | + with tarfile.open(fileobj=fd, mode="r|*") as tf: | |
29 | + git_files = set() | |
30 | + git_dirs = {toplevel} | |
31 | + for member in tf.getmembers(): | |
32 | + name = os.path.normcase(member.name).replace("/", os.path.sep) | |
33 | + if member.type == tarfile.DIRTYPE: | |
34 | + git_dirs.add(name) | |
35 | + else: | |
36 | + git_files.add(name) | |
37 | + return git_files, git_dirs | |
38 | ||
39 | ||
40 | def _git_ls_files_and_dirs(toplevel): | |
41 | @@ -46,7 +47,8 @@ | |
42 | cmd = ["git", "archive", "--prefix", toplevel + os.path.sep, "HEAD"] | |
43 | proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, cwd=toplevel) | |
44 | try: | |
45 | - return _git_interpret_archive(proc.stdout, toplevel) | |
46 | + with closing(proc.stdout): | |
47 | + return _git_interpret_archive(proc.stdout, toplevel) | |
20 | 48 | except Exception: |
21 | 49 | if proc.wait() != 0: |
50 | log.exception("listing git files failed - pretending there aren't any") |
6 | 6 | export SETUPTOOLS_SCM_PRETEND_VERSION=$(DEB_VERSION_UPSTREAM) |
7 | 7 | |
8 | 8 | %: |
9 | dh $@ --with python3,pypy --buildsystem=pybuild | |
9 | dh $@ --with python2,python3 --buildsystem=pybuild | |
10 | 10 | |
11 | 11 | override_dh_auto_test: |
12 | 12 | |
13 | 13 | override_dh_auto_install: |
14 | python3 setup.py egg_info | |
14 | python setup.py egg_info | |
15 | 15 | dh_auto_install |
2 | 2 | |
3 | 3 | Tests: testsuite |
4 | 4 | Depends: git, mercurial, python3-pytest, python3-setuptools, python3-setuptools-scm |
5 | ||
6 | Tests: import2 | |
7 | Depends: python-setuptools-scm | |
8 | ||
9 | Tests: testsuite2 | |
10 | Depends: git, mercurial, python-pytest, python-setuptools, python-setuptools-scm |
0 | #!/bin/sh | |
1 | ||
2 | set -e | |
3 | # setuptools_support and test_pip_download: network access is disabled | |
4 | # test_pkg_info_noscmroot and test_use_scm_version_callable: upstream issue #209 | |
5 | TESTS_TO_EXCLUDE="not setuptools_support and not test_pip_download" | |
6 | TESTS_TO_EXCLUDE="$TESTS_TO_EXCLUDE and not test_pkginfo_noscmroot and not test_use_scm_version_callable" | |
7 | python2 -m pytest -k "$TESTS_TO_EXCLUDE" |