Skip to content

check_pypi_packaging.yml uses deprecated python setup.py sdist bdist_wheel #326

Description

@dave-doty

.github/workflows/check_pypi_packaging.yml builds the package with:

- name: Install dependencies
  run: |
    python -m pip install --upgrade pip
    pip install setuptools wheel
- name: Build
  run: python setup.py sdist bdist_wheel

Invoking setup.py directly is deprecated. It still works today (I ran it in a clean venv on setuptools 83 and it does produce both scadnano-0.20.1.tar.gz and scadnano-0.20.1-py3-none-any.whl), but setuptools now warns:

SetuptoolsDeprecationWarning: setup.py install is deprecated.
    This deprecation is overdue, please update your project and remove deprecated
    calls to avoid build errors in the future.

So this workflow is on a clock: whenever setuptools finally removes the setup.py command interface, the job starts failing, and it will do so on setuptools' schedule rather than ours. This is the same failure mode as the stale action versions in #324 — nothing is wrong today, but nothing is watching it either.

The fix is to use the standard PEP 517 build front end, which is what release.yml already does:

- name: Install dependencies
  run: |
    python -m pip install --upgrade pip
    pip install build
- name: Build
  run: python -m build

python -m build produces the same sdist + wheel, in an isolated build environment. This also makes the two workflows consistent: right now release.yml (the one that actually publishes to PyPI) builds differently from check_pypi_packaging.yml (the one meant to check that packaging works), which somewhat defeats the point of the check.

Noticed while doing #324.

Separately, and worth a look while in there: setup.py passes tests_require, which setuptools no longer recognizes and warns about (UserWarning: Unknown distribution option: 'tests_require').

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions