Skip to content

Drop setup.py in favour of pyproject.toml; bump to 0.2.0 - #133

Merged
rcjackson merged 5 commits into
ARM-Development:mainfrom
rcjackson:v020
Sep 2, 2026
Merged

Drop setup.py in favour of pyproject.toml; bump to 0.2.0#133
rcjackson merged 5 commits into
ARM-Development:mainfrom
rcjackson:v020

Conversation

@rcjackson

Copy link
Copy Markdown
Collaborator

This drops setup.py and integrates it into pyproject.toml. This also bumps the release to 0.2.0. Authored with assistance from Claude Opus 5.

Robert Jackson and others added 5 commits September 2, 2026 17:14
All packaging metadata now lives in pyproject.toml: version, readme,
license (SPDX), authors, classifiers, URLs, the console scripts and the
Cython extension. setup.py is removed.

Two parts of the extension build cannot be expressed statically in
pyproject.toml -- NumPy's include directory is only known once NumPy is
importable, and [tool.setuptools] ext-modules cannot express
define-macros two-tuples. Both are handled by a small build_ext subclass
in _cmac_build.py, wired up via [tool.setuptools.cmdclass]. MANIFEST.in
ships that helper in the sdist so source installs still build.

packages.find sets namespaces = false to match the previous
find_packages() behaviour, keeping the un-packaged cmac/tests out of the
distribution. The dead write_version_py/git_version helpers in setup.py
were never called (ISRELEASED was undefined) and are dropped with it, so
the version is now simply static.

Verified: wheel build, sdist build, sdist -> wheel under full build
isolation, editable install, and pytest cmac/tests (58 passed).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
conda-forge's Python bakes the flags of the GCC it was built with into
sysconfig's CFLAGS. Compiling cmac.calc_kdp_ray_fir with the runner's
older system gcc failed on flags it does not recognise:

    gcc: error: unrecognized command-line option '-partition=none';
    did you mean '-flto-partition=none'?

Add c-compiler to the CI environment so a matching conda-forge gcc is
installed and exported as CC on environment activation.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
A conda-forge interpreter records the flags of whichever GCC built it in
sysconfig's CFLAGS, and customize_compiler copies those verbatim into
every command line. Python 3.12/3.13 on conda-forge now carry
-partition=none from GCC 16, which neither the runner's system gcc nor
the conda-forge c-compiler pin (gcc 15.3.0) accepts:

    gcc: error: unrecognized command-line option '-partition=none';
    did you mean '-flto-partition=none'?

Adding c-compiler to the CI environment did not help, since its pinned
gcc trails the one that built the interpreter; revert that and instead
probe the compiler in build_ext and strip the options it rejects. These
are optimization and LTO tuning flags, so dropping them changes nothing
semantically, and this also fixes source installs outside CI.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The previous commit's probe never fired in CI: under a UTF-8 locale GCC
quotes the offending option with U+2018/U+2019 ("unrecognized
command-line option ‘-partition=none’"), while the pattern assumed the
ASCII quoting clang had produced locally, so nothing was stripped and
the build failed exactly as before.

Run the probe under LC_ALL=C so diagnostics come back in ASCII, and
match the quoting loosely as a backstop in case that is ignored.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@rcjackson
rcjackson requested a review from zssherman September 2, 2026 22:54
@rcjackson
rcjackson merged commit 5eaace0 into ARM-Development:main Sep 2, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants