-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
By default, use pip for fetching and installing python packages. #1821
Conversation
A cool thing is that some python tests were failing before and this helped fix things. One of the tests was using python3 and specifying "pip" which, on my workstation, was python2's pip. This made for amusing clashes as pip downloaded an ancient version of Django and python3 failed trying to install it. |
pip now complains about being invoked.
|
With the last commit, the test suite now passes. 👍 |
Django seems to be packaging ok. |
618db9d
to
c4c7f57
Compare
This adds a new flag, --python-internal-pip, which is enabled by default. "internal pip" means using 'python -m pip' to invoke pip. Ideally this will make fpm more correctly use pip. Tested on python 2.7.17 and 3.6.9 on Ubuntu 18.04 All python tests passing 👍👍 Fixes #1820
* https://bugs.python.org/issue22295 At time of writing, the python 3 installation docs mention: https://docs.python.org/3/installing/index.html > The following command will install the latest version of a module and its dependencies from the Python Package Index: > > python -m pip install SomePackage
…all anymore. As part of making "internal pip" the default (#1820), the test suite needed two main changes: 1) Don't check for easy_install anymore 2) Try to find the right python executable. On my Ubuntu 20.04 system, installing Python gives Python v3 which only makes the "python3" executable available. To compensate, the test suite now tries to find any of "python", "python2", or "python3" to use with the test suite. When found, it will set the appropriate `--python-bin` flag in fpm for each test. For #1820
Prior to this change, pip would download Python packages to $PWD which leaves files hanging around. The build_path is automatically removed when fpm exits.
c4c7f57
to
bfa2e8d
Compare
I'm nervous about merging this, but I gain confidence with passing rspec tests as well as manual tests. Two manual tests: Running using the new default, internal pip aka "python -m pip":
Running with internal pip disabled. This should fall back to easy_install by default, which isn't present on my system:
|
This adds a new flag, --python-internal-pip, which is enabled by default.
"internal pip" means using 'python -m pip' to invoke pip. Ideally this will make fpm more correctly use pip.
Tested on python 2.7.17 and 3.6.9 on Ubuntu 18.04
All python tests passing 👍👍
Fixes #1820