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

heads up project goals #17

Open
gaborbernat opened this issue Jun 18, 2019 · 5 comments
Open

heads up project goals #17

gaborbernat opened this issue Jun 18, 2019 · 5 comments

Comments

@gaborbernat
Copy link

Hello,

Just a heads up about the on-going development that will affect this project, there is this issue: (pypa/virtualenv#1366). This will allow customizing the virtualenv seed packages. tox will adopt it as soon as the new virtualenv is released (within the next month). Going ahead afterwards, the recommended way of setting custom seed packages will be by using tox-s setenv:

setenv = VIRTUALENV_SEED_PACKAGES = 'pip >= 19.1.1, <20'  'setuptools >= 41.0.0, <42'

👍

@jayvdb
Copy link

jayvdb commented Jul 1, 2019

@gaborbernat , slightly beyond the scope of this project, but how will that effect users of tox-venv? Can I assume they will not be impacted?

If they are not impacted, then this tox plugin is still needed for people also using tox-venv.

@gaborbernat
Copy link
Author

virtualenv will create the same virtual environment under python 3 as venv, so there no longer will be any reason for people using tox-venv.

@pglass
Copy link
Owner

pglass commented Apr 19, 2020

I was looking into deprecating the tox-pip-version package for my use, but had a few hiccups with with virtualenv 20+.

VIRTUALENV_SEED_PACKAGES?

In my testing, VIRTUALENV_SEED_PACKAGES has no effect, with any seeder. I still get latest pip, as shown below.

@gaborbernat Is VIRTUALENV_SEED_PACKAGES supported? I don't see any documentation or code references to VIRTUALENV_SEED_PACKAGES.

$ VIRTUALENV_SEED_PACKAGES='pip==19.2.3' virtualenv --download --seeder pip .venv
created virtual environment CPython3.6.3.final.0-64 in 5540ms
  creator CPython3Posix(dest=/Users/pglass/code/tox-pip-version/deprecation/.venv, clear=False, global=False)
  seeder PipInvoke(download=True, pip=latest, setuptools=latest, wheel=latest)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

$ .venv/bin/pip --version
pip 20.0.2 from /Users/pglass/code/tox-pip-version/deprecation/.venv/lib/python3.6/site-packages/pip (python 3.6)

VIRTUALENV_PIP and --seeder app-data?

@gaborbernat Using VIRTUALENV_PIP=19.2.3 with --seeder app-data results in the error below. Is this a bug or are these fundamentally incompatible?

$ VIRTUALENV_PIP=19.2.3 virtualenv --download --seeder app-data .venv
ERROR: Invalid requirement: 'pip=19.2.3'
Hint: = is not a valid operator. Did you mean == ?
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/Users/pglass/.pyenv/versions/3.6.3/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/Users/pglass/.pyenv/versions/3.6.3/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/pglass/.pyenv/versions/3.6.3/lib/python3.6/site-packages/virtualenv/seed/via_app_data/via_app_data.py", line 75, in _get
    self.app_data,
  File "/Users/pglass/.pyenv/versions/3.6.3/lib/python3.6/site-packages/virtualenv/seed/embed/wheels/acquire.py", line 33, in get_wheels
    download_wheel(processed, for_py_version, wheel_cache_dir, app_data)
  File "/Users/pglass/.pyenv/versions/3.6.3/lib/python3.6/site-packages/virtualenv/seed/embed/wheels/acquire.py", line 154, in download_wheel
    raise RuntimeError("failed to download wheels")
RuntimeError: failed to download wheels

created virtual environment CPython3.6.3.final.0-64 in 3646ms
  creator CPython3Posix(dest=/Users/pglass/code/tox-pip-version/deprecation/.venv, clear=False, global=False)
  seeder FromAppData(download=True, pip=19.2.3, setuptools=latest, wheel=latest, via=copy, app_data_dir=/Users/pglass/Library/Application Support/virtualenv/seed-app-data/v1.0.1)
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator

download = true behavior in tox

I reported an issue about this here: tox-dev/tox#1558. Basically, download = true in tox.ini is not enabling downloads in virtualenv, which was unexpected. There is a simple workaround.

Ability to specify version ranges?

@gaborbernat Below I have an example of installing a specific pip version with tox.ini, but how can I specify a range of versions. For example, VIRTUALENV_PIP='<20.0.0'. I've gotten an error with everything I've tried so far.


The good news is I can get a specific version of pip installed for use without needing tox-pip-version.

[tox]
envlist = py36
minversion = 3.2.0
requires = virtualenv >= 20.0
skipsdist = True

[testenv]
deps = packaging
download = true
setenv =
    VIRTUALENV_PIP=19.2.3
    VIRTUALENV_SEEDER=pip
    VIRTUALENV_DOWNLOAD=1
commands = python ../tests/check-pip-version.py 19.2.3

For use of tox-venv, VIRTUALENV_CREATOR=venv seems to work - trusting that when I see creator Venv(dest=/Users/pglass/code/tox-pip-version/deprecation/.tox/py36, clear=False, global=False, describe=CPython3Posix) in the logs that it is using python -m venv.

@gaborbernat
Copy link
Author

gaborbernat commented Apr 20, 2020

Virtualenv seed packages is not a thing; in the end decided to implement things differently.

virtualenv_pip should work is a bug if not.

@gaborbernat
Copy link
Author

how can I specify a range of versions

This is not supported at the moment. Implementing this might be complicated (for the app data seeder at least that is).

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