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

Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,6 @@ atlassian-ide-plugin.xml
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties

# Virtual environment
skorokithakis marked this conversation as resolved.
Show resolved Hide resolved
venv/
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
include README.rst requirements.txt LICENSE-MIT *.py
include schema/py.typed
include tox.ini
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import codecs
import os
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.

with open(version_file) as f:
for line in f.read().split("\n"):
if line.startswith("__version__ ="):
Expand All @@ -22,8 +23,7 @@
license="MIT",
keywords="schema json validation",
url="https://github.com/keleshev/schema",
py_modules=["schema"],
package_data={"": ["py.typed"]}, # Include py.typed file
packages=["schema"],
include_package_data=True,
long_description=codecs.open("README.rst", "r", "utf-8").read(),
long_description_content_type="text/x-rst",
Expand Down
Loading