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

fix: py.typed module ignored when building package #317

Conversation

maximeflya
Copy link

@maximeflya maximeflya commented Jun 3, 2024

fixes #316

Moved from a single module to a package in order for the py.typed file to be included

I tested building the package using python 3.8 and installed it. Mypy was able to read the package's types and it works without any code changes.

I manually checked that the py.typed file was stored in the wheel and in the tar.gz package

I ran pytest in python 3.8 and everything passed

@maximeflya maximeflya changed the title fix fix: py.typed module ignored when building package Jun 3, 2024
schema/__init__.py Outdated Show resolved Hide resolved
@maximeflya maximeflya marked this pull request as ready for review June 3, 2024 13:55
import sys

from setuptools import setup

version_file = "schema.py"
version_file = os.path.join("schema", "__init__.py")
Copy link
Author

Choose a reason for hiding this comment

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

I would prefer using pathlib but for backwards compatibility, os might be better

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yeah, agreed, especially since it's not much code wasted anyway.

.gitignore Show resolved Hide resolved
@skorokithakis
Copy link
Collaborator

Looks good, thanks! Can you please also fix the precommit errors?

@maximeflya maximeflya force-pushed the fix/update-package-to-include-pytyped-file branch from ce00744 to f1e42a8 Compare June 4, 2024 09:43
@maximeflya
Copy link
Author

The workflow run did not contain the pyproject.toml file that defines the 120 character line length

@skorokithakis
Copy link
Collaborator

Since the linter changed a bunch of things, I'd like to run it myself to verify the changes. I'll hopefully get to it in the next few days, and then merge, thank you!

@skorokithakis
Copy link
Collaborator

Merged #319 instead.

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.

py.typed missing in package
2 participants