mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-07 07:13:17 +08:00
The integration tests under 'tests/integration' are Python 3 only. Flake8 will fail on Python 3 syntax when running under Python 2, but for now we wouldn't like to change this, in order to keep Python 2 compatibility of the code base. To work around the above, set up a separate tox environment to lint the integration tests, and exclude linting the integration tests when the rest of the code is checked. Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
26 lines
611 B
Bash
Executable File
26 lines
611 B
Bash
Executable File
#!/bin/bash -ex
|
|
|
|
mkdir -p ~/mbs
|
|
rsync -a --exclude '.*' --exclude '*.pyc' $PWD ~/mbs
|
|
|
|
cd ~/mbs/src
|
|
|
|
# Remove requirements not necessary for Python 3.7.
|
|
# Also, prevent koji from being re-installed from PyPi.
|
|
sed -i \
|
|
-e '/enum34/d' \
|
|
-e '/funcsigs/d' \
|
|
-e '/futures/d' \
|
|
-e '/koji/d' \
|
|
requirements.txt
|
|
|
|
# Run everything with Python 3
|
|
sed -i \
|
|
-e 's/py.test/py.test-3/g' \
|
|
-e '/basepython/d' \
|
|
tox.ini
|
|
|
|
# Since tox seems to ignore `usedevelop` when we have `sitepackages` on, we have to run it manually
|
|
python3 setup.py develop --no-deps
|
|
/usr/bin/tox -e flake8,py3,intflake "$@"
|