New Python template for pip without pipenv
See original GitHub issueCommunity Note
- Please vote on this issue by adding a š reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave ā+1ā or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
pipenv is really slow and sometimes it hangs for a really long time.
Any objection to removing it? I think leaving the Python env setup to the user is fine - and just recommending Pyenv + virtualenv. Perhaps writing out a simple requirements.txt file instead of a Pipfile in new templates and docs.
Example where it hangs for me - perhaps because Iām using a private PyPi instance that makes it worse, but that works fine with plain pip.
Installing dependencies from Pipfile.lock (8d4353)ā¦
References
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:12 (10 by maintainers)
Top Results From Across the Web
Basic Usage of Pipenv - Read the Docs
Pipenv is a reference implementation for using Pipfile. ... Do not keep Pipfile.lock in version control if multiple versions of Python are being...
Read more >template Ā· PyPI
A CLI tool for generating files from Jinja2 templates and environment variables.
Read more >pipenv Documentation - Read the Docs
Pipenv is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the. Python...
Read more >How to set up a perfect Python project - Sourcery
Pipx is a handy utility that allows quick installation of python command line tools. We'll be using it to install pipenv and cookiecutter....
Read more >Why Python devs should use Pipenv - Opensource.com
Enter pip, which most Python users are familiar with. pip lets us install and uninstall packages. We could specify versions, run pip freeze...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I spent some time looking into my specific/recent problem with pipenvā¦ Iāve determined pipenv is not compatible with AWS Code Artifactā¦ sorry I brushed that off as a possibility earlier. While most cdktf users wonāt experience this, it certainly frustrates me enough to not want to use pipenv and recommend against anyone else using - because itās not following what the rest of the Python community is doing. Add that to my previous bad experiences with it, heaps of other people that donāt like it and the general feeling that itās slow and unnecessary.
Here are more details:
PyPi has a ālegacyā API with a ā/simpleā endpoint. Despite the name, itās still used.
The PyPi reference implementation supports listing all packages via that endpoint, however as best as I can tell normal pip does not use it.
Here you can see the endpoint is still supported.
Iām under the impression that normal pip used to parse that HTML response to follow links to packages or perhaps it still uses the HTML response to search/list packages. But Iām pretty sure newer endpoints, such as the JSON API, are used for that now.
I am fairly certain normal pip does not use the /simple endpoint to install packages. Instead it simply gets /simple/$PACKAGE_NAME. I scoured through the pip code to confirm this, but ultimately some simple verbose output shows that installing boto3 goes straight to /simple/boto3/
Now, on to AWS CodeArtifact - it implements the PyPi spec, but it does not support listing packages via the simple API - from https://docs.aws.amazon.com/codeartifact/latest/ug/python-compatibility.html:
āCodeArtifact supports PyPIās Legacy APIs, except the simple API. CodeArtifact does not support PyPIās XML-RPC or JSON APIs.ā
Clearly AWS left out support for listing the /simple endpoint intentionally - presumably because they knew pip no longer uses it.
This is relevant because when you use a private PyPI with pipenv, you add it as a source to the
Pipfile
- hereās an example:Sadly, pipenv uses the /simple API to list packages. It took me a while to figure this out - hereās an example where I waited over two hours with no errors.
But after banging on it some more, the error is here in clear sight:
At this point, Iād be happy to dig into the pipenv source to be absolutely certain Iām on the right track - that itās really trying to get /simple.
And of course, as the AWS docs clearly state, the endpoint simply does not exist:
All of this might seem more like a bug report for pipenv rather than cdktf, but I really donāt care about pipenv. Iām loving cdktf so far and would rather spend my time ripping pipenv out of cdktf than filing a bug report against pipenv - there are plenty examples of issues on that repo going no where.
PS While I didnāt show an example of normal pip installing from Code Artifact, that does in fact work - and as I previusly mentioned I think normal pip and a basic requirements.txt in the root of any cdktf stack is simple and sufficient. Combined with a recommendation of pyenv and virtualenv, I think the community will have less problems in the long term.
Iām going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If youāve found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.