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

export type annotations in package #679

Merged
merged 3 commits into from
Jan 25, 2022

Conversation

0xabu
Copy link
Contributor

@0xabu 0xabu commented Oct 12, 2021

This PR adds a py.typed marker file to our package, which is necessary for tools such as mypy to discover pdfminer's new type annotations when it is installed via pypi.

This fixes mypy errors such as the following in downstream tools:

error: Skipping analyzing "pdfminer.layout": found module but no type hints or library stubs

References:
https://www.python.org/dev/peps/pep-0561/#packaging-type-information
https://mypy.readthedocs.io/en/stable/installed_packages.html#creating-pep-561-compatible-packages

How Has This Been Tested?
I built a wheel, installed it locally, and verified that mypy no longer issues the errors that it does with the 20211012 release.

@0xabu
Copy link
Contributor Author

0xabu commented Oct 12, 2021

Sorry about this. Only after I tried to use the new release in my own tool did I discover this was necessary :(

@0xabu 0xabu marked this pull request as ready for review October 12, 2021 20:50
0xabu added a commit to 0xabu/pdfannots that referenced this pull request Oct 12, 2021
@pietermarsman
Copy link
Member

Sorry about this.

No worries!

Thanks for adding these great features to pdfminer.six!

@pietermarsman pietermarsman merged commit 9a644aa into pdfminer:develop Jan 25, 2022
@0xabu 0xabu deleted the export-types-to-pypi branch January 25, 2022 21:12
Beants added a commit to HiTalentAlgorithms/pdfminer.six that referenced this pull request Feb 14, 2022
* develop:
  Check blackness in github actions (pdfminer#711)
  Changed `log.info` to  `log.debug` in six files (pdfminer#690)
  Update README.md batch for Continuous integration
  Update actions.yml so that it will run for all PR's
  Update development tools: travis ci to github actions, tox to nox, nose to pytest (pdfminer#704)
  Added feature: page labels (pdfminer#680)
  Remove obsolete returns (pdfminer#707)
  Revert "Remove obsolete returns"
  Remove obsolete returns
  Only use xref fallback if `PDFNoValidXRef` is raised and `fallback` is True (pdfminer#684)
  Use logger.warn instead of warnings.warn if warning cannot be prevented by user (pdfminer#673)
  Change log.info into log.debug to make pdfinterp.py less verbose
  Fix regression in page layout that sometimes returned text lines out of order (pdfminer#659)
  export type annotations in package (pdfminer#679)
  fix typos in PR template (pdfminer#681)
  pdf2txt: clean up construction of LAParams from arguments (pdfminer#682)
  Fixes jbig2 writer to write valid jb2 files
  Add support for JPEG2000 image encoding
  Added test case for CCITTFaxDecoder (pdfminer#700)
  Attempt to handle decompression error on some broken PDF files (pdfminer#637)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants