From 1a7acf0eebd39e3236368bd28f155f7834d3c304 Mon Sep 17 00:00:00 2001 From: Thaddeus Crews Date: Sun, 26 May 2024 12:11:04 -0500 Subject: [PATCH] Migrate `setup.cfg` logic to `pyproject.toml` --- CHANGES.txt | 1 + RELEASE.txt | 3 +- SConstruct | 4 +-- pyproject.toml | 69 ++++++++++++++++++++++++++++++++++++++++-- setup.cfg | 81 -------------------------------------------------- 5 files changed, 71 insertions(+), 87 deletions(-) delete mode 100644 setup.cfg diff --git a/CHANGES.txt b/CHANGES.txt index 3fe676ab14..cbcb821b7b 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -12,6 +12,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER From Thaddeus Crews: - GetSConsVersion() to grab the latest SCons version without needing to access SCons internals. + - Migrate setup.cfg logic to pyproject.toml; remove setup.cfg. From Raymond Li: - Fix issue #3935: OSErrors are now no longer hidden during execution of diff --git a/RELEASE.txt b/RELEASE.txt index 92e31ab72d..a8d121ef36 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -63,7 +63,8 @@ IMPROVEMENTS PACKAGING --------- -- List changes in the way SCons is packaged and/or released +- setup.cfg logic now handled via pyproject.toml; consequently, setup.cfg + was removed. DOCUMENTATION diff --git a/SConstruct b/SConstruct index 41b1d355be..04bde62850 100644 --- a/SConstruct +++ b/SConstruct @@ -205,7 +205,7 @@ wheel = env.Command( '$DISTDIR/SCons-${VERSION}-py3-none-any.whl', '$DISTDIR/SCons-${VERSION}.tar.gz', ], - source=['setup.cfg', 'setup.py', 'SCons/__init__.py'] + man_pages, + source=['pyproject.toml', 'setup.py', 'SCons/__init__.py'] + man_pages, action='$PYTHON -m build --outdir $DISTDIR', ) env.Alias("wheel", wheel[0]) @@ -215,7 +215,7 @@ env.Alias("tar-gz", wheel[1]) # and it deletes its isolated env so we can't just zip that one up. zip_file = env.Command( target='$DISTDIR/SCons-${VERSION}.zip', - source=['setup.cfg', 'setup.py', 'SCons/__init__.py'] + man_pages, + source=['pyproject.toml', 'setup.py', 'SCons/__init__.py'] + man_pages, action='$PYTHON setup.py sdist --format=zip', ) env.Alias("zip", zip_file) diff --git a/pyproject.toml b/pyproject.toml index 548ae2d65a..8d755dcb2b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,12 +2,75 @@ build-backend = "setuptools.build_meta" requires = ["setuptools"] +[project] +name = "SCons" +description = "Open Source next-generation build tool." +requires-python = ">=3.6" +license = { text = "MIT" } +readme = { file = "README-package.rst", content-type = "text/x-rst" } +authors = [{ name = "William Deegan", email = "bill@baddogconsulting.com" }] +dynamic = ["version"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Topic :: Software Development :: Build Tools", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.6", + "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", + "Environment :: Console", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: POSIX :: Linux", + "Operating System :: Unix", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", +] + +[project.urls] +Homepage = "https://www.scons.org/" +Documentation = "https://scons.org/documentation.html" +Twitter = "https://twitter.com/SConsProject" +GitHub = "https://github.com/SCons/scons" +Bug-Tracker = "https://github.com/SCons/scons/issues" +Discord = "https://discord.gg/pejaFYrD9n" +"Mailing lists" = "https://scons.org/lists.html" + +[project.scripts] +scons = "SCons.Script.Main:main" +sconsign = "SCons.Utilities.sconsign:main" +scons-configure-cache = "SCons.Utilities.ConfigureCache:main" + +[tool.setuptools] +zip-safe = false +include-package-data = true +license-files = ["LICENSE"] + +[tool.setuptools.packages.find] +exclude = ["template"] +namespaces = false + +[tool.setuptools.package-data] +"*" = ["*.txt", "*.rst", "*.1"] +"scons.tool.docbook" = ["*.*"] + +[tool.distutils.sdist] +dist-dir = "build/dist" + +[tool.distutils.bdist_wheel] +dist-dir = "build/dist" + # for black and mypy, set the lowest Python version supported [tool.black] quiet = true target-version = ['py36'] skip-string-normalization = true -[mypy] -python_version = 3.6 - +[tool.mypy] +python_version = "3.6" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 7c6af765cb..0000000000 --- a/setup.cfg +++ /dev/null @@ -1,81 +0,0 @@ -[metadata] -name = SCons -license = MIT -author = William Deegan -author_email =bill@baddogconsulting.com -long_description = file: README-package.rst -long_description_content_type = text/x-rst -description = Open Source next-generation build tool. -group = Development/Tools -license_file = LICENSE - - -url = https://www.scons.org/ -project_urls = - Documentation = https://scons.org/documentation.html - Twitter = https://twitter.com/SConsProject - GitHub = https://github.com/SCons/scons - Bug-Tracker = https://github.com/SCons/scons/issues - Discord = https://discord.gg/pejaFYrD9n - Mailing lists = https://scons.org/lists.html - - -classifiers = - Development Status :: 5 - Production/Stable - Topic :: Software Development :: Build Tools - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 - 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 - Environment :: Console - Intended Audience :: Developers - License :: OSI Approved :: MIT License - Operating System :: POSIX :: Linux - Operating System :: Unix - Operating System :: MacOS - Operating System :: Microsoft :: Windows - - -[options] -zip_safe = False -python_requires = >=3.6 -include_package_data = True -packages = find: - - -[options.packages.find] -;include=SCons.* -exclude=template - -[options.entry_points] -console_scripts = - scons = SCons.Script.Main:main - sconsign = SCons.Utilities.sconsign:main - scons-configure-cache = SCons.Utilities.ConfigureCache:main - - -[options.package_data] -* = *.txt, *.rst, *.1 -SCons.Tool.docbook = *.* - - -[options.data_files] -. = scons.1 - scons-time.1 - sconsign.1 - -[sdist] -dist_dir=build/dist - -[bdist_wheel] - ; We're now py3 only -;universal=true -dist_dir=build/dist -