Skip to content

fix for setuptools deprecated - #686

Open
rishi29-cloud wants to merge 1 commit into
data-8:masterfrom
rishi29-cloud:fix_setuptools_deprecations
Open

rishi29-cloud wants to merge 1 commit into
data-8:masterfrom
rishi29-cloud:fix_setuptools_deprecations

Conversation

@rishi29-cloud

Copy link
Copy Markdown

[ ] Wrote test for feature — N/A, this is a build/packaging change with no runtime behaviour change
[ ] Added changes to CHANGELOG.md

Changes proposed:

make install currently emits two deprecation warnings, and tox fails outright:

setup.py:3: SetuptoolsDeprecationWarning: The test command is disabled and references to it are deprecated.
        Please remove any references to `setuptools.command.test` in all supported versions of the affected package.

DevelopDeprecationWarning: develop command is deprecated.
        Please avoid running ``setup.py`` and ``develop``.
        Instead, use standards-based tools like pip or uv.

RuntimeError: Support for the test command was removed in Setuptools 72

The root cause is that setup.py still imports setuptools.command.test and registers a PyTest command via cmdclass={'test': PyTest}. That module was removed in Setuptools 72, so any invocation of setup.py test — which is what tox runs — now raises. Separately, make install and the CI workflow invoke the deprecated setup.py develop.

This PR removes the deprecated machinery and moves to standards-based tooling:

  • setup.py — dropped the from setuptools.command.test import test as TestCommand import, the PyTest command class it fed, and the cmdclass / tests_require arguments. Package metadata is otherwise unchanged, so nothing about what gets installed changes.
  • Makefile — make install now runs python3 -m pip install -e . instead of setup.py develop; make test runs pytest.
  • tox.ini — commands runs pytest instead of python setup.py test. Added bokeh>=3.0.0 and bokeh_sampledata to deps: the tox environment never listed bokeh at all, so tests/test_tables.py would still have failed on from bokeh.sampledata.autompg import autompg even after the command swap. Newer bokeh moved the sample datasets out to the separate bokeh_sampledata package, which the import shim forwards to.
  • requirements-tests.txt — pinned the bare bokeh to bokeh>=3.0.0 (pytest and bokeh-sampledata were already listed).
  • .github/workflows/run_tests.yml — the CI workflow also ran python setup.py develop, which would have broken in CI the same way tox did. Now python -m pip install -e ..
  • tests.py — kept as a working entry point, but it no longer hardcodes the pytest flags.

The pytest options that were previously duplicated between setup.py and tests.py now live in a single [pytest] section in tox.ini (addopts = --nbval-lax --cov=datascience, testpaths = tests), so bare pytest, make test and tox all behave identically to the old setup.py test invocation. Coverage reporting for the Coveralls step is therefore preserved.

Deliberately left out of scope, happy to fold in if maintainers prefer:

  • DEVELOPERS.md still documents python setup.py sdist / bdist_wheel for publishing, which is deprecated the same

This branch has not been deployed

No deployments
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