NLeSC / python-template

Netherlands eScience Center Python Template
https://research-software-directory.org/software/nlesc-python-template
Apache License 2.0
163 stars 73 forks source link

use python -m build to build #358

Closed egpbos closed 8 months ago

egpbos commented 9 months ago

Fixes #318 (somehow used the wrong number in the branch name, oh well).

Description

Following up on #352, where in one of the test cases the use of the build module was introduced, because setup.py was removed, in this PR I want to transfer the whole build system to using it.

In fact, the template's generated build workflow is probably broken at this point, because it also still tries to call setup.py! So this has a bit of urgency.

Instructions to review the pull request

Create a python-template-test repo on GitHub (will be overwritten if existing)

cd $(mktemp -d --tmpdir py-tmpl-XXXXXX)
cookiecutter -c <pr-branch> https://github.com/<pr-user>/python-template
# Fill with python-template-test info
cd python-template-test
git init
git add --all
git commit -m "First commit"
git remote add origin https://github.com/<you>/python-template-test
git push -u origin main -f
python -m venv env
source env/bin/activate
python -m pip install --upgrade pip setuptools
python -m pip install '.[dev,publishing]'
egpbos commented 8 months ago

Force push to fixup the fixup (the first commit). I was a bit overzealous in removing what I thought were superfluous arguments (sdist and bdist_wheel). As it turns out, it is necessary to pass one, but for weird reasons that are not guaranteed to stay true forever because they are a known bug / PEP-violation! I added a comment about this.

egpbos commented 8 months ago

Thanks!