Skip to content
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

Travis CI and upstream nox #235

Closed
jayvdb opened this issue Oct 14, 2019 · 6 comments
Closed

Travis CI and upstream nox #235

jayvdb opened this issue Oct 14, 2019 · 6 comments

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Oct 14, 2019

The travis CI config is running two jobs, for Python 3.6 and 3.7, but then each of those runs tests on both 3.6 and 3.7.

Each Travis environment should be running tests for only that version.
fwiw, I am a maintainer of tox-travis, which adds some tox voodoo to achieve this. I would be interested in how to fix this in nox, and note a few other important projects are now using nox so we may be able to find how they are solving the problem.

Another concern is that when I use the latest release of nox from https://github.com/theacodes/nox , it fails.

nox > python -m unittest discover
E
======================================================================
ERROR: tests.test_pipx (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: tests.test_pipx
Traceback (most recent call last):
  File "/opt/python/3.7.1/lib/python3.7/unittest/loader.py", line 434, in _find_test_path
    module = self._get_module_from_name(name)
  File "/opt/python/3.7.1/lib/python3.7/unittest/loader.py", line 375, in _get_module_from_name
    __import__(name)
  File "/home/travis/build/jayvdb/pipx/tests/test_pipx.py", line 16, in <module>
    assert not hasattr(sys, "real_prefix"), "Tests cannot run under virtualenv"
AssertionError: Tests cannot run under virtualenv

https://travis-ci.org/jayvdb/pipx/builds/597571116

@jayvdb
Copy link
Contributor Author

jayvdb commented Oct 14, 2019

I see wntrblm/nox#233 is roughly about this.

jayvdb added a commit to jayvdb/pipx that referenced this issue Oct 14, 2019
Travis sets environment variable TRAVIS_PYTHON_VERSION
which can be used to refine the sessions run in each job.

Add a Windows job on Travis CI for Python 3.7, but not
running docs due to Unicode in docs/index.md which Windows
UTF-8 doesnt handle.

Related to pypa#124
Related to pypa#235
cs01 pushed a commit that referenced this issue Oct 15, 2019
* Add Travis Windows

Travis sets environment variable TRAVIS_PYTHON_VERSION
which can be used to refine the sessions run in each job.

Add a Windows job on Travis CI for Python 3.7, but not
running docs due to Unicode in docs/index.md which Windows
UTF-8 doesnt handle.

Related to #124
Related to #235

* Skip symlink test failing on Windows

Related to #124
@cs01
Copy link
Member

cs01 commented Oct 18, 2019

I updated the travis file to run one session at a time, similar to how nox achieves it.

Regarding the failures to run nox with the latest version, yes that is the case. I had to fork nox and update it. You can see the version of nox that pipx uses in the travis file: pip install git+https://github.com/cs01/nox.git@5ea70723e9e6#egg=nox.

IIRC I used the tox-venv package (https://github.com/tox-dev/tox-venv/blob/master/src/tox_venv/hooks.py) to resolve external Python's in my nox fork. My branch is at https://github.com/cs01/nox/tree/cs01/nox-fork-for-pipx.

The nox issue tracking this is wntrblm/nox#233. I tried adding it in an earlier pull request to nox (wntrblm/nox#231), but it was scope-creeping a little too much so we held off. It might be worth it to revisit now.

@jayvdb
Copy link
Contributor Author

jayvdb commented Oct 19, 2019

@cs01 , I had already solved the duplicate jobs in #236.

nox havent solved Travis versions vs nox versions; I have proposed my solution there, and now you've destroyed it. :/ ;-)

@cs01
Copy link
Member

cs01 commented Oct 19, 2019

The travis CI config is running two jobs, for Python 3.6 and 3.7, but then each of those runs tests on both 3.6 and 3.7.

At the time you made the PR, nox would run all sessions for all available Python versions, which would only be one version at a time. If it can't find the Python version it skips that session without error.

@cs01 , I had already solved the duplicate jobs in #236.

It looks like you did for Windows but not Linux, unless I am missing something?

nox havent solved Travis versions vs nox versions; I have proposed my solution there, and now you've destroyed it. :/ ;-)

I am not following. Sorry if I messed something up. Is there something I need to do/undo?

@jayvdb
Copy link
Contributor Author

jayvdb commented Oct 21, 2019

It looks like you did for Windows but not Linux, unless I am missing something?

I solved it for all Travis platforms.

See 3.6 vs 3.7 linux jobs on https://travis-ci.org/pipxproject/pipx/builds/597732575

I am not following. Sorry if I messed something up. Is there something I need to do/undo?

The NOXSESSIONs you added to .travis.yml are now unnecessary for the jobs running the unit tests, and could just be NOXSESSION=tests if you dont want the lint tasks running in the same job. Doesnt matter much in that case, as NOXSESSION=tests vs NOXSESSION=tests-3.6 isnt such a big win.

@itsayellow
Copy link
Contributor

pipx has moved to github workflows, if there is still a problem with nox on github, please file another issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants