From 7a805c8f8b2435c37075d15a52b7e54b2e40deee Mon Sep 17 00:00:00 2001 From: Jose Tomas Robles Hahn Date: Wed, 28 Aug 2024 18:51:13 -0400 Subject: [PATCH 1/2] chore: Replace `setup.py sdist` and `bdist_wheel` with `build` Setuptools has deprecated `python setup.py sdist` and `python setup.py bdist_wheel` in favor of `python -m build`. This commit replaces the deprecated commands with the new `python -m build` command in `Makefile`, and moves the tool's configuration from `setup.cfg` to `pyproject.toml`. See also: [How to modernize a `setup.py`` based project?](https://packaging.python.org/en/latest/guides/modernize-setup-py-project/) ([GitHub](https://github.com/pypa/packaging.python.org/blob/afb69f3d/source/guides/modernize-setup-py-project.rst)) --- Makefile | 4 ++-- pyproject.toml | 3 +++ setup.cfg | 2 -- 3 files changed, 5 insertions(+), 4 deletions(-) delete mode 100644 setup.cfg diff --git a/Makefile b/Makefile index ec5b85ec..cc9e3f57 100644 --- a/Makefile +++ b/Makefile @@ -121,8 +121,8 @@ build: ## Build Python package $(PYTHON) setup.py build dist: build ## builds source and wheel package - python setup.py sdist - python setup.py bdist_wheel + python -m build --sdist + python -m build --wheel twine check dist/* ls -l dist diff --git a/pyproject.toml b/pyproject.toml index f87346de..c6b22efc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,3 +89,6 @@ cl_sii = [ [tool.setuptools.dynamic] version = {attr = "cl_sii.__version__"} + +[tool.distutils.bdist_wheel] +universal = false diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 526aeb28..00000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[bdist_wheel] -universal = 0 From a4f75663510cee3d32f38c766c7e954707d7d934 Mon Sep 17 00:00:00 2001 From: Jose Tomas Robles Hahn Date: Wed, 28 Aug 2024 18:58:11 -0400 Subject: [PATCH 2/2] chore(deps): Install Python package `build` > A simple, correct Python build frontend. - [Web Site](https://build.pypa.io/) - [VCS Repository](https://github.com/pypa/build.git) - [Documentation](https://build.pypa.io/) - [Software Repository](https://pypi.org/project/build/) --- requirements-dev.in | 1 + requirements-dev.txt | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/requirements-dev.in b/requirements-dev.in index 3f3bb4db..4a3b3e98 100644 --- a/requirements-dev.in +++ b/requirements-dev.in @@ -5,6 +5,7 @@ -c requirements.txt black==24.8.0 +build==1.0.3 bumpversion==0.5.3 coverage==7.6.1 flake8==7.1.1 diff --git a/requirements-dev.txt b/requirements-dev.txt index f44ecc6d..fa0cd541 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -13,7 +13,9 @@ black==24.8.0 bleach==5.0.1 # via readme-renderer build==1.0.3 - # via pip-tools + # via + # -r requirements-dev.in + # pip-tools bumpversion==0.5.3 # via -r requirements-dev.in cachetools==5.5.0