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

feat: add PEP 561 compliance (typing in installed package) #215

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

ArturLange
Copy link
Contributor

Description

Right now for packages which use openfoodfacts python package mypy complains about missing typing:

app/tasks.py:4: error: Skipping analyzing "openfoodfacts": module is installed, but missing library stubs or py.typed marker  [import-untyped]

Solution

In order for typing to work we need to mark package with py.typed file to comply with PEP 561 and let mypy and other tools know that typing should work with that package.
See https://mypy.readthedocs.io/en/stable/installed_packages.html#using-installed-packages-with-mypy-pep-561

@ArturLange ArturLange requested a review from a team as a code owner February 23, 2024 08:30
Copy link

sonarcloud bot commented Feb 23, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ArturLange !

@alexgarel alexgarel merged commit ca7fc41 into openfoodfacts:develop Mar 1, 2024
7 checks passed
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