From 587cd8e79489a431ec28ebec6538887d1bf5091c Mon Sep 17 00:00:00 2001 From: Maksim Zayats Date: Mon, 15 Jun 2026 17:10:11 +0100 Subject: [PATCH] build: introduce pyproject build system --- Makefile | 2 +- constructor_io/__init__.py | 2 +- constructor_io/_version.py | 2 ++ pyproject.toml | 27 +++++++++++++++++++++++++++ pytest.ini | 1 - setup.py | 25 ------------------------- 6 files changed, 31 insertions(+), 28 deletions(-) create mode 100644 constructor_io/_version.py create mode 100644 pyproject.toml delete mode 100644 setup.py diff --git a/Makefile b/Makefile index 7cd57d7..36dc1a9 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ install: Makefile pipenv run pre-commit install --hook-type pre-commit --hook-type pre-push build: Makefile - pipenv run python setup.py sdist + uv build --sdist --wheel --out-dir dist publish: Makefile twine upload dist/* diff --git a/constructor_io/__init__.py b/constructor_io/__init__.py index d7378e2..14e8ebe 100644 --- a/constructor_io/__init__.py +++ b/constructor_io/__init__.py @@ -1,2 +1,2 @@ '''Version File''' -__version__ = "1.9.1" +from constructor_io._version import __version__ diff --git a/constructor_io/_version.py b/constructor_io/_version.py new file mode 100644 index 0000000..d7378e2 --- /dev/null +++ b/constructor_io/_version.py @@ -0,0 +1,2 @@ +'''Version File''' +__version__ = "1.9.1" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..87b0aad --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,27 @@ +[build-system] +requires = ["setuptools>=77.0.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "constructor-io" +dynamic = ["version"] +description = "Constructor.io Python Client" +readme = {file = "README.md", content-type = "text/markdown"} +license = "MIT" +authors = [ + {name = "Constructor.io Corporation", email = "info@constructor.io"}, +] +dependencies = [ + "requests~=2.26", +] + +[project.urls] +Homepage = "https://www.constructor.io" + +[tool.setuptools.packages.find] +include = ["constructor_io", "constructor_io.*"] +exclude = ["tests", "tests.*"] +namespaces = false + +[tool.setuptools.dynamic] +version = {attr = "constructor_io._version.__version__"} diff --git a/pytest.ini b/pytest.ini index fe882dc..f25fd4e 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,7 +1,6 @@ [pytest] addopts = --doctest-modules - --ignore setup.py --cov-report=term --cov-report=html:coverage/ --cov=constructor_io diff --git a/setup.py b/setup.py deleted file mode 100644 index feb2514..0000000 --- a/setup.py +++ /dev/null @@ -1,25 +0,0 @@ -from pathlib import Path - -from setuptools import find_packages, setup - -from constructor_io import __version__ - -this_directory = Path(__file__).parent -long_description = (this_directory / "README.md").read_text() - -setup( - name="constructor-io", - version=__version__, - download_url='https://github.com/Constructor-io/constructor-io/tarball/' + __version__, - license="MIT", - description="Constructor.io Python Client", - author="Constructor.io Corporation", - author_email="info@constructor.io", - url="https://www.constructor.io", - install_requires=[ - 'requests~=2.26' - ], - packages = find_packages(exclude=["tests.*", "tests"]), - long_description=long_description, - long_description_content_type='text/markdown', -)