Skip to content

build(pyproject): drop unused setuptools runtime dependency#2838

Open
lukehsiao wants to merge 1 commit into
simonw:mainfrom
lukehsiao-forks:main
Open

build(pyproject): drop unused setuptools runtime dependency#2838
lukehsiao wants to merge 1 commit into
simonw:mainfrom
lukehsiao-forks:main

Conversation

@lukehsiao

Copy link
Copy Markdown

setuptools became a dependency in commit 249fcf8 ("Add setuptools to dependencies") because app.py imported pkg_resources and Rye-managed virtualenvs do not ship setuptools. That import was replaced in commit 852f501 ("Switch from pkg_resources to importlib.metadata in app.py, refs #2057"), so nothing in Datasette has consumed the dependency since. pluggy's load_setuptools_entrypoints() reads entry points through importlib.metadata despite its name, and the publish/package Dockerfile templates never reference setuptools.

Discovered using pyproject-udeps [1].

Tested: in a fresh uv venv, which ships without setuptools:

$ uv venv t && uv pip install --python t/bin/python .
$ t/bin/python -c "import setuptools"
ModuleNotFoundError: No module named 'setuptools'
$ t/bin/datasette --version
datasette, version 1.0a36
$ t/bin/datasette plugins
[]
$ t/bin/datasette --get /-/versions.json
{"ok": true, ...}

Ref: #2065
Ref: #2057

setuptools became a dependency in commit 249fcf8 ("Add setuptools
to dependencies") because app.py imported pkg_resources and Rye-managed
virtualenvs do not ship setuptools. That import was replaced in
commit 852f501 ("Switch from pkg_resources to importlib.metadata
in app.py, refs simonw#2057"), so nothing in Datasette has consumed the
dependency since. pluggy's load_setuptools_entrypoints() reads
entry points through importlib.metadata despite its name, and the
publish/package Dockerfile templates never reference setuptools.

Discovered using `pyproject-udeps` [[1]].

[1]: https://github.com/lukehsiao/pyproject-udeps

Tested: in a fresh uv venv, which ships without setuptools:

    $ uv venv t && uv pip install --python t/bin/python .
    $ t/bin/python -c "import setuptools"
    ModuleNotFoundError: No module named 'setuptools'
    $ t/bin/datasette --version
    datasette, version 1.0a36
    $ t/bin/datasette plugins
    []
    $ t/bin/datasette --get /-/versions.json
    {"ok": true, ...}

Ref: simonw#2065
Ref: simonw#2057
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.

1 participant