bndr / pipreqs

pipreqs - Generate pip requirements.txt file based on imports of any project. Looking for maintainers to move this project forward.
Apache License 2.0
6.38k stars 388 forks source link

Support for files that specify their encoding #461

Open kmulka-bloomberg opened 2 months ago

kmulka-bloomberg commented 2 months ago

I ran into the same issue many had here: https://github.com/bndr/pipreqs/issues/214

Python source code does have a standard way of specifying the encoding of a file. I suggest pipreqs uses this if available to detect the encoding of the file.

PEP-263: Defining Python Source Code Encodings https://peps.python.org/pep-0263/