[arch-commits] Commit in python-tox/repos/community-staging-any (3 files)
Eli Schwartz
eschwartz at archlinux.org
Sun Nov 15 22:16:33 UTC 2020
Date: Sunday, November 15, 2020 @ 22:16:33
Author: eschwartz
Revision: 754851
archrelease: copy trunk to community-staging-any
Added:
python-tox/repos/community-staging-any/0001-tests-do-not-depend-on-pathlib2-for-modern-python-17.patch
(from rev 754850, python-tox/trunk/0001-tests-do-not-depend-on-pathlib2-for-modern-python-17.patch)
python-tox/repos/community-staging-any/PKGBUILD
(from rev 754850, python-tox/trunk/PKGBUILD)
Deleted:
python-tox/repos/community-staging-any/PKGBUILD
-----------------------------------------------------------------+
0001-tests-do-not-depend-on-pathlib2-for-modern-python-17.patch | 172 ++++++++++
PKGBUILD | 160 ++++-----
2 files changed, 254 insertions(+), 78 deletions(-)
Copied: python-tox/repos/community-staging-any/0001-tests-do-not-depend-on-pathlib2-for-modern-python-17.patch (from rev 754850, python-tox/trunk/0001-tests-do-not-depend-on-pathlib2-for-modern-python-17.patch)
===================================================================
--- 0001-tests-do-not-depend-on-pathlib2-for-modern-python-17.patch (rev 0)
+++ 0001-tests-do-not-depend-on-pathlib2-for-modern-python-17.patch 2020-11-15 22:16:33 UTC (rev 754851)
@@ -0,0 +1,172 @@
+From 05230749a23ea0396b22bbcfedb6e7e0526173fe Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz93 at gmail.com>
+Date: Fri, 13 Nov 2020 05:02:18 -0500
+Subject: [PATCH] tests: do not depend on pathlib2 for modern python (#1739)
+
+Try pathlib and fall back to pathlib2.
+
+The latter is technically installable on python 3.4+, but does nothing
+the stdlib doesn't do better. And in tightly constrained build
+environments, e.g. distro packaging, any dependency or test dependency
+must be a system package, but old, python2-specific backports of the
+stdlib might not actually be packaged...
+
+Make the job of distro packagers easier by not requiring patches to use
+pathlib while testing python3.
+
+Fixes #1549
+
+re-apply patch onto the PyPI tarball, because for reasons defying logic
+the PyPI tarball has both trailing whitespace and spaces converted to
+tabs in the distributed setup.cfg
+---
+ setup.cfg | 2 +-
+ tests/integration/test_package_int.py | 6 +++++-
+ tests/integration/test_parallel_interrupt.py | 6 +++++-
+ tests/integration/test_provision_int.py | 6 +++++-
+ tests/unit/package/test_package.py | 11 ++++++++---
+ tests/unit/session/test_provision.py | 7 ++++++-
+ tests/unit/test_z_cmdline.py | 7 +++++--
+ 7 files changed, 35 insertions(+), 10 deletions(-)
+
+diff --git a/setup.cfg b/setup.cfg
+index 1b98a99..9885f6f 100644
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -61,13 +61,13 @@ docs =
+ testing =
+ flaky>=3.4.0
+ freezegun>=0.3.11
+- pathlib2>=2.3.3
+ psutil>=5.6.1
+ pytest>=4.0.0
+ pytest-cov>=2.5.1
+ pytest-mock>=1.10.0
+ pytest-randomly>=1.0.0
+ pytest-xdist>=1.22.2
++ pathlib2>=2.3.3;python_version<"3.4"
+
+ [options.packages.find]
+ where = src
+diff --git a/tests/integration/test_package_int.py b/tests/integration/test_package_int.py
+index b4d221a..01c59f6 100644
+--- a/tests/integration/test_package_int.py
++++ b/tests/integration/test_package_int.py
+@@ -4,7 +4,11 @@ import subprocess
+ import sys
+
+ import pytest
+-from pathlib2 import Path
++
++if sys.version_info[:2] >= (3, 4):
++ from pathlib import Path
++else:
++ from pathlib2 import Path
+
+ from tests.lib import need_git
+
+diff --git a/tests/integration/test_parallel_interrupt.py b/tests/integration/test_parallel_interrupt.py
+index b21bfac..b89072a 100644
+--- a/tests/integration/test_parallel_interrupt.py
++++ b/tests/integration/test_parallel_interrupt.py
+@@ -7,7 +7,11 @@ from datetime import datetime
+
+ import pytest
+ from flaky import flaky
+-from pathlib2 import Path
++
++if sys.version_info[:2] >= (3, 4):
++ from pathlib import Path
++else:
++ from pathlib2 import Path
+
+ from tox.constants import INFO
+ from tox.util.main import MAIN_FILE
+diff --git a/tests/integration/test_provision_int.py b/tests/integration/test_provision_int.py
+index a7683b0..0ae411b 100644
+--- a/tests/integration/test_provision_int.py
++++ b/tests/integration/test_provision_int.py
+@@ -4,7 +4,11 @@ import sys
+ import time
+
+ import pytest
+-from pathlib2 import Path
++
++if sys.version_info[:2] >= (3, 4):
++ from pathlib import Path
++else:
++ from pathlib2 import Path
+
+ from tox.constants import INFO
+ from tox.util.main import MAIN_FILE
+diff --git a/tests/unit/package/test_package.py b/tests/unit/package/test_package.py
+index d546ecc..5a196d5 100644
+--- a/tests/unit/package/test_package.py
++++ b/tests/unit/package/test_package.py
+@@ -132,12 +132,17 @@ def test_build_backend_without_submodule(initproj, cmd):
+ # To trigger original bug, must be package with __init__.py
+ "inline_backend": {
+ "__init__.py": """\
++ import sys
+ def get_requires_for_build_sdist(*args, **kwargs):
+- return ["pathlib2"]
++ return ["pathlib2;python_version<'3.4'"]
+
+ def build_sdist(sdist_directory, config_settings=None):
+- import pathlib2
+- (pathlib2.Path(sdist_directory) / "magic-0.1.0.tar.gz").touch()
++ if sys.version_info[:2] >= (3, 4):
++ import pathlib
++ else:
++ import pathlib2 as pathlib
++
++ (pathlib.Path(sdist_directory) / "magic-0.1.0.tar.gz").touch()
+ return "magic-0.1.0.tar.gz"
+ """,
+ },
+diff --git a/tests/unit/session/test_provision.py b/tests/unit/session/test_provision.py
+index ffc2c20..3065932 100644
+--- a/tests/unit/session/test_provision.py
++++ b/tests/unit/session/test_provision.py
+@@ -7,7 +7,12 @@ import sys
+
+ import py
+ import pytest
+-from pathlib2 import Path
++
++if sys.version_info[:2] >= (3, 4):
++ from pathlib import Path
++else:
++ from pathlib2 import Path
++
+ from six.moves.urllib.parse import urljoin
+ from six.moves.urllib.request import pathname2url
+
+diff --git a/tests/unit/test_z_cmdline.py b/tests/unit/test_z_cmdline.py
+index 8a641f8..ec50b55 100644
+--- a/tests/unit/test_z_cmdline.py
++++ b/tests/unit/test_z_cmdline.py
+@@ -6,7 +6,10 @@ import subprocess
+ import sys
+ import tempfile
+
+-import pathlib2
++if sys.version_info[:2] >= (3, 4):
++ import pathlib
++else:
++ import pathlib2 as pathlib
+ import py
+ import pytest
+
+@@ -462,7 +465,7 @@ def test_no_setup_py_exits_but_pyproject_toml_does(cmd, initproj):
+ },
+ )
+ os.remove("setup.py")
+- pathlib2.Path("pyproject.toml").touch()
++ pathlib.Path("pyproject.toml").touch()
+ result = cmd()
+ result.assert_fail()
+ assert any(
+--
+2.29.2
+
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2020-11-15 22:16:14 UTC (rev 754850)
+++ PKGBUILD 2020-11-15 22:16:33 UTC (rev 754851)
@@ -1,78 +0,0 @@
-# Maintainer: Felix Yan <felixonmars at archlinux.org>
-# Contributor: Thomas Weißschuh <thomas t-8ch.de>
-# Contributor: George Brooke <george+arch.aur at george-brooke.co.uk>
-# Contributor: Sebastian Wiesner <lunaryorn googlemail com>
-
-pkgbase=python-tox
-pkgname=(python-tox python2-tox)
-pkgver=3.20.1
-pkgrel=3
-pkgdesc='Python virtualenv management and testing tool'
-arch=('any')
-url='https://tox.readthedocs.io'
-license=('GPL2')
-makedepends=('python-setuptools-scm' 'python2-setuptools-scm' 'python-py' 'python2-py' 'python-virtualenv'
- 'python2-virtualenv' 'python-pluggy' 'python2-pluggy' 'python-toml' 'python2-toml'
- 'python-filelock' 'python2-filelock' 'python-freezegun' 'python2-freezegun')
-checkdepends=('python-pytest-runner' 'python2-pytest-runner' 'python-pytest-mock'
- 'python2-pytest-mock' 'python2-pathlib2' 'python-flaky' 'python2-flaky'
- 'python-pathlib2' 'python2-pathlib2')
-source=("https://pypi.io/packages/source/t/tox/tox-$pkgver.tar.gz")
-sha512sums=('73d6b6ca98cc9de628038360fe0af50ecfac1e7949735fde49fd38d85c9fcc517d897eeb287da0388265e689941ef3b63956349b4be409197a164039cb1ba1ae')
-
-prepare() {
- find tox-$pkgver -name "*.pyc" -delete
-
- cp -a tox-$pkgver{,-py2}
-
- sed -i 's|pathlib2|pathlib|' tox-$pkgver/tests/integration/*.py
-}
-
-build() {
- export LC_CTYPE=en_US.UTF-8
-
- cd "$srcdir"/tox-$pkgver
- python setup.py build
-
- cd "$srcdir"/tox-$pkgver-py2
- python2 setup.py build
-}
-
-check() {
- # Hack entry points
-
- (
- cd "$srcdir"/tox-$pkgver
- virtualenv "$srcdir/pyvenv" --system-site-packages
- . "$srcdir/pyvenv/bin/activate"
- python setup.py install
- python setup.py pytest
- )
-
- (
- cd "$srcdir"/tox-$pkgver-py2
- virtualenv2 "$srcdir/pyvenv-py2" --system-site-packages
- . "$srcdir/pyvenv-py2/bin/activate"
- python setup.py install
- python setup.py pytest
- )
-}
-
-package_python-tox() {
- depends=('python-py' 'python-virtualenv' 'python-setuptools' 'python-pluggy' 'python-toml'
- 'python-filelock')
-
- cd "$srcdir"/tox-$pkgver
- python setup.py install --root="$pkgdir" --optimize=1
- ln -s tox "$pkgdir"/usr/bin/tox3
-}
-
-package_python2-tox() {
- depends=('python2-py' 'python2-virtualenv' 'python2-setuptools' 'python2-pluggy' 'python2-toml'
- 'python2-filelock')
-
- cd "$srcdir"/tox-$pkgver-py2
- python2 setup.py install --root="$pkgdir" --optimize=1
- mv "$pkgdir"/usr/bin/tox{,2}
- mv "$pkgdir"/usr/bin/{tox-quickstart,tox2-quickstart}
-}
Copied: python-tox/repos/community-staging-any/PKGBUILD (from rev 754850, python-tox/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2020-11-15 22:16:33 UTC (rev 754851)
@@ -0,0 +1,82 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Thomas Weißschuh <thomas t-8ch.de>
+# Contributor: George Brooke <george+arch.aur at george-brooke.co.uk>
+# Contributor: Sebastian Wiesner <lunaryorn googlemail com>
+
+pkgbase=python-tox
+pkgname=(python-tox python2-tox)
+pkgver=3.20.1
+pkgrel=4
+pkgdesc='Python virtualenv management and testing tool'
+arch=('any')
+url='https://tox.readthedocs.io'
+license=('GPL2')
+makedepends=('python-setuptools-scm' 'python2-setuptools-scm' 'python-py' 'python2-py' 'python-virtualenv'
+ 'python2-virtualenv' 'python-pluggy' 'python2-pluggy' 'python-toml' 'python2-toml'
+ 'python-filelock' 'python2-filelock' 'python-freezegun' 'python2-freezegun')
+checkdepends=('python-pytest-runner' 'python2-pytest-runner' 'python-pytest-mock'
+ 'python2-pytest-mock' 'python-flaky' 'python2-flaky' 'python2-pathlib2')
+source=("https://pypi.io/packages/source/t/tox/tox-$pkgver.tar.gz"
+ "0001-tests-do-not-depend-on-pathlib2-for-modern-python-17.patch")
+sha512sums=('73d6b6ca98cc9de628038360fe0af50ecfac1e7949735fde49fd38d85c9fcc517d897eeb287da0388265e689941ef3b63956349b4be409197a164039cb1ba1ae'
+ '602fff6eea913455e9b8ce7196d154960a4916bc395a99ed2660491134fbb3b48d6bbd30cbaf62b693ad0efdd50d78ca79ea72aa6162801c8d78543da5e36393')
+
+prepare() {
+ find tox-$pkgver -name "*.pyc" -delete
+
+ # do not depend on pathlib2 on python3: https://github.com/tox-dev/tox/pull/1739
+ cd "$srcdir"/tox-$pkgver
+ patch -p1 -i ../0001-tests-do-not-depend-on-pathlib2-for-modern-python-17.patch
+ cd ..
+
+ cp -a tox-$pkgver{,-py2}
+}
+
+build() {
+ export LC_CTYPE=en_US.UTF-8
+
+ cd "$srcdir"/tox-$pkgver
+ python setup.py build
+
+ cd "$srcdir"/tox-$pkgver-py2
+ python2 setup.py build
+}
+
+check() {
+ # Hack entry points
+
+ (
+ cd "$srcdir"/tox-$pkgver
+ virtualenv "$srcdir/pyvenv" --system-site-packages
+ . "$srcdir/pyvenv/bin/activate"
+ python setup.py install
+ python setup.py pytest
+ )
+
+ (
+ cd "$srcdir"/tox-$pkgver-py2
+ virtualenv2 "$srcdir/pyvenv-py2" --system-site-packages
+ . "$srcdir/pyvenv-py2/bin/activate"
+ python setup.py install
+ python setup.py pytest
+ )
+}
+
+package_python-tox() {
+ depends=('python-py' 'python-virtualenv' 'python-setuptools' 'python-pluggy' 'python-toml'
+ 'python-filelock')
+
+ cd "$srcdir"/tox-$pkgver
+ python setup.py install --root="$pkgdir" --optimize=1
+ ln -s tox "$pkgdir"/usr/bin/tox3
+}
+
+package_python2-tox() {
+ depends=('python2-py' 'python2-virtualenv' 'python2-setuptools' 'python2-pluggy' 'python2-toml'
+ 'python2-filelock')
+
+ cd "$srcdir"/tox-$pkgver-py2
+ python2 setup.py install --root="$pkgdir" --optimize=1
+ mv "$pkgdir"/usr/bin/tox{,2}
+ mv "$pkgdir"/usr/bin/{tox-quickstart,tox2-quickstart}
+}
More information about the arch-commits
mailing list