From 14c15d95dee2f3c708c5a93da8341b2767a108c5 Mon Sep 17 00:00:00 2001 From: Samuel FORESTIER Date: Mon, 30 Nov 2026 22:53:16 +0100 Subject: [PATCH 1/2] chore: migrates setup.cfg to pyproject.toml Closes: #390 --- .flake8 | 2 ++ pyproject.toml | 58 +++++++++++++++++++++++++++++++++++++++++++++++++- setup.cfg | 52 -------------------------------------------- 3 files changed, 59 insertions(+), 53 deletions(-) create mode 100644 .flake8 delete mode 100644 setup.cfg diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..2bcd70e --- /dev/null +++ b/.flake8 @@ -0,0 +1,2 @@ +[flake8] +max-line-length = 88 diff --git a/pyproject.toml b/pyproject.toml index 32f8696..2b8e518 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,63 @@ [build-system] -requires = ["setuptools"] +requires = ["setuptools>=77.0.3"] build-backend = "setuptools.build_meta" +[project] +name = "distro" +dynamic = ["version", "readme"] +description = "Distro - an OS platform information API" +requires-python = ">=3.7" +license = "Apache-2.0" +license-files = ["LICENSE"] +authors = [ + {name = "Nir Cohen", email = "nir36g@gmail.com"}, +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Intended Audience :: System Administrators", + "Operating System :: POSIX :: Linux", + "Operating System :: POSIX :: BSD", + "Operating System :: POSIX :: BSD :: FreeBSD", + "Operating System :: POSIX :: BSD :: NetBSD", + "Operating System :: POSIX :: BSD :: OpenBSD", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "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 :: Python :: 3.14", + "Topic :: Software Development :: Libraries :: Python Modules", + "Topic :: System :: Operating System", +] + +[project.urls] +homepage = "https://github.com/python-distro/distro" +documentation = "https://distro.readthedocs.io" +issues = "https://github.com/python-distro/distro/issues" +changelog = "https://github.com/python-distro/distro/blob/master/CHANGELOG.md" + +[project.scripts] +distro = "distro.distro:main" + +[tool.setuptools.dynamic] +version = {attr = "distro.__version__"} +readme = {file = ["README.md"]} + +[tool.setuptools.packages.find] +where = ["src"] +include = ["distro"] + +[tool.setuptools.package-data] +"*" = ["py.typed"] + +[tool.isort] +profile = "black" + [tool.pytest.ini_options] filterwarnings = [ "error", diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 69be7bb..0000000 --- a/setup.cfg +++ /dev/null @@ -1,52 +0,0 @@ -[metadata] -name = distro -version = attr: distro.__version__ -url = https://github.com/python-distro/distro -author = Nir Cohen -author_email = nir36g@gmail.com -license = Apache License, Version 2.0 -platforms = All -description= Distro - an OS platform information API -long_description = file: README.md -long_description_content_type = text/markdown -classifiers = - Development Status :: 5 - Production/Stable - Intended Audience :: Developers - Intended Audience :: System Administrators - License :: OSI Approved :: Apache Software License - Operating System :: POSIX :: Linux - Operating System :: POSIX :: BSD - Operating System :: POSIX :: BSD :: FreeBSD - Operating System :: POSIX :: BSD :: NetBSD - Operating System :: POSIX :: BSD :: OpenBSD - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - 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 :: Python :: 3.14 - Topic :: Software Development :: Libraries :: Python Modules - Topic :: System :: Operating System - -[options] -package_dir = - = src -packages = distro -python_requires = >=3.7 - -[options.package_data] -* = py.typed - -[options.entry_points] -console_scripts = - distro = distro.distro:main - -[flake8] -max-line-length = 88 - -[isort] -profile = black From b52deb4a9f1e4383526226d2bca0edc7c08d6d89 Mon Sep 17 00:00:00 2001 From: Samuel FORESTIER Date: Thu, 3 Dec 2026 00:28:05 +0100 Subject: [PATCH 2/2] chore: restores compatibility with Python 3.7 and Python 3.8 Setuptools v68.1.0 dropped support for Python 3.7, wheread v77 is required for new `license` fields format. --- pyproject.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2b8e518..a05762c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=77.0.3"] +requires = ["setuptools~=68.0.0"] build-backend = "setuptools.build_meta" [project] @@ -7,8 +7,7 @@ name = "distro" dynamic = ["version", "readme"] description = "Distro - an OS platform information API" requires-python = ">=3.7" -license = "Apache-2.0" -license-files = ["LICENSE"] +license = {text = "Apache-2.0"} authors = [ {name = "Nir Cohen", email = "nir36g@gmail.com"}, ]