-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
PyPDF2 2.3.0 from PyPi cannot be imported, missing _codecs directory #1011
Comments
Oh, damn ... give me 10 minutes; I think I know what happened. |
I've forgot to add the package. |
@MartinThoma thanks for the superfast fix! From this issue I understand the release of PyPDF2 is NOT automated and is therefore prone to this kind of human mistakes? Also the release process does neither involve testing the produced artifact to be published? Is there any roadmap/issue for discussing/tracking the automation of the release process? Should I open an issue? Is help wanted/needed for this? |
Correct
Wrong. That would have happened with an automated release as well.
That is correct. Any suggestions on how to do this (in an automated way) are welcome. I could imagine:
That would have prevented this issue... I guess I could add this to my makefile 🤔
No
Sounds like a good idea 👍
Yes, that would be nice :-) I don't want to put my PyPI credentials on Github, though. I think the best option would be to adjust the github test workflow. Instead of running the tests with the local installation, they should run with an installation after installing PyPI. I think the overhead should not be big and I'd rather have longer test runs than such mistakes. |
@n1ngu In case you're curious, this was the issue: 6b9f472#diff-fa602a8a75dc9dcc92261bac5f533c2a85e34fcceaff63b3a3a81d9acde2fc52 (in setup.cfg). We don't have changes there often/regularly, hence it's unlikely that this will happen soon again. Also it's super obvious to detect in most cases and trivial to fix. For this reason it's not high priority for me. But I'd like to approach this :-) (not necessarily by myself - a PR is welcome 😄 ) |
I tried installing https://pypi.org/project/pdfCropMargins/ which depends on PyPDF2. It reports an incorrect error:
I think the problem is that #1005 introduced files in a
_codecs
directory, but the packaging script fails to package subdirectory contents into the .tar.gz and .whl published to PyPI (https://pypi.org/project/PyPDF2/2.3.0/).Another compounding problem is that pdfCropMargins misinterprets the nested ImportError as a direct ImportError from missing PyPDF2, and prints the misleading error that PyPDF2 is missing. I think this is a language flaw of Python's automatic exception propagation, but we're not here to remove exceptions from Python.
Solution: If I understand the problem correctly, you need to properly package the
_codecs
subdirectory and make a 2.3.1 release.Environment
Which environment were you using when you encountered the problem?
Code
This is a minimal, complete example that shows the issue:
The text was updated successfully, but these errors were encountered: