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

Upgrade Pipenv to something newer than 2018.5.18 and unpin Pip #1108

Closed
alexandrenicol opened this issue Nov 5, 2020 · 9 comments · Fixed by #1169
Closed

Upgrade Pipenv to something newer than 2018.5.18 and unpin Pip #1108

alexandrenicol opened this issue Nov 5, 2020 · 9 comments · Fixed by #1169

Comments

@alexandrenicol
Copy link

Description

It would be good to be able to use a newer version of pip when using pipenv and Pipfile.

Alternativaly, maybe if both requirements.txt and Pipfile files are in the repository, the buildpack could ignore the Pipfile?

At the moment, if a Pipfile is in the repository, it automatically goes back to pip version 9.x, which doesn't necessarily allow the build of some dependencies.

if [[ -f "$BUILD_DIR/Pipfile" ]]; then
# The buildpack is pinned to old pipenv, which requires older pip.
# Pip 9.0.2 doesn't support installing itself from a wheel, so we have to use split
# versions here (ie: installer pip version different from target pip version).
PIP_VERSION='9.0.2'
PIP_TO_INSTALL="pip==${PIP_VERSION}"
else
PIP_TO_INSTALL="${PIP_WHEEL}"
fi

@edmorley
Copy link
Member

Hi! This is related to #1093 (though that's about being able to override the default version, whereas this seems to be more about changing the default version itself).

I would love to be able to use the same pip for pipenv users as everyone else. The reason it's pinned is:
#833 (comment)

...though unfortunately no repro case was provided, so it's hard for me to know whether the issue is now fixed.

Alternativaly, maybe if both requirements.txt and Pipfile files are in the repository, the buildpack could ignore the Pipfile?

I agree this would be a good idea. In a world where the buildpack supports multiple package managers, I think having requirements.txt take precedence is best.

@tolomea
Copy link

tolomea commented Feb 8, 2021

Just tried to upgrade cryptography and ran face first into this.

Is there any mechanism at all to force newer versions of Pip and Pipenv?

@FreneticScribbler
Copy link

FreneticScribbler commented Feb 8, 2021

Just a note, you're going to want to rename the env var name PIPENV_VERSION when you do finally upgrade the version: pypa/pipenv#3633 (comment)

@timmygee
Copy link

This issue has been solved with this fork https://github.com/alan-eu/heroku-buildpack-python

edmorley added a commit that referenced this issue Feb 11, 2021
Previously the buildpack used pipenv `2018.5.18`, which didn't support
newer pip, meaning that apps using pipenv had to be pinned to a much
older version of pip.

For apps using pipenv, the buildpack now installs pipenv `2020.11.15`
and no longer overrides the pip version compared to non-pipenv installs,
meaning pip `20.1.1` is now used instead of pip `9.0.2`.

Changes:
https://github.com/pypa/pipenv/blob/master/CHANGELOG.rst#20201115-2020-11-15
pypa/pipenv@v2018.05.18...v2020.11.15

This is particularly important since the recently released `cryptography`
v3.4 requires at least pip 19.x, otherwise pip is unable to use its newer
style wheels, and so falls back to building the source distribution. This
causes the install to fail, since building `cryptography` now requires Rust,
which is not present in the Heroku stack image.

Fixes #979.
Fixes #987.
Fixes #1108.
Closes GUS-W-8054805.
edmorley added a commit that referenced this issue Feb 11, 2021
Previously the buildpack used pipenv `2018.5.18`, which didn't support
newer pip, meaning that apps using pipenv had to be pinned to a much
older version of pip.

For apps using pipenv, the buildpack now installs pipenv `2020.11.15`
and no longer overrides the pip version compared to non-pipenv installs,
meaning pip `20.1.1` is now used instead of pip `9.0.2`. (The pip version
is still pinned, but to the reasonably new pip version used by all other
non-pipenv builds.)

Changes:
https://github.com/pypa/pipenv/blob/master/CHANGELOG.rst#20201115-2020-11-15
pypa/pipenv@v2018.05.18...v2020.11.15

This is particularly important since the recently released `cryptography`
v3.4 requires at least pip 19.x, otherwise pip is unable to use its newer
style wheels, and so falls back to building the source distribution. This
causes the install to fail, since building `cryptography` now requires Rust,
which is not present in the Heroku stack image.

Fixes #979.
Fixes #987.
Fixes #1108.
Closes GUS-W-8054805.
@edmorley
Copy link
Member

Hi! Sorry for the delay in getting this resolved. I've just shipped #1169 for this, and there's a bit more context in:
#987 (comment)

Just a note, you're going to want to rename the env var name PIPENV_VERSION

@FreneticScribbler Good spot, thank you :-) I ended up removing the export instead, since the variable is only needed in the buildpack script and not by subprocesses. In general there are lots of unnecessary exports in the buildpack at the moment - they are on my list to clean up everywhere :-)

@jsayles
Copy link

jsayles commented Jan 25, 2023

Any chance we can upgrade Pip to 2022.12.19? My builds are failing because my Pipenv.lock checksums don't match if I'm running the latest version locally.

@edmorley
Copy link
Member

@jsayles Hi! I've been glancing at the pipenv releases periodically trying to find a release with as few regressions as possible - however it's been hard to find one that doesn't break as many things as it fixes. Some of the more recent releases seem slightly better, so I was planning on upgrading to one of them in the next couple of weeks :-)

@edmorley
Copy link
Member

edmorley commented Feb 8, 2023

Pipenv has been updated in #1407.

@edmorley edmorley changed the title Upgrade Pipenv/Pip Upgrade Pipenv to something newer than 2018.5.18 and unpin Pip Feb 8, 2023
@edmorley
Copy link
Member

edmorley commented Feb 8, 2023

(Adjusting the issue title to make it clearer that it's an old already-closed issue. For any future Pipenv related requests, please open new GitHub issues 🙂)

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.

6 participants