Skip to content

Commit

Permalink
Merge pull request #67 from LemurPwned/hotfix/submodules
Browse files Browse the repository at this point in the history
another take at stubs
  • Loading branch information
LemurPwned committed May 8, 2024
2 parents 6413cc9 + 18f66b6 commit 110e373
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import contextlib
import os
import sys
from pathlib import Path

import setuptools
from setuptools import Extension, find_namespace_packages, setup
from setuptools.command.build_ext import build_ext

__version__ = "1.5.1"
__version__ = "1.5.2"
"""
As per
https://github.com/pybind/python_example
Expand Down Expand Up @@ -128,6 +128,10 @@ def build_extensions(self):
build_ext.build_extensions(self)


def find_stubs(path: Path):
return [str(pyi.relative_to(path)) for pyi in path.rglob("*.pyi")]


setup(
name="cmtj",
version=__version__,
Expand All @@ -140,18 +144,7 @@ def build_extensions(self):
include_package_data=True,
namespace_packages=["cmtj"],
packages=find_namespace_packages(include=["cmtj.*"]),
package_data={"cmtj": ["py.typed", "*.pyi"]},
data_files=[
("shared/typehints/python{}.{}/cmtj").format(
*sys.version_info[:2], "cmtj/__init__.pyi"
),
("shared/typehints/python{}.{}/cmtj/stack").format(
*sys.version_info[:2], "cmtj/stack/__init__.pyi"
),
("shared/typehints/python{}.{}/cmtj/noise").format(
*sys.version_info[:2], "cmtj/noise/__init__.pyi"
),
],
package_data={"cmtj": [*find_stubs(path=Path("cmtj"))]},
setup_requires=["pybind11>=2.6.1"],
cmdclass={"build_ext": BuildExt},
zip_safe=False,
Expand Down

0 comments on commit 110e373

Please sign in to comment.