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

Comments

@chrahunt
Copy link
Member

@chrahunt chrahunt commented Oct 13, 2019

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.

@pradyunsg

This comment has been minimized.

Copy link
Member

@pradyunsg pradyunsg commented Oct 13, 2019

@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

This comment has been minimized.

Copy link
Member Author

@chrahunt chrahunt commented Oct 13, 2019

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

This comment has been minimized.

Copy link
Member

@pradyunsg pradyunsg commented Oct 14, 2019

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

@ananyo2012

This comment has been minimized.

Copy link
Contributor

@ananyo2012 ananyo2012 commented Oct 14, 2019

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 S: auto-locked 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.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.