Skip to content

Commit

Permalink
Exclude .c files from wheel builds (#589)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Oct 18, 2023
1 parent f31b250 commit 55677be
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include LICENSE
include requirements.txt
include aioesphomeapi/py.typed
global-exclude *.c
18 changes: 11 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,17 @@

DOWNLOAD_URL = "{}/archive/{}.zip".format(GITHUB_URL, VERSION)

MODULES_TO_CYTHONIZE = [
"aioesphomeapi/connection.py",
"aioesphomeapi/_frame_helper/plain_text.py",
"aioesphomeapi/_frame_helper/noise.py",
"aioesphomeapi/_frame_helper/base.py",
]

with open(os.path.join(here, "requirements.txt")) as requirements_txt:
REQUIRES = requirements_txt.read().splitlines()

pkgs = find_packages(exclude=["tests", "tests.*"])

setup_kwargs = {
"name": PROJECT_PACKAGE_NAME,
Expand All @@ -45,7 +53,8 @@
"description": "Python API for interacting with ESPHome devices.",
"long_description": long_description,
"license": PROJECT_LICENSE,
"packages": find_packages(exclude=["tests", "tests.*"]),
"packages": pkgs,
"exclude_package_data": {pkg: ["*.c"] for pkg in pkgs},
"include_package_data": True,
"zip_safe": False,
"install_requires": REQUIRES,
Expand All @@ -71,12 +80,7 @@ def cythonize_if_available(setup_kwargs):
setup_kwargs.update(
dict(
ext_modules=cythonize(
[
"aioesphomeapi/connection.py",
"aioesphomeapi/_frame_helper/plain_text.py",
"aioesphomeapi/_frame_helper/noise.py",
"aioesphomeapi/_frame_helper/base.py",
],
MODULES_TO_CYTHONIZE,
compiler_directives={"language_level": "3"}, # Python 3
),
cmdclass=dict(build_ext=OptionalBuildExt),
Expand Down

0 comments on commit 55677be

Please sign in to comment.