* [gentoo-portage-dev] [PATCH v2 1/2] Add a tox.ini to support running tests via tox
@ 2018-08-01 7:34 Michał Górny
2018-08-01 7:34 ` [gentoo-portage-dev] [PATCH v2 2/2] .travis.yml: Take advantage of tox Michał Górny
0 siblings, 1 reply; 3+ messages in thread
From: Michał Górny @ 2018-08-01 7:34 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: Michał Górny
tox is the common Pythonic tool for running tests against multiple
interpreters. It integrates well with virtualenv, making testing
trivial on practically any system. Add a tox.ini file so users can take
advantage of it.
---
tox.ini | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
create mode 100644 tox.ini
Changes in v2:
passing '-b -Wd' to python
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 000000000..cafdb0045
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,16 @@
+[tox]
+envlist = py27,py34,py35,py36,pypy,pypy3
+skipsdist = True
+
+[testenv]
+deps =
+ lxml!=4.2.0
+ pygost
+ pyyaml
+ py27,py34,py35,pypy: pyblake2
+ py27,py34,py35,pypy: pysha3
+setenv =
+ PYTHONPATH={toxinidir}/lib
+commands =
+ python -b -Wd setup.py test
+ python -b -Wd repoman/setup.py test
--
2.18.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-portage-dev] [PATCH v2 2/2] .travis.yml: Take advantage of tox
2018-08-01 7:34 [gentoo-portage-dev] [PATCH v2 1/2] Add a tox.ini to support running tests via tox Michał Górny
@ 2018-08-01 7:34 ` Michał Górny
2018-08-01 8:17 ` Zac Medico
0 siblings, 1 reply; 3+ messages in thread
From: Michał Górny @ 2018-08-01 7:34 UTC (permalink / raw
To: gentoo-portage-dev; +Cc: Michał Górny
Replace the code responsible for installing dependencies and running
tests on Travis to use tox. This reduces code duplication (= risk
of mis-sync) and saves us from those hoops needed to install
dependencies conditionally via travis.
---
.travis.yml | 28 ++++++----------------------
1 file changed, 6 insertions(+), 22 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 9313fc645..846308e08 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,30 +8,14 @@ python:
# command to install dependencies
install:
- - sudo apt-get update -qq
- - sudo apt-get install -y libxml2-utils
- - pip install lxml
- # python3.6+ has sha3 built-in, for older versions install pysha3
- # (except for pypy where pysha3 is broken)
- - "[[ ${TRAVIS_PYTHON_VERSION} == 3.[6789] || ${TRAVIS_PYTHON_VERSION} == pypy ]] || pip install pysha3"
- # python3.6+ has blake2 built-in, for older versions install pyblake2
- - "[[ ${TRAVIS_PYTHON_VERSION} == 3.[6789] ]] || pip install pyblake2"
- # always install pygost for Streebog
- - pip install pygost
- # pyyaml is needed for building
- - pip install pyyaml
+ - pip install tox
script:
- printf "[build_ext]\nportage-ext-modules=true" >> setup.cfg
- ./setup.py test
- ./setup.py install --root=/tmp/install-root
- # prevent repoman tests from trying to fetch metadata.xsd
- - mkdir -p /tmp/install-root/usr/lib/portage/cnf
- - cp repoman/cnf/metadata.xsd /tmp/install-root/usr/lib/portage/cnf/
- - sudo rsync -a /tmp/install-root/. /
- - python -b -Wd -m portage.tests.runTests
- # repoman test block
- - repoman/setup.py test
- - repoman/setup.py install --root=/tmp/install-root
- - sudo rsync -a /tmp/install-root/. /
- - python -b -Wd -m repoman.tests.runTests
+ - if [[ ${TRAVIS_PYTHON_VERSION} == ?.? ]]; then
+ tox -e py${TRAVIS_PYTHON_VERSION/./};
+ else
+ tox -e ${TRAVIS_PYTHON_VERSION};
+ fi
--
2.18.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [gentoo-portage-dev] [PATCH v2 2/2] .travis.yml: Take advantage of tox
2018-08-01 7:34 ` [gentoo-portage-dev] [PATCH v2 2/2] .travis.yml: Take advantage of tox Michał Górny
@ 2018-08-01 8:17 ` Zac Medico
0 siblings, 0 replies; 3+ messages in thread
From: Zac Medico @ 2018-08-01 8:17 UTC (permalink / raw
To: gentoo-portage-dev, Michał Górny
[-- Attachment #1.1: Type: text/plain, Size: 455 bytes --]
On 08/01/2018 12:34 AM, Michał Górny wrote:
> Replace the code responsible for installing dependencies and running
> tests on Travis to use tox. This reduces code duplication (= risk
> of mis-sync) and saves us from those hoops needed to install
> dependencies conditionally via travis.
> ---
> .travis.yml | 28 ++++++----------------------
> 1 file changed, 6 insertions(+), 22 deletions(-)
Looks good. Please merge.
--
Thanks,
Zac
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 981 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-08-01 8:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-01 7:34 [gentoo-portage-dev] [PATCH v2 1/2] Add a tox.ini to support running tests via tox Michał Górny
2018-08-01 7:34 ` [gentoo-portage-dev] [PATCH v2 2/2] .travis.yml: Take advantage of tox Michał Górny
2018-08-01 8:17 ` Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox