Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
67 lines (62 loc) · 2.52 KB
/
Copy pathsetup.py
File metadata and controls
67 lines (62 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
from setuptools import setup
from setuptools_rust import Binding, RustExtension
import atexit
import shutil
import toml
import re
import os
_created_workspace = False
if not os.path.exists("rust-workspace"):
_created_workspace = True
shutil.copytree(
"../..",
"rust-workspace",
ignore = shutil.ignore_patterns(".cached", "target", ".git", "issue-*", "ci", "assets", ".github", "py")
)
atexit.register(lambda: shutil.rmtree("rust-workspace", ignore_errors=True))
version = os.environ.get("PYPI_VERSION_OVERRIDE")
if version is None or version == "":
version = toml.load("rust-workspace/api/Cargo.toml")["package"]["version"]
version = re.sub("\-alpha\.", "a", version)
version = re.sub("\\-dev(\\.)?", ".dev", version)
with open('docs/index.md', 'r') as file:
readme = file.read()
build_requires = toml.load("pyproject.toml")["build-system"]["requires"]
setup(
name="tract",
author="Mathieu Poumeyrol, Sonos, and tract contributors",
author_email="mathieu@poumeyrol.fr",
keywords="onnx tensorflow nnef runtime neural network",
version=version,
description="Python bindings for tract, a neural network inference engine",
project_urls={
"Documentation": "https://sonos.github.io/tract",
"Source": "https://github.com/sonos/tract",
},
license="(Apache-2.0 OR MIT)",
long_description=readme,
long_description_content_type="text/markdown",
options={"bdist_wheel": {"universal": True}},
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Rust",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"License :: OSI Approved :: Apache Software License",
"License :: OSI Approved :: MIT License"
],
rust_extensions=[RustExtension("tract.tract", binding=Binding.NoBinding, path="rust-workspace/api/ffi/Cargo.toml")],
packages=["tract"],
zip_safe=False,
python_requires=">=3.9",
install_requires=[ "numpy" ],
extras_require={
"test": ["pytest"],
"dev": build_requires + ["pytest"],
},
)