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

bugfix: allow create env with no-pip #1430

Merged
merged 3 commits into from Oct 21, 2019

Conversation

@dncnbuck
Copy link
Contributor

dncnbuck commented Oct 18, 2019

This PR fixes a bug introduced since version 16.7.0 where creating a python virtualenv with only the --no-pip flag leads to the following error,

Traceback (most recent call last):
  File "./virtualenv.py", line 2630, in <module>
    main()
  File "./virtualenv.py", line 870, in main
    symlink=options.symlink,
  File "./virtualenv.py", line 1175, in create_environment
    install_wheel(to_install, py_executable, search_dirs, download=download)
  File "./virtualenv.py", line 1019, in install_wheel
    _install_wheel_with_search_dir(download, project_names, py_executable, search_dirs)
  File "./virtualenv.py", line 1090, in _install_wheel_with_search_dir
    at = project_names.index("pip")
ValueError: 'pip' is not in list

Details

Recent introduction of pinning the pip version to "<19.2" in order to support deprecated python 3.4 introduces this bug.

If the --no-pip argument is passed, "pip" will no longer be in the project_names,

 if sys.version_info[0:2] == (3, 4):
        at = project_names.index("pip")
        project_names[at] = "pip<19.2"

accessing project_names.index("pip") raises a ValueError.

Tests

The tests did not pick this up since all to_install projects where excluded with the arguments
"--no-setuptools", "--no-pip", "--no-wheel"

which does not follow the following codepath

if to_install:
    install_wheel(to_install, py_executable, search_dirs, download=download)
Copy link
Contributor

gaborbernat left a comment

You need to add a changelog for this 👍

Duncan Buck added 2 commits Oct 21, 2019
Duncan Buck
Duncan Buck
@dncnbuck dncnbuck requested a review from gaborbernat Oct 21, 2019
@gaborbernat gaborbernat merged commit f836ce3 into pypa:master Oct 21, 2019
1 check passed
1 check passed
pypa.virtualenv #pypa.virtualenv_20191021.03 succeeded
Details
@gaborbernat

This comment has been minimized.

Copy link
Contributor

gaborbernat commented Oct 21, 2019

thanks

thanks

@gaborbernat

This comment has been minimized.

Copy link
Contributor

gaborbernat commented Oct 22, 2019

@dncnbuck

This comment has been minimized.

Copy link
Contributor Author

dncnbuck commented Oct 22, 2019

Great! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.