pyxl4 icon indicating copy to clipboard operation
pyxl4 copied to clipboard

Cannot use pyxl encoding after installing with --editable

Open adamserafini opened this issue 8 years ago • 1 comments

For the use case of a contributor who is going to code on pyxl itself. The tests run fine when run with pytest, but a file filename.pywith pyxl encoding run normally eg. with python3 filename.py fails with the cryptic SyntaxError: encoding problem: pyxl. When installing without --editable, everything works normally.

  • [ ] Improve the error message.
  • [ ] Figure out why it's happening and fix.

Related to this issue: when you install without the editable flag, the coverage metrics don't work when you run: py.test --cov=pyxl tests.

adamserafini avatar Nov 27 '16 13:11 adamserafini

If I understand correctly, installing with --editable ensures that it is found on the path. However, if it is found before the .pth file that register that codec is found, then the codec is unrecognize. One possible solution might be to add a usercustomize.py file to the repo that would explicitly register the codec; again, if I understand correctly, any such usercustomize.py file found on the path would be imported before any user script. See https://docs.python.org/3/library/site.html

aroberge avatar Dec 31 '19 22:12 aroberge