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

Use pip by default, if possible. #1820

Closed
jordansissel opened this issue Aug 21, 2021 · 2 comments · Fixed by #1821
Closed

Use pip by default, if possible. #1820

jordansissel opened this issue Aug 21, 2021 · 2 comments · Fixed by #1821

Comments

@jordansissel
Copy link
Owner

fpm has supported pip for a while as an optional alternative to easy_install. I'm not sure if easy_install is even available anymore on newer Python installations, and pip seems to be the recommended/default way to install python packages.

Objective: fpm should now try to use pip if it is available and fall back to easy_install if needed.

I don't know what negative impact this might have.

easy_install has been deprecated since 2019 , per the python setuptools release notes:

Breaking Changes
... Mark the easy_install script and setuptools command as deprecated

On my workstation, a recent-ish install of Ubuntu 18.04, easy_install isn't installed for me when installing Python. I don't even see it available in apt search easy_install. Pip, however, is available as an Ubuntu python-pip package.

Supporting Links:

Related: #1780

@jordansissel jordansissel changed the title Autodetect pip and use it by default if possible. Use pip by default, if possible. Aug 21, 2021
@jordansissel
Copy link
Owner Author

Tonight, we found a way to invoke pip using python -m pip <command line> and it works nicely! for both Python 2 and 3. Nice!

jordansissel added a commit that referenced this issue Aug 21, 2021
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
@rubyFeedback
Copy link

I am using mostly ruby but also python. pip sort of IMO is the default nowadays. I batch-install python addons via a ruby gem most of the time but when I am lazy, or on windows, pip really is great. I don't even remember easy_install anymore to be honest...

jordansissel added a commit that referenced this issue Nov 9, 2021
…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
jordansissel added a commit that referenced this issue Nov 10, 2021
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
jordansissel added a commit that referenced this issue Nov 10, 2021
…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
jordansissel added a commit that referenced this issue Nov 10, 2021
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
jordansissel added a commit that referenced this issue Nov 10, 2021
…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
jordansissel added a commit that referenced this issue Nov 10, 2021
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
jordansissel added a commit that referenced this issue Nov 10, 2021
…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
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

Successfully merging a pull request may close this issue.

2 participants