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

Document that "coding: utf-8" is supported in requirements.txt #7182

Closed
chrahunt opened this issue Oct 13, 2019 · 4 comments · Fixed by #7195
Closed

Document that "coding: utf-8" is supported in requirements.txt #7182

chrahunt opened this issue Oct 13, 2019 · 4 comments · Fixed by #7195
Labels
auto-locked Outdated issues that have been locked by automation good first issue A good item for first time contributors to work on type: docs Documentation related

Comments

@chrahunt
Copy link
Member

As mentioned in #6401 (comment), requirements files support # -*- coding: utf-8 -*- declarations. Some details about this convention can be found here.

A sentence should be added to the Requirements File Format section of the docs saying that this is supported, for users that want their requirements files to always be interpreted as UTF-8 no matter what.


Good First Issue: This issue is a good starting point for first time contributors -- the process of fixing this should be a good introduction to pip's development workflow. If you've already contributed to pip, work on another issue without this label instead. If there is not a corresponding pull request for this issue, it is up for grabs. For directions for getting set up, see our Getting Started Guide. If you are working on this issue and have questions, feel free to ask them here, #pypa-dev on Freenode, or the pypa-dev mailing list.

@chrahunt chrahunt added type: docs Documentation related good first issue A good item for first time contributors to work on labels Oct 13, 2019
@pradyunsg
Copy link
Member

@chrahunt could you possibly link to the corresponding code?

I looked in https://github.com/pypa/pip/blob/master/src/pip/_internal/req/req_file.py and can't figure out where exactly the behavior you're pointing out is implemented.

@chrahunt
Copy link
Member Author

Sure. It's done in utils.encoding.auto_decode, via:

  1. req_file.parse_requirements calls download.get_file_content here
  2. download.get_file_content calls utils.encoding.auto_decode here for files
  3. utils.encoding.auto_decode checks for an encoding line here

@pradyunsg
Copy link
Member

That's deeeep. And, there's a doc-fix worth making in download.get_file_content.

@ananyo2012
Copy link
Contributor

Hey I am working on this in PyCon India 2019 Devsprint.

As per my understanding I am supposed to update documentation in Requirements File Format and download.get_file_content

ananyo2012 added a commit to ananyo2012/pip that referenced this issue Oct 14, 2019
ananyo2012 added a commit to ananyo2012/pip that referenced this issue Oct 14, 2019
ananyo2012 added a commit to ananyo2012/pip that referenced this issue Oct 14, 2019
ananyo2012 added a commit to ananyo2012/pip that referenced this issue Oct 31, 2019
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Dec 1, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation good first issue A good item for first time contributors to work on type: docs Documentation related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants