cinje icon indicating copy to clipboard operation
cinje copied to clipboard

Automatically register the encoding using a "pth" file.

Open amcgregor opened this issue 10 years ago • 3 comments

This allows us to execute the encoding import and registration on Python startup.

An example approach can be seen in the setup.py for pytest-cov.

amcgregor avatar Dec 03 '15 18:12 amcgregor

This would appear to be an anti-feature. While it does in theory provide some convenience for users of the library, the headaches involving the astoundingly stupid mechanism of pth files outweigh the benefit. Add one and the test coverage requires wrapping in a call to pytest-cov in order to capture the initial import, but only if our file is named something like zzpluralzalpha.pth in order to ensure ours sorts lexicographically after pytest.pth. Patches welcome, but I won't overly encourage this.

amcgregor avatar Dec 05 '15 02:12 amcgregor

Is this „patches welcome” or „closed/nope”? Reopen if you want patches.

ionelmc avatar Dec 05 '15 12:12 ionelmc

This is "patches welcome" but not "help wanted". I'm not going to encourage this kind of terribly fragile feature, but there's not much I can do to stop someone from writing it and submitting a pull request. (Pull requests are their own tickets.)

amcgregor avatar Dec 05 '15 20:12 amcgregor