From 27006a59316ad355b8e45ea3fccd84d18c0b8c78 Mon Sep 17 00:00:00 2001 From: Daniel Holth Date: Sat, 20 Jul 2024 14:08:49 -0400 Subject: [PATCH 01/16] use importlib.machinery instead of imp --- enscons/cpyext.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/enscons/cpyext.py b/enscons/cpyext.py index cf5a406..d03e863 100644 --- a/enscons/cpyext.py +++ b/enscons/cpyext.py @@ -10,8 +10,8 @@ from distutils.extension import Extension from distutils.command.build_ext import build_ext -import imp import importlib +import importlib.machinery # not used when generate is passed directly to Environment def exists(env): @@ -88,7 +88,7 @@ def get_build_ext(name="zoot"): # from setuptools def get_abi3_suffix(): """Return the file extension for an abi3-compliant Extension()""" - for suffix, _, _ in (s for s in imp.get_suffixes() if s[2] == imp.C_EXTENSION): + for suffix in importlib.machinery.EXTENSION_SUFFIXES: if ".abi3" in suffix: # Unix return suffix elif suffix == ".pyd": # Windows From e0599b5ebd3df5af433629c3d12688d3846d17ec Mon Sep 17 00:00:00 2001 From: Daniel Holth Date: Sat, 20 Jul 2024 14:39:53 -0400 Subject: [PATCH 02/16] python 3.12 changes --- CHANGES | 6 ++++++ SConstruct | 3 +-- docs/conf.py | 21 ++++++++++----------- docs/index.md | 6 +++--- enscons/SConstruct.in | 2 +- enscons/__init__.py | 15 +++++---------- enscons/cli.py | 2 +- enscons/cpyext.py | 23 +++++++++++------------ enscons/pytar.py | 6 +++--- enscons/setup.py | 6 +++++- enscons/setup2toml.py | 22 +++++++++++++++------- enscons/util.py | 31 ++++++++++++++++++++++++++++++- pyproject.toml | 9 ++++----- setup.py | 8 ++++++-- 14 files changed, 101 insertions(+), 59 deletions(-) diff --git a/CHANGES b/CHANGES index 1bc3f11..9d5d99c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +0.30.0 +------ +- Support Python 3.12 with deprecated distutils, imp +- Use setuptools for enscons.cpyext +- Use tomllib (requires Python 3.11+) + 0.28.0 ------ - Update editables for approved PEP 660 diff --git a/SConstruct b/SConstruct index bafca5f..f7474d3 100644 --- a/SConstruct +++ b/SConstruct @@ -22,9 +22,8 @@ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. -import pytoml as toml +import tomllib as toml import enscons -import sys metadata = toml.load(open("pyproject.toml"))["project"] diff --git a/docs/conf.py b/docs/conf.py index b868d10..acc6e64 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -6,10 +6,10 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information -project = 'enscons' -copyright = '2023, Daniel Holth & enscons developers' -author = 'Daniel Holth & enscons developers' -release = '0.28.0' +project = "enscons" +copyright = "2023, Daniel Holth & enscons developers" +author = "Daniel Holth & enscons developers" +release = "0.30.0" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -18,17 +18,16 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'sphinx.ext.autodoc', - 'myst_parser', + "sphinx.ext.autodoc", + "myst_parser", ] -templates_path = ['_templates'] -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] - +templates_path = ["_templates"] +exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output -html_theme = 'furo' -html_static_path = ['_static'] +html_theme = "furo" +html_static_path = ["_static"] diff --git a/docs/index.md b/docs/index.md index 2de00da..a066e27 100644 --- a/docs/index.md +++ b/docs/index.md @@ -80,10 +80,10 @@ builder, a `WhlFile` builder, and an `SDist` builder. Here's a simple and complete example. The following sections will go over each part in more detail. ```python -import pytoml as toml +import tomllib import enscons -metadata = toml.load(open("pyproject.toml"))["project"] +metadata = tomllib.load(open("pyproject.toml"))["project"] tag = "py3-none-any" env = Environment( @@ -110,7 +110,7 @@ by the SCons runtime. The SConstruct `Environment` object should be created as shown: ```python -metadata = toml.load(open("pyproject.toml"))["project"] +metadata = tomllib.load(open("pyproject.toml"))["project"] tag = "py3-none-any" env = Environment( diff --git a/enscons/SConstruct.in b/enscons/SConstruct.in index f1cc558..69c3274 100644 --- a/enscons/SConstruct.in +++ b/enscons/SConstruct.in @@ -2,7 +2,7 @@ # (filled by enscons.setup2toml) import enscons -import pytoml as toml +import tomllib as toml metadata = dict(toml.load(open("pyproject.toml")))["project"] diff --git a/enscons/__init__.py b/enscons/__init__.py index ad871e9..febe9d6 100644 --- a/enscons/__init__.py +++ b/enscons/__init__.py @@ -65,13 +65,9 @@ from SCons.Script import Copy, Action, FindInstalledFiles, GetOption, AddOption -from distutils import sysconfig -from collections import defaultdict - from .util import safe_name, to_filename, generate_requirements import codecs -import distutils.ccompiler, distutils.sysconfig, distutils.unixccompiler import os.path import SCons.Node.FS @@ -82,7 +78,7 @@ def get_binary_tag(): """ from packaging import tags - return str(next(tag for tag in tags.sys_tags() if not "manylinux" in tag.platform)) + return str(next(tag for tag in tags.sys_tags() if "manylinux" not in tag.platform)) def get_universal_tag(): @@ -187,7 +183,7 @@ def egg_info_builder(target, source, env): """ Minimum egg_info. To be used only by pip to get dependencies. """ - metadata = env["PACKAGE_METADATA"] + env["PACKAGE_METADATA"] for dnode in env.arg2nodes(target): if dnode.name == "PKG-INFO": with open(dnode.get_path(), "w") as f: @@ -249,7 +245,7 @@ def metadata_source(env): # Maybe the two should be unified. if "license" in metadata: if not _is_string(metadata["license"]): - if not ("text" in metadata["license"]): + if "text" not in metadata["license"]: source.append(metadata["license"]["file"]) if "readme" in metadata: if _is_string(metadata["readme"]): @@ -386,7 +382,6 @@ def add_editable(target, source, env): archive = zipfile.ZipFile( target[0].get_path(), "a", compression=zipfile.ZIP_DEFLATED ) - lines = [] for f, data in project.files(): archive.writestr(zipfile.ZipInfo(f, time.gmtime(SOURCE_EPOCH_ZIP)[:6]), data) archive.close() @@ -497,7 +492,7 @@ def init_wheel(env): # editable may need an extra dependency, so it gets its own dist-info directory. env.Command(editable_dist_info, env["DIST_INFO_PATH"], Copy("$TARGET", "$SOURCE")) - metadata2 = env.Command( + env.Command( editable_dist_info.File("METADATA"), metadata_source(env), metadata_builder ) @@ -593,7 +588,7 @@ def SDist(env, target=None, source=None): env.Clean(egg_info, env["EGG_INFO_PATH"]) env.Alias("egg_info", egg_info) - pkg_info = env.Command("PKG-INFO", metadata_source(env), metadata_builder) + env.Command("PKG-INFO", metadata_source(env), metadata_builder) # also the root directory name inside the archive target_prefix = "-".join((env["PACKAGE_NAME"], env["PACKAGE_VERSION"])) diff --git a/enscons/cli.py b/enscons/cli.py index 8ac322a..f76e427 100644 --- a/enscons/cli.py +++ b/enscons/cli.py @@ -14,7 +14,7 @@ import pprint import os.path import click -import pytoml as toml +import tomllib as toml class Backend(object): diff --git a/enscons/cpyext.py b/enscons/cpyext.py index d03e863..f1053b1 100644 --- a/enscons/cpyext.py +++ b/enscons/cpyext.py @@ -4,15 +4,18 @@ from __future__ import print_function -import distutils.sysconfig, sysconfig, os, os.path +import sysconfig +import os +import os.path -from distutils.core import Distribution -from distutils.extension import Extension -from distutils.command.build_ext import build_ext +from setuptools import Distribution +from setuptools.extension import Extension +from setuptools.command.build_ext import build_ext import importlib import importlib.machinery + # not used when generate is passed directly to Environment def exists(env): return True @@ -28,8 +31,6 @@ def extension_filename(modname, abi3=False): If abi3=True and supported by the interpreter, return e.g. "a/b/c.abi3.so". """ - from distutils.sysconfig import get_config_var - # we could probably just split modname by '.' instead of using ext here: ext = get_build_ext() fullname = ext.get_ext_fullname(modname) @@ -42,10 +43,7 @@ def extension_filename(modname, abi3=False): suffix = suffixes[0] if suffixes else None except AttributeError: pass - if not suffix: - suffix = get_config_var("EXT_SUFFIX") - if not suffix: - suffix = get_config_var("SO") # py2 + suffix = sysconfig.get_config_var("EXT_SUFFIX") if abi3: suffix = get_abi3_suffix() or suffix @@ -55,6 +53,7 @@ def extension_filename(modname, abi3=False): class no_build_ext(build_ext): output = [] # for testing + # Are you kidding me? We have to run build_ext() to finish configuring the compiler. def build_extension(self, ext): def noop_spawn(*args): @@ -102,8 +101,8 @@ def generate(env): # Actually this has side effects adding redundant arguments to ext's compiler. # Could copy the compiler from ext before run() is called. if False: - compiler = distutils.ccompiler.new_compiler() - distutils.sysconfig.customize_compiler(compiler) + compiler = setuptools.ccompiler.new_compiler() + setuptools.sysconfig.customize_compiler(compiler) ext = get_build_ext() diff --git a/enscons/pytar.py b/enscons/pytar.py index e08fc87..bedc085 100644 --- a/enscons/pytar.py +++ b/enscons/pytar.py @@ -52,13 +52,13 @@ def tar(target, source, env): def _filter(info): """Return potentially anonymize tarinfo""" - if taruid != None: + if taruid is not None: info.uid = taruid info.uname = "" - if targid != None: + if targid is not None: info.gid = targid info.gname = "" - if tarmtime != None: + if tarmtime is not None: info.mtime = tarmtime return info diff --git a/enscons/setup.py b/enscons/setup.py index 9bee738..0cffcb6 100644 --- a/enscons/setup.py +++ b/enscons/setup.py @@ -1,9 +1,13 @@ """ enscons' implementation of setup.py, to be called from a shim setup.py for compatibility with traditional style packaging & tools. + +Now that pyproject.toml is widely supported, this should not be needed. """ -import sys, pkg_resources, argparse +import sys +import pkg_resources +import argparse def develop(path): diff --git a/enscons/setup2toml.py b/enscons/setup2toml.py index 4aed0aa..406ae0e 100644 --- a/enscons/setup2toml.py +++ b/enscons/setup2toml.py @@ -7,9 +7,16 @@ import runpy from collections import OrderedDict -import setuptools, distutils.core -import sys, os, codecs, errno -import pytoml +import setuptools +try: + import distutils.core as distutils_core +except ImportError: + distutils_core = None +import sys +import os +import codecs +import errno +import tomli_w import pkgutil @@ -90,7 +97,8 @@ def setup_(**kw): setup_.arguments = kw setuptools.setup = setup_ - distutils.core.setup = setup_ + if distutils_core: + distutils_core.setup = setup_ sys.path[0:0] = "." @@ -138,14 +146,14 @@ def setup_(**kw): if "long_description" in ordered_arguments: sys.stderr.write("Consider replacing long_description with description_file\n") - pyproject = pytoml.dumps( - OrderedDict( + pyproject = tomli_w.dumps( + dict( [ ["project", ordered_arguments], [ "build-system", { - "requires": ["pytoml>=0.1", "enscons"], + "requires": ["enscons"], "build-backend": "enscons.api", }, ], diff --git a/enscons/util.py b/enscons/util.py index 0421e6d..2f9e1f0 100644 --- a/enscons/util.py +++ b/enscons/util.py @@ -2,8 +2,37 @@ Utilities otherwise provided by pkg_resources or wheel """ -from pkg_resources import safe_name, safe_extra, to_filename +import re from packaging.requirements import Requirement +import packaging + + +# from pkg_resources +def safe_extra(extra): + return re.sub("[^A-Za-z0-9.-]+", "_", extra).lower() + + +# from pkg_resources +def safe_name(name): + """Convert an arbitrary string to a standard distribution name + + Any runs of non-alphanumeric/. characters are replaced with a single '-'. + """ + return re.sub("[^A-Za-z0-9.]+", "-", name) + + +# from pkg_resources +def safe_version(version): + """ + Convert an arbitrary string to a standard version string + """ + try: + # normalize the version + return str(packaging.version.Version(version)) + except packaging.version.InvalidVersion: + version = version.replace(" ", ".") + return re.sub("[^A-Za-z0-9.]+", "-", version) + # from wheel def requires_to_requires_dist(requirement): diff --git a/pyproject.toml b/pyproject.toml index f3ccdff..e69261a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,21 +1,20 @@ [project] name = "enscons" description = "Tools for building Python packages with SCons" -version = "0.28.0" +version = "0.30.0" authors = [{ name = "Daniel Holth", email = "dholth@fastmail.fm" }] classifiers = [ - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", ] dependencies = [ "scons>=3.0.5", - "pytoml>=0.1", + "tomli;python_version<'3.11'", "setuptools", "wheel", "attrs", "packaging>=20.9", - "editables==0.2;python_version>'3.0'", + "editables", ] keywords = ["packaging", "wheel"] license = "MIT" @@ -37,5 +36,5 @@ backend-path = ["."] # only for bootstrapped enscons requires = [ "scons", "packaging", - "pytoml>=0.1", + "tomli;python_version<'3.11'", ] # enscons users add "enscons>=0.28" to this list diff --git a/setup.py b/setup.py index 23706a5..2765c83 100644 --- a/setup.py +++ b/setup.py @@ -2,14 +2,18 @@ # Call enscons to emulate setup.py, installing if necessary. # (this setup.py can be copied into any enscons-powered project by editing requires=) -import sys, subprocess, os.path +import sys +import subprocess sys.path[0:0] = ["setup-requires"] try: import enscons.setup except ImportError: - requires = ["scons>=3.0.5", "pytoml"] # just ["enscons"] for enscons users + requires = [ + "scons>=3.0.5", + "tomllib; python_version<'3.11'", + ] # just ["enscons"] for enscons users subprocess.check_call( [sys.executable, "-m", "pip", "install", "-t", "setup-requires"] + requires ) From 99f3ca3e187316858788e022282cf14c19031e8c Mon Sep 17 00:00:00 2001 From: Daniel Holth Date: Sat, 20 Jul 2024 14:42:33 -0400 Subject: [PATCH 03/16] update build matrix --- .github/workflows/upload-pypi-source.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-pypi-source.yml b/.github/workflows/upload-pypi-source.yml index a9f9ed5..d94aff1 100644 --- a/.github/workflows/upload-pypi-source.yml +++ b/.github/workflows/upload-pypi-source.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", pypy3.9] + python-version: ["3.11", "3.12", pypy3.9] steps: - uses: actions/checkout@v3 From 3ae43a7fce2993d1783f669f19a9cfa22057efc1 Mon Sep 17 00:00:00 2001 From: Daniel Holth Date: Sat, 20 Jul 2024 14:43:48 -0400 Subject: [PATCH 04/16] build on pull_request, not push --- .github/workflows/sphinx.yml | 1 - .github/workflows/upload-pypi-source.yml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/sphinx.yml b/.github/workflows/sphinx.yml index 7b4047b..53203bc 100644 --- a/.github/workflows/sphinx.yml +++ b/.github/workflows/sphinx.yml @@ -1,6 +1,5 @@ name: Sphinx on: - - push - pull_request jobs: diff --git a/.github/workflows/upload-pypi-source.yml b/.github/workflows/upload-pypi-source.yml index d94aff1..d1b8653 100644 --- a/.github/workflows/upload-pypi-source.yml +++ b/.github/workflows/upload-pypi-source.yml @@ -1,6 +1,6 @@ name: Build -on: [push, pull_request] +on: [pull_request] jobs: build: From 67ac3a80127e5f41f18c28ad2e745caeaaa171e4 Mon Sep 17 00:00:00 2001 From: Daniel Holth Date: Sat, 20 Jul 2024 14:45:18 -0400 Subject: [PATCH 05/16] add to_filename helper --- enscons/util.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/enscons/util.py b/enscons/util.py index 2f9e1f0..b675691 100644 --- a/enscons/util.py +++ b/enscons/util.py @@ -33,6 +33,13 @@ def safe_version(version): version = version.replace(" ", ".") return re.sub("[^A-Za-z0-9.]+", "-", version) +# from pkg_resources +def to_filename(name): + """Convert a project or version name to its filename-escaped form + + Any '-' characters are currently replaced with '_'. + """ + return name.replace('-', '_') # from wheel def requires_to_requires_dist(requirement): From 1fbc616bbffb19e87e9663a31de15a7d5de7e5c6 Mon Sep 17 00:00:00 2001 From: Daniel Holth Date: Sat, 20 Jul 2024 14:46:48 -0400 Subject: [PATCH 06/16] open pyproject.toml as bniary --- SConstruct | 2 +- docs/index.md | 6 +++--- enscons/SConstruct.in | 2 +- enscons/cli.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/SConstruct b/SConstruct index f7474d3..5cd36b8 100644 --- a/SConstruct +++ b/SConstruct @@ -25,7 +25,7 @@ import tomllib as toml import enscons -metadata = toml.load(open("pyproject.toml"))["project"] +metadata = toml.load(open("pyproject.toml", "rb"))["project"] full_tag = "py2.py3-none-any" diff --git a/docs/index.md b/docs/index.md index a066e27..6b66cc5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -83,7 +83,7 @@ Here's a simple and complete example. The following sections will go over each p import tomllib import enscons -metadata = tomllib.load(open("pyproject.toml"))["project"] +metadata = tomllib.load(open("pyproject.toml", "rb"))["project"] tag = "py3-none-any" env = Environment( @@ -110,7 +110,7 @@ by the SCons runtime. The SConstruct `Environment` object should be created as shown: ```python -metadata = tomllib.load(open("pyproject.toml"))["project"] +metadata = tomllib.load(open("pyproject.toml", "rb"))["project"] tag = "py3-none-any" env = Environment( @@ -234,7 +234,7 @@ These variables are settable using kwargs to the `Environment()` constructor. .. code-block:: python - metadata = toml.load(open("pyproject.toml"))["project"] + metadata = toml.load(open("pyproject.toml", "rb"))["project"] This variable is required. diff --git a/enscons/SConstruct.in b/enscons/SConstruct.in index 69c3274..1881fa8 100644 --- a/enscons/SConstruct.in +++ b/enscons/SConstruct.in @@ -4,7 +4,7 @@ import enscons import tomllib as toml -metadata = dict(toml.load(open("pyproject.toml")))["project"] +metadata = dict(toml.load(open("pyproject.toml", "rb")))["project"] # set to True if package is not pure Python HAS_NATIVE_CODE = False diff --git a/enscons/cli.py b/enscons/cli.py index f76e427..f26c91e 100644 --- a/enscons/cli.py +++ b/enscons/cli.py @@ -19,7 +19,7 @@ class Backend(object): def __init__(self): - self.metadata = dict(toml.load(open("pyproject.toml"))) + self.metadata = dict(toml.load(open("pyproject.toml", "rb"))) build_backend = self.metadata["build-system"]["build-backend"] module, _, obj = build_backend.partition(":") __import__(module) From f40157cf39c747e3ac963168afa5ce3315ba3f74 Mon Sep 17 00:00:00 2001 From: Daniel Holth Date: Sat, 20 Jul 2024 14:52:43 -0400 Subject: [PATCH 07/16] redirect "tomllib or tomli" through enscons.toml --- SConstruct | 2 +- enscons/SConstruct.in | 2 +- enscons/toml.py | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 enscons/toml.py diff --git a/SConstruct b/SConstruct index 5cd36b8..925e5b6 100644 --- a/SConstruct +++ b/SConstruct @@ -22,7 +22,7 @@ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR # OTHER DEALINGS IN THE SOFTWARE. -import tomllib as toml +import enscons.toml as toml import enscons metadata = toml.load(open("pyproject.toml", "rb"))["project"] diff --git a/enscons/SConstruct.in b/enscons/SConstruct.in index 1881fa8..ae24d9b 100644 --- a/enscons/SConstruct.in +++ b/enscons/SConstruct.in @@ -2,7 +2,7 @@ # (filled by enscons.setup2toml) import enscons -import tomllib as toml +import enscons.toml as toml metadata = dict(toml.load(open("pyproject.toml", "rb")))["project"] diff --git a/enscons/toml.py b/enscons/toml.py new file mode 100644 index 0000000..0f24479 --- /dev/null +++ b/enscons/toml.py @@ -0,0 +1,8 @@ +""" +Import available toml.load +""" +try: + # Python 3.11+ + from tomllib import load +except ImportError: + from tomli import load From e00c1a9177b5df58cc1d269c79f50e33408d85e0 Mon Sep 17 00:00:00 2001 From: Daniel Holth Date: Sat, 20 Jul 2024 14:54:23 -0400 Subject: [PATCH 08/16] update workflow --- .github/workflows/upload-pypi-source.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-pypi-source.yml b/.github/workflows/upload-pypi-source.yml index d1b8653..6c36213 100644 --- a/.github/workflows/upload-pypi-source.yml +++ b/.github/workflows/upload-pypi-source.yml @@ -20,7 +20,7 @@ jobs: run: python -c "import sys; print(sys.version)" - name: Build run: | - python -m pip install scons pytoml packaging + python -m pip install scons tomli packaging scons -c scons python -m pip install dist/enscons*.whl From 18a1aebd8d20ca6b93f9ffa9418a3d403feaeda2 Mon Sep 17 00:00:00 2001 From: Daniel Holth Date: Sat, 20 Jul 2024 14:55:58 -0400 Subject: [PATCH 09/16] update changes --- CHANGES | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 9d5d99c..becd49d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,8 +1,8 @@ 0.30.0 ------ -- Support Python 3.12 with deprecated distutils, imp +- Support Python 3.12 with removed distutils, imp - Use setuptools for enscons.cpyext -- Use tomllib (requires Python 3.11+) +- Use tomllib (Python 3.11+) or tomli 0.28.0 ------ From ad461c6ea39981dbea8e9b6b0f47285af70e6941 Mon Sep 17 00:00:00 2001 From: Daniel Holth Date: Sat, 20 Jul 2024 15:06:18 -0400 Subject: [PATCH 10/16] add pypy3.10 --- .github/workflows/upload-pypi-source.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-pypi-source.yml b/.github/workflows/upload-pypi-source.yml index 6c36213..a84dbb2 100644 --- a/.github/workflows/upload-pypi-source.yml +++ b/.github/workflows/upload-pypi-source.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.11", "3.12", pypy3.9] + python-version: ["3.11", "3.12", "pypy3.9" "pypy3.10"] steps: - uses: actions/checkout@v3 From f142110fc2c84c061328e1177b38838bbd728734 Mon Sep 17 00:00:00 2001 From: Daniel Holth Date: Sat, 20 Jul 2024 15:08:35 -0400 Subject: [PATCH 11/16] edit CHANGES --- CHANGES | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index becd49d..723ab53 100644 --- a/CHANGES +++ b/CHANGES @@ -1,8 +1,8 @@ 0.30.0 ------ -- Support Python 3.12 with removed distutils, imp -- Use setuptools for enscons.cpyext -- Use tomllib (Python 3.11+) or tomli +- Support Python 3.12 with removed distutils, imp. +- Use setuptools for enscons.cpyext, only required for enscons projects with extensions. +- Use tomllib (Python 3.11+) or tomli. 0.28.0 ------ From 203704c7750c6184b3e9d504e2d4ad2d3bea9fb0 Mon Sep 17 00:00:00 2001 From: Daniel Holth Date: Sat, 20 Jul 2024 15:22:07 -0400 Subject: [PATCH 12/16] note packaging normalizers --- enscons/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enscons/util.py b/enscons/util.py index b675691..6f74ae8 100644 --- a/enscons/util.py +++ b/enscons/util.py @@ -20,7 +20,7 @@ def safe_name(name): """ return re.sub("[^A-Za-z0-9.]+", "-", name) - +# see also https://packaging.pypa.io/en/stable/utils.html#packaging.utils.canonicalize_version etc. # from pkg_resources def safe_version(version): """ From 3f2dba4cc3c37e9a8bdc595e50e7812dfa4efda5 Mon Sep 17 00:00:00 2001 From: Daniel Holth Date: Sat, 20 Jul 2024 15:22:38 -0400 Subject: [PATCH 13/16] syntax --- .github/workflows/upload-pypi-source.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-pypi-source.yml b/.github/workflows/upload-pypi-source.yml index a84dbb2..d10ab71 100644 --- a/.github/workflows/upload-pypi-source.yml +++ b/.github/workflows/upload-pypi-source.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.11", "3.12", "pypy3.9" "pypy3.10"] + python-version: ["3.11", "3.12", "pypy3.9", "pypy3.10"] steps: - uses: actions/checkout@v3 From 98030cb402b6f2bfeb420efcdad9331a7b0932ea Mon Sep 17 00:00:00 2001 From: Daniel Holth Date: Sat, 20 Jul 2024 15:54:44 -0400 Subject: [PATCH 14/16] require successful SCons exit code --- enscons/api.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/enscons/api.py b/enscons/api.py index 617146e..774e3f9 100644 --- a/enscons/api.py +++ b/enscons/api.py @@ -23,8 +23,9 @@ def _run(alias): try: SCons.Script.Main.main() - except SystemExit: - pass + except SystemExit as e: + if e.code != 0: + raise # extreme non-api: lookup = SCons.Node.arg2nodes_lookups[0](alias).sources[0] return os.path.basename(str(lookup)) From 2e6e790050f999441c0a90fcc5a5fe9ca8625e85 Mon Sep 17 00:00:00 2001 From: Daniel Holth Date: Sat, 20 Jul 2024 17:05:05 -0400 Subject: [PATCH 15/16] unused code --- enscons/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/enscons/__init__.py b/enscons/__init__.py index febe9d6..40d68bf 100644 --- a/enscons/__init__.py +++ b/enscons/__init__.py @@ -183,7 +183,6 @@ def egg_info_builder(target, source, env): """ Minimum egg_info. To be used only by pip to get dependencies. """ - env["PACKAGE_METADATA"] for dnode in env.arg2nodes(target): if dnode.name == "PKG-INFO": with open(dnode.get_path(), "w") as f: From 0218b8e2ad3314b5c9000f53441c9805314955f9 Mon Sep 17 00:00:00 2001 From: Daniel Holth Date: Sat, 20 Jul 2024 18:07:36 -0400 Subject: [PATCH 16/16] add python 3.8+ to workflow --- .github/workflows/upload-pypi-source.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upload-pypi-source.yml b/.github/workflows/upload-pypi-source.yml index d10ab71..f9b9140 100644 --- a/.github/workflows/upload-pypi-source.yml +++ b/.github/workflows/upload-pypi-source.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.11", "3.12", "pypy3.9", "pypy3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.9", "pypy3.10"] steps: - uses: actions/checkout@v3