fix: publish tutorials dependencies as PEP 621 extras - #885
Merged
SemyonSinchenko merged 1 commit intoAug 22, 2026
Merged
Conversation
`click`, `py7zr` and `requests` were declared in
`[tool.poetry.group.tutorials.dependencies]`. Poetry dependency *groups*
are a local dev-environment feature and are never written into built
distribution metadata, so the published wheel carried no `Provides-Extra`
and no `Requires-Dist` at all:
$ pip install 'graphframes-py[tutorials]'
WARNING: graphframes-py 0.12.1 does not provide the extra 'tutorials'
$ graphframes
ModuleNotFoundError: No module named 'click'
Declare the same three packages in `[project.optional-dependencies]` so
they land in the wheel metadata and `pip install graphframes-py[tutorials]`
(or `[all]`) works. The `tutorials` Poetry group is kept so that
`poetry install --with tutorials` still works for contributors.
Also catch the `ImportError` in `graphframes.console.main()` and log a
message pointing at the extra, instead of raising a bare traceback from
the console script that is installed for every user.
Fixes graphframes#884
SemyonSinchenko
approved these changes
Aug 22, 2026
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #885 +/- ##
==========================================
+ Coverage 79.26% 81.63% +2.36%
==========================================
Files 81 81
Lines 4712 4682 -30
Branches 554 574 +20
==========================================
+ Hits 3735 3822 +87
+ Misses 977 860 -117 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
python/pyproject.toml: declareclick,py7zrandrequestsin[project.optional-dependencies]as thetutorialsextra (plus anallalias), with the same version constraints they already had. The existing[tool.poetry.group.tutorials.dependencies]group is left in place sopoetry install --with tutorialskeeps working for contributors and the docs in01-contributing-guide.mdstay accurate.python/poetry.lock: regenerated (Poetry 2.4.1) — marker/group metadata only, no package version changes.python/graphframes/console.py: catch theImportErrorinmain()and log a message that names the extra, instead of letting the console script die with a bare traceback.allrepeats the requirement list rather than referencinggraphframes-py[tutorials]because Poetry refuses to lock a self-referential extra (Package 'graphframes-py[tutorials]' is listed as a dependency of itself).Why are the changes needed?
Fixes #884.
Poetry dependency groups are a local dev-environment feature — Poetry never writes them into built distribution metadata. Only
[project.optional-dependencies](PEP 621) or[tool.poetry.extras]emitProvides-Extra/Requires-Dist … ; extra == "…". So the publishedgraphframes_py-0.12.1-py3-none-any.whlhas zeroRequires-Distand zeroProvides-Extralines, while still installing an unconditional console script:console.pyimportsclickat module scope andgraphframes/tutorials/download.pyimportspy7zrandrequests, so the shippedgraphframesbinary is broken for everyone, and there is no extra to install that fixes it.Before, on a clean venv:
After, building the wheel from this branch:
And without the extra, the failure is now actionable rather than a traceback:
Note on #881
#881 landed the lazy import in
console.pybut itspyproject.tomlhalf was reverted, on the grounds thatclick"belongs under tutorials, since it is required for the CLI" and shouldn't become a separate one-package group. This PR keeps that structure — all three packages stay together undertutorials— and only changes where they are declared so they actually reach the published metadata. No new runtime dependency is added to the base install.pysparkremains undeclared, unchanged by this PR.