Skip to content

Remove setuptools dependency#108

Merged
Darshan808 merged 5 commits into
jupyterlab:mainfrom
Darshan808:drop-setup-tools
Jun 12, 2026
Merged

Remove setuptools dependency#108
Darshan808 merged 5 commits into
jupyterlab:mainfrom
Darshan808:drop-setup-tools

Conversation

@Darshan808

Copy link
Copy Markdown
Member

Fixes #106

Description

Drop the use of setuptools and create custom implementation of find_packages and find_namespace_packages.

@Darshan808 Darshan808 added the maintenance Change related to maintenance of the repository label May 23, 2026
@Darshan808 Darshan808 requested a review from bollwyvl May 24, 2026 08:26
@Darshan808 Darshan808 marked this pull request as ready for review May 24, 2026 08:26
Comment thread jupyter_builder/federated_extensions.py Outdated
@Darshan808

Copy link
Copy Markdown
Member Author

The only place we might use setuptools is in this script, which is a fallback for getting package name

# Try getting the package name from setup.py
if not package:
try:
package = (
subprocess.check_output(
[sys.executable, "setup.py", "--name"],
cwd=mod_path,
)
.decode("utf8")
.strip()
)
except subprocess.CalledProcessError:
msg = (
f"The Python package `{module}` is not a valid package, "
"it is missing the `setup.py` file."
)
raise FileNotFoundError(msg) from None

@krassowski

Copy link
Copy Markdown
Member

The only place we might use setuptools is in this script, which is a fallback for getting package name

I think it is ok to keep, but let's change the error message so that it does not suggest adding setup.py. Maybe:

             f"The Python package `{module}` is not a valid package, " 
             "it does not specify a `name` in `pyproject.toml` nor has a legacy `setup.py` file." 

@krassowski krassowski left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@krassowski krassowski changed the title Remove Setuptools dependency Remove setuptools dependency Jun 11, 2026
@krassowski

Copy link
Copy Markdown
Member

Is the CI failure related to my change?

@bollwyvl

Copy link
Copy Markdown

PyPI is having a bad day.

Also adding --disable-pip-version-check (or setting PIP_DISABLE_PIP_VERSION_CHECK) when upgrading pip can cut down a lot on the noise.

@krassowski

Copy link
Copy Markdown
Member

Yes but besides it, the tests which run:

FAILED tests/test_tpl.py::test_builder_version_mismatch - AssertionError: Expected version mismatch error message not found in output!
assert None
 +  where None = <function search at 0x1010be980>('ValueError: Extensions require a devDependency on @jupyterlab/builder@\\^.+?, you have a dependency on 4\\.0\\.0', 'Building extension in /private/var/folders/8d/778wjbv96mq1760tv6gk374m0000gn/T/pytest-of-runner/pytest-0/test_builder...g file for details: jupyterlab-debug.log\n  warnings.warn(f"See the log file for details: {log_path}", stacklevel=1)\n')
 +    where <function search at 0x1010be980> = re.search
 +    and   'Building extension in /private/var/folders/8d/778wjbv96mq1760tv6gk374m0000gn/T/pytest-of-runner/pytest-0/test_builder...g file for details: jupyterlab-debug.log\n  warnings.warn(f"See the log file for details: {log_path}", stacklevel=1)\n' = CalledProcessError(1, ['jupyter-builder', 'build', '/private/var/folders/8d/778wjbv96mq1760tv6gk374m0000gn/T/pytest-of-runner/pytest-0/test_builder_version_mismatch0/ext', '--core-version', '4.5.x']).stderr
 +      where CalledProcessError(1, ['jupyter-builder', 'build', '/private/var/folders/8d/778wjbv96mq1760tv6gk374m0000gn/T/pytest-of-runner/pytest-0/test_builder_version_mismatch0/ext', '--core-version', '4.5.x']) = <ExceptionInfo CalledProcessError(1, ['jupyter-builder', 'build', '/private/var/folders/8d/778wjbv96mq1760tv6gk374m0000gn/T/pytest-of-runner/pytest-0/test_builder_version_mismatch0/ext', '--core-version', '4.5.x']) tblen=2>.value

@bollwyvl

Copy link
Copy Markdown

Ah, didn't get that far. Perhaps try:

pytest -vv --tb=long --color=yes

... for more glorious technicolor ✖️

Also, for debugging CI stuff, pytest-html (and archiving it always()) helps a lot.

@Darshan808

Copy link
Copy Markdown
Member Author

#115 fixes the CI

@Darshan808 Darshan808 merged commit 4709f8b into jupyterlab:main Jun 12, 2026
21 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in CFP '25 tracking Jun 12, 2026
krassowski added a commit to jupyterlab/jupyterlab that referenced this pull request Jun 16, 2026
## References

- Fixes #18928 
- Depends on jupyterlab/jupyter-builder#108
being released (and we should probably bump versions here)

## Code changes

- Drop `setuptools` in test files and from `pyproject.toml` 
- Remove top-level `setup.py`
- Update internationalization documentation example
- Update Extension Migration for 4.6.0 in changelog

## User-facing changes

None...

Unless someone was relaying on jupyterlab implicitly installing
`setuptools` (which they should not have).

## Backwards-incompatible changes

None

## AI usage

- **Yes**: Some or all of the content of this PR was generated by AI.
- **Yes**: The human author has carefully reviewed this PR and run this
code (keep this PR "draft" until the answer is YES)
- AI tools and models used: Clause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Change related to maintenance of the repository

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Remove setuptools dependency

3 participants