-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Fix tests that require isolation via virtualenv #239
Conversation
32949c8
to
1254e7a
Compare
@@ -7,13 +7,17 @@ matrix: | |||
fast_finish: true | |||
include: | |||
- os: linux | |||
dist: xenial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason, travis insists in using an old version of ubuntu, and this version have problems using apt (gpg keys issue)
9fecc98
to
de289c2
Compare
I think I am happy with the code now. Sorry if I took me a while, every time we have a Travis issue, the process in painfully iterative. To be fair, there are a few more things that this PR do:
Unfortunately this PR also removes the ability of using coverage inside the venvs used during tests. (P.S.: The falling test in Travis happens because we are trying to use Python 3.5 but we require 3.6 minimum) |
353aaa0
to
d1758ce
Compare
Pull Request Test Coverage Report for Build 1718
💛 - Coveralls |
4265747
to
1b05f12
Compare
Python3 has the `venv` module built-in. By creating a custom fixture using it, we have more control and can address the limitations of the external package
This is a workaround instead of usinv `venv` python API, since pip is never installed when the running python is already inside a virtual env Unfortunatelly running with coverage is not implemented
Since we are transitioning versions, any outdated extension will cause the tests to break by introducing incompatible version ranges for PyScaffold
… since it is more or less a system test anyway (end-to-end test)
… not installed by default in ubuntu
fbd463a
to
fd50ca8
Compare
… so we avoid SSL errors
f09f785
to
ea40b07
Compare
… to check if the SSL error goes away...
ea40b07
to
cac4fd4
Compare
… in an attempt to solve the SSL errors
0db031c
to
34aec6a
Compare
… in yet other attempt to solve pip SSL errors.
… explicitly, since the other attempts to use env vars and a pip.conf/pip.ini file do not seem to solve the SSL error in Windows [CI]
… so we can understand what else is going wrong
… because it seems that the SSL error in windows is not going anywhere... (using the trusted-host flag, the associated env var or pip.ini in windows, is enough to make pip work, however, `setup.py` seems to ignore all of that and raise SSL errors)
Since get-pip does not solve the problem with the SSL certificates, this commit returns to use `python -m pip install --upgrade pip`, because it should be faster. Additionally, it adds certifi, since a comment in pypa/pip#4156 points that setuptools uses it to solve certificates...
… in system tests, as an attempt to solve of the errors described in pyscaffold#244
2e9951e
to
344d61b
Compare
… the env var in `.cirrus.yml` should be enough, it is not necessary to repeat it everywhere.
… in system tests
… in system tests, with a very naive conversion function
… for system tests. This commit improves the previous one by removing the windows specific path workarounds. Instead of comparing the path that was found by `shell which` with the venv, call `python which` restricting the search to the venv.
… in system tests. This way Python 3.5 can also be included.
[system tests]
2fb1533
to
9484068
Compare
@abravalheri, thanks for this PR. I ported most of it to version 3.2.3 and the current v4.0.x branch. I stayed with pytest-virtualenv and it seems to works. Let me know if you want to have something else merged. Going to Cirrus was a great idea btw. My suggestion would be to have a version 3.3 first with You can just close this PR if you think everything is ported. |
This PR attempts to solve #238.
In order to do so, it replaces pytest-virtualenv dependency by custom code based on stdlib's venv.
To workaround the apparent inability of venv to install pip when running from inside another venv, we use the global python3 available.