diff --git a/leapc-cffi/MANIFEST.in b/leapc-cffi/MANIFEST.in index 4a57d7e..ed3c3b1 100644 --- a/leapc-cffi/MANIFEST.in +++ b/leapc-cffi/MANIFEST.in @@ -1,2 +1,2 @@ -include src/leapc_cffi/* -include src/scripts/* +include cffi_build.py +include src/leapc_cffi/LeapC.dll \ No newline at end of file diff --git a/leapc-cffi/src/scripts/cffi_build.py b/leapc-cffi/cffi_build.py similarity index 93% rename from leapc-cffi/src/scripts/cffi_build.py rename to leapc-cffi/cffi_build.py index 289d69d..25a01e8 100644 --- a/leapc-cffi/src/scripts/cffi_build.py +++ b/leapc-cffi/cffi_build.py @@ -12,7 +12,7 @@ _HERE = os.path.abspath(os.path.dirname(__file__)) # The resource directory needs to contain the LeapC headers and libraries -_RESOURCE_DIRECTORY = os.path.join(_HERE, "..", "leapc_cffi") +_RESOURCE_DIRECTORY = os.path.join(_HERE, "src/leapc_cffi") def sanitise_leapc_header(input_str): @@ -82,10 +82,6 @@ def sanitise_leapc_header(input_str): ffibuilder = FFI() ffibuilder.cdef(cffi_cdef, packed=True) -cffi_src_fpath = os.path.join(os.path.dirname(__file__), "cffi_src.h") -with open(cffi_src_fpath) as fp: - cffi_src = fp.read() - extra_link_args = { "Windows": [], "Linux": ["-Wl,-rpath=$ORIGIN"], @@ -96,7 +92,7 @@ def sanitise_leapc_header(input_str): ffibuilder.set_source( "_leapc_cffi", - cffi_src, + "#include ", libraries=os_libraries[platform.system()], include_dirs=[_RESOURCE_DIRECTORY], library_dirs=[_RESOURCE_DIRECTORY], diff --git a/leapc-cffi/pyproject.toml b/leapc-cffi/pyproject.toml new file mode 100644 index 0000000..ce1558d --- /dev/null +++ b/leapc-cffi/pyproject.toml @@ -0,0 +1,24 @@ +[build-system] +requires = ["setuptools >= 48.0", "cffi", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "leapc_cffi" +version = "0.0.1" +requires-python = ">= 3.8" +authors = [{name = "Ultraleap", email = "hello@ultraleap.com"}] +description = "Python CFFI bindings for LeapC" +readme = "README.md" +license = {text = "Apache-2.0"} +keywords = ["leapc", "leap", "ultraleap", "hand tracking"] + +[project.urls] +Homepage = "https://ultraleap.com" +Repository = "https://github.com/ultraleap/leapc-python-bindings.git" +Issues = "https://github.com/ultraleap/leapc-python-bindings/issues" + +[tool.setuptools.exclude-package-data] +"*" = ["*.h", "*.lib"] + +[tool.cibuildwheel] +archs = ["auto64"] \ No newline at end of file diff --git a/leapc-cffi/setup.py b/leapc-cffi/setup.py index d84ff61..399f5f4 100644 --- a/leapc-cffi/setup.py +++ b/leapc-cffi/setup.py @@ -153,22 +153,10 @@ def gather_leap_sdk(): gather_leap_sdk() -setuptools.setup( - name="leapc_cffi", - version="0.0.1", - author="Ultraleap", - description="Python CFFI bindings for LeapC", - long_description=long_description, - long_description_content_type="text/markdown", - package_dir={"": "src"}, - packages=setuptools.find_packages(where="src"), - include_package_data=True, - exclude_package_data={ - "": ["*.h", "*.lib", "scripts/*"] - }, # Excluded from the installed package - python_requires=">=3.8", - setup_requires=["cffi"], - install_requires=["cffi"], - ext_package="leapc_cffi", # The location that the CFFI module will be built - cffi_modules=["src/scripts/cffi_build.py:ffibuilder"], -) +if __name__ == "__main__": + setuptools.setup( + #CFFI + package_dir={"": "src"}, + ext_package="leapc_cffi", # The location that the CFFI module will be built + cffi_modules=["cffi_build.py:ffibuilder"], + ) diff --git a/leapc-cffi/src/scripts/cffi_src.h b/leapc-cffi/src/scripts/cffi_src.h deleted file mode 100644 index d4d3668..0000000 --- a/leapc-cffi/src/scripts/cffi_src.h +++ /dev/null @@ -1 +0,0 @@ -#include "LeapC.h" diff --git a/leapc-python-api/MANIFEST.in b/leapc-python-api/MANIFEST.in deleted file mode 100644 index 3302cfc..0000000 --- a/leapc-python-api/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include src/leap/leapc/* diff --git a/leapc-python-api/pyproject.toml b/leapc-python-api/pyproject.toml new file mode 100644 index 0000000..73e293e --- /dev/null +++ b/leapc-python-api/pyproject.toml @@ -0,0 +1,19 @@ +[build-system] +requires = ["setuptools >= 48.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "leap" +version = "0.0.1" +dependencies = ["leapc-cffi @ git+https://github.com/ultraleap/leapc-python-bindings.git/#subdirectory=leapc-cffi"] +requires-python = ">= 3.8" +authors = [{name = "Ultraleap", email = "hello@ultraleap.com"}] +description = "Python wrappers around LeapC bindings" +readme = "README.md" +license = {text = "Apache-2.0"} +keywords = ["leapc", "leap", "ultraleap", "hand tracking"] + +[project.urls] +Homepage = "https://ultraleap.com" +Repository = "https://github.com/ultraleap/leapc-python-bindings.git" +Issues = "https://github.com/ultraleap/leapc-python-bindings/issues" \ No newline at end of file diff --git a/leapc-python-api/setup.py b/leapc-python-api/setup.py deleted file mode 100644 index 2e9fce1..0000000 --- a/leapc-python-api/setup.py +++ /dev/null @@ -1,19 +0,0 @@ -import os -import setuptools - -_HERE = os.path.abspath(os.path.dirname(__file__)) - -with open(os.path.join(_HERE, "README.md"), "r", encoding="utf-8") as fh: - long_description = fh.read() - -setuptools.setup( - name="leap", - version="0.0.1", - author="Ultraleap", - description="Python wrappers around LeapC bindings", - long_description=long_description, - long_description_content_type="text/markdown", - package_dir={"": "src"}, - packages=setuptools.find_packages(where="src"), - python_requires=">=3.8", -)