-
-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
setup.cfg parsed differently on Jenkins #1428
Comments
that is weird, it's probably due to the custom behaviour documented here |
@asottile The documentation seems to state that Hopefully this helps exemplify the issue: # Running locally with setup.cfg:
#
# [tox:tox]
# envlist = py37
$ docker run -it --rm -v $(pwd):/code quay.io/python-devs/ci-image sh -c 'python3.7 -m pip install --user tox && cd /code && python3.7 -m tox -v -a'
using tox.ini: /code/tox.ini (pid 12)
using tox-3.14.1 from /home/runner/.local/lib/python3.7/site-packages/tox/__init__.py (pid 12)
default environments:
py37 -> [no description]
# Simulating Jenkins (by adding `-e JENKINS_URL=...`) with setup.cfg:
#
# [tox:tox]
# envlist = py37
$ docker run -it --rm -e JENKINS_URL='http://iam.jenkins' -v $(pwd):/code quay.io/python-devs/ci-image sh -c 'python3.7 -m pip install --user tox && cd /code && python3.7 -m tox -v -a'
using tox.ini: /code/tox.ini (pid 40)
using tox-3.14.1 from /home/runner/.local/lib/python3.7/site-packages/tox/__init__.py (pid 40)
additional environments:
python -> [no description]
# Simulating Jenkins after moving config to tox.ini:
#
# [tox]
# envlist = py37
#
# OR duplicating in setup.cfg:
#
# [tox:tox:jenkins]
# envlist = py37
$ docker run -it --rm -e JENKINS_URL='http://iam.jenkins' -v $(pwd):/code quay.io/python-devs/ci-image sh -c 'python3.7 -m pip install --user tox && cd /code && python3.7 -m tox -v -a'
using tox.ini: /code/tox.ini (pid 40)
using tox-3.14.1 from /home/runner/.local/lib/python3.7/site-packages/tox/__init__.py (pid 40)
additional environments:
py37 -> [no description] |
oh yeah to be clear I'm pretty sure there's a bug here :) was hopefully giving a contributor a pointer to look for in the code |
The TL;DR from my comment for the moment is that duplicating |
Thanks for the update @gaborbernat! |
This bug can be reproduced using this trivial repo: https://github.com/rsokl/tox-bug
Context
JENKINS_URL
orHUDSON_URL
are environment variables are set)Problem
The documentation specifies that the setup.cfg file should contain a
[tox:tox]
section. However, on Jenkins, the file is parsed to look for a[tox]
section instead.Example
Consider the simple setup.cfg
The
toxworkdir
is set as-expected when tox is run locally (off-Jenkins):Running this "on Jenkins", the
[tox:tox]
section is not found andtoxworkdir
fails to get set:>>> env JENKINS_URL="" tox GLOB sdist-make: /home/ry26099/tox_dummy/setup.py python create: /home/ry26099/tox_dummy/.tox/python
Now we can modify the setup.cfg to contain a
[tox]
section, and find inverted behaviorRunning locally, no tox section is found, which is to be expected since we deviate from the documented
[tox:tox]
form (note that thetoxworkdir
is not set):But Jenkins does see this tox section (note that the
toxworkdir
is properly set):>>> env JENKINS_URL="" tox GLOB sdist-make: /home/ry26099/tox_dummy/setup.py py37 create: /home/ry26099/tox_dummy/build/tox/py37
The text was updated successfully, but these errors were encountered: