-
Notifications
You must be signed in to change notification settings - Fork 11
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
mypy error: Skipping analyzing "crc": [...] missing library stubs or py.typed marker #110
Comments
Hi @gertvdijk, first of all, thanks for creating the issue, it's a perfect summary of the problem. 👍 The TL;DR from my point of view is:
That said, since then quite some time passed and I had some time to think about this issue. Actually I already where considering implementing it, but did not find the time yet. Therefore if you want to provide a best |
Cool. Two questions for you. On the restructuring, I think we have two options:
Both options keep it single-file in some definitions of it. Users who depend on downloading a Any preference? Anyway, I have zero experience with Poetry when it comes to packaging, so it's a little less straightforward for me, but I think I will manage. I have some thoughts about some of the type annotations too, might as well address those. Spotted some unnecessary Since the module requires Python 3.8, I am planning to refactor it into using built-in type annotations (available since 3.7 with WIP here with some other edits too - view commit by commit, WDYT? |
@gertvdijk I am currently on a trip, it's likely I won't be able to give you feedback/responses until next week. |
Hi @gertvdijk, I personally would tend to go for option 2.
Also marking the crc module as non public ℹ️ If you need any help with Regarding
Sure go for it 👍 . Regarding the change-set (WIP) Looks good to me. Only small nit pick I have, is that I would prefer naming: |
This moves away from a single-file/module package with the main purpose of the ability to add a py.typed marker in the package [PEP 561]. As per discussion in Nicoretti#110, this also converts the 'crc' module into a private module with only specific public entities being 'exported' in the package's __init__.py. This change should not affect typical use case of dependent projects where the crc package is installed and used confirming the documentation. For running the tests it may now be required to install the package in the virtualenv using `poetry install`. References: Nicoretti#110 [PEP 561]: https://peps.python.org/pep-0561/#packaging-type-information
This moves away from a single-file/module package with the main purpose of the ability to add a py.typed marker in the package [PEP 561]. As per discussion in Nicoretti#110, this also converts the 'crc' module into a private module with only specific public entities being 'exported' in the package's __init__.py. This change should not affect typical use case of dependent projects where the crc package is installed and used confirming the documentation. For running the tests it may now be required to install the package in the virtualenv using `poetry install`. References: Nicoretti#110 [PEP 561]: https://peps.python.org/pep-0561/#packaging-type-information
Hi @Nicoretti! Thanks for the answers. I have spent some time on moving things in the right direction, I think; see the updated branch. Open points:
(If you're interested, I could file a change to drop all of the linters - except Black - and replace them with Ruff.) Anyway, please have a look and let me know what you think. 😃 |
Hi @gertvdijk, First up: imho looks great 👍 . Regarding Your Open Points1.
|
This moves away from a single-file/module package with the main purpose of the ability to add a py.typed marker in the package [PEP 561]. As per discussion in Nicoretti#110, this also converts the 'crc' module into a private module with only specific public entities being 'exported' in the package's __init__.py. This change should not affect typical use case of dependent projects where the crc package is installed and used confirming the documentation. For running the tests it may now be required to install the package in the virtualenv using `poetry install`. References: Nicoretti#110 [PEP 561]: https://peps.python.org/pep-0561/#packaging-type-information
This moves away from a single-file/module package with the main purpose of the ability to add a py.typed marker in the package [PEP 561]. As per discussion in Nicoretti#110, this also converts the 'crc' module into a private module with only specific public entities being 'exported' in the package's __init__.py. This change should not affect typical use case of dependent projects where the crc package is installed and used confirming the documentation. For running the tests it may now be required to install the package in the virtualenv using `poetry install`. References: Nicoretti#110 [PEP 561]: https://peps.python.org/pep-0561/#packaging-type-information
Fixes Nicoretti#110 From [PEP 561]: > Package maintainers who wish to support type checking of their code MUST > add a marker file named py.typed to their package supporting typing. [PEP 561]: https://peps.python.org/pep-0561/#packaging-type-information
Alright, cool, I've created a PR with some more changes to docs and things like a Feel free to add a hacktoberfest marker if you want (I have no idea how to do that anyway 😄). LMK what you think; I may have missed things, I'm very much open for remarks/review comments. |
Honestly very nice and clean PR ❤️ , I even learned a few things I haven't been aware of yet 😅. |
This moves away from a single-file/module package with the main purpose of the ability to add a py.typed marker in the package [PEP 561]. As per discussion in Nicoretti#110, this also converts the 'crc' module into a private module with only specific public entities being 'exported' in the package's __init__.py. This change should not affect typical use case of dependent projects where the crc package is installed and used confirming the documentation. For running the tests it may now be required to install the package in the virtualenv using `poetry install`. References: Nicoretti#110 [PEP 561]: https://peps.python.org/pep-0561/#packaging-type-information
Fixes Nicoretti#110 From [PEP 561]: > Package maintainers who wish to support type checking of their code MUST > add a marker file named py.typed to their package supporting typing. [PEP 561]: https://peps.python.org/pep-0561/#packaging-type-information
This moves away from a single-file/module package with the main purpose of the ability to add a py.typed marker in the package [PEP 561]. As per discussion in #110, this also converts the 'crc' module into a private module with only specific public entities being 'exported' in the package's __init__.py. This change should not affect typical use case of dependent projects where the crc package is installed and used confirming the documentation. For running the tests it may now be required to install the package in the virtualenv using `poetry install`. References: #110 [PEP 561]: https://peps.python.org/pep-0561/#packaging-type-information
Fixes #110 From [PEP 561]: > Package maintainers who wish to support type checking of their code MUST > add a marker file named py.typed to their package supporting typing. [PEP 561]: https://peps.python.org/pep-0561/#packaging-type-information
Thanks for having type annotation in your package! However, I can't use it with type checkers in my own code, because
crc
is missing apy.typed
marker file. Please see PEP 561 for more information.This leads to errors in downstream projects using type checkers like mypy:
Looking at your source code package...:
... I understand your current distribution is single-file/module-only, but it seems that PEP requires a refactor into a package structure.
Let me know if you need some help with that; I'm happy to provide a PR.
The text was updated successfully, but these errors were encountered: