Skip to content

Commit ce943e1

Browse files
committed
ENG-9025 migrate to pyproject.toml
1 parent 2ccf569 commit ce943e1

File tree

2 files changed

+31
-26
lines changed

2 files changed

+31
-26
lines changed

pyproject.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "smsdk"
7+
authors = [
8+
{name = "Sight Machine", email = "[email protected]"}
9+
]
10+
description = "Sight Machine SDK"
11+
requires-python = ">=3.8"
12+
dynamic = ["version", "dependencies", "readme"]
13+
14+
[project.urls]
15+
Homepage = "http://sightmachine.com/"
16+
17+
[tool.setuptools]
18+
include-package-data = true
19+
20+
[tool.setuptools.dynamic]
21+
version = {attr = "smsdk._version.version"}
22+
readme = {file = ["README.md"]}
23+
dependencies = {file = ["requirements.txt"]}
24+
25+
[tool.setuptools.packages.find]
26+
where = ["."]
27+
exclude = ["test*"]

setup.py

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,5 @@
1-
from setuptools import setup, find_packages
2-
from smsdk._version import version
1+
# retaining a minimal setup.py, but all configuration is in pyproject.toml
2+
# https://packaging.python.org/en/latest/guides/modernize-setup-py-project/#what-if-something-that-can-not-be-changed-expects-a-setup-py-file
3+
from setuptools import setup
34

4-
with open("README.md", "r") as fh:
5-
long_description = fh.read()
6-
7-
with open("requirements.txt", "r") as fh:
8-
install_requires = [
9-
line
10-
for line in (item.strip() for item in fh)
11-
if line and line[:1] not in ("#", "-")
12-
]
13-
14-
setup(
15-
name="smsdk",
16-
version=version,
17-
packages=find_packages(exclude=["test*"]),
18-
include_package_data=True,
19-
install_requires=install_requires,
20-
license="",
21-
long_description=long_description,
22-
author="Sight Machine",
23-
author_email="[email protected]",
24-
url="http://sightmachine.com/",
25-
description="Sight Machine SDK",
26-
python_requires=">=3.8",
27-
)
5+
setup()

0 commit comments

Comments
 (0)