-
-
Notifications
You must be signed in to change notification settings - Fork 451
Add optional dependency sections for gallery and docs #7487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I'd love to see this for 0.6 👀 |
docs = [ | ||
"napari[gallery]", | ||
"sphinx<8", | ||
"sphinx-autobuild", | ||
"sphinx-tabs", | ||
"sphinx-tags", | ||
"sphinx-design", | ||
"sphinx-external-toc", | ||
"sphinx-favicon>=1.0", | ||
"sphinx-copybutton", | ||
"sphinx-gallery", | ||
"sphinx_autodoc_typehints==1.12.0", | ||
"myst-nb", | ||
"napari-sphinx-theme>=0.3.0", | ||
"matplotlib", | ||
"lxml[html_clean]>5", | ||
"imageio-ffmpeg", | ||
"pytest", | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this change, we need to update upgrade dependencies' workflow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Czaki can you elaborate on this? What do we need to do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minimaly change this line
uv pip compile --python-version 3.10 --upgrade --output-file ${constraints}/constraints_py3.10_docs.txt ${pyproject_toml} ${constraints}/version_denylist.txt ${constraints}/version_denylist_examples.txt docs/requirements.txt "${flags[@]}" |
to replace docs/requirements.txt
with --extra docs
Fully. We do not need to clone two repos for this action, if we store dependencies in pyproject.toml
. So we may refactor upgrade_test_constraints.yml
to clone one repo, so simplify run it locally. But not do it as it will conflict with #7603. I prefer separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in ad9fc01
We should also refactor circleci configuaration Lines 31 to 45 in c6a0761
And this https://github.com/napari/docs/blob/20829cff8286f291f7d20d792c876137200f7c4e/Makefile#L24 |
@Czaki any thoughts on:
|
Do you mean keep the requirements.txt in docs repo? We already have pins in the main repository, so relaxing any upper constraints requires updating the main repository to have it working |
No, requirements.txt goes. I mean, for the gallery dependencies, not specifying version ranges at all in pyproject.toml. |
Why did you want to keep two sources of truth? Why keep docs dependency in two places?
I do not agree with this assumption. We run tests on CI to spot such things. And having dependency in multiple places will only increase maintenance jobs. If some dependency needs to be added in multiple places, someone will forget to add them in one of them. I think that PEP 735 is something that we should investigate https://peps.python.org/pep-0735/ |
There's not two sources. The docs dependencies are needed to build the docs, the gallery dependencies are needed for the gallery. They are different sections because you don't need all the docs deps for the gallery, and specifically you need the gallery dependencies for testing but you don't need sphinx for testing. So we can't put the gallery dependencies in [docs]. |
Ok, I can remove the redundant deps. 👍 |
Zeroc-ice do not provide linux wheels and fail to build from source because of lack of build dependencies. |
@Czaki :
Can we bump |
The CI that failed is 3.10, and the current release only supports 3.11 and 3.12. I remember now why we made examples/3d_kymograph_.py not run or be tested automatically (hence the trailing underscore in the filename). 😅 We might be able to update it to use an ome-zarr dataset in the future, but for now, I've just removed the dependency — that file isn't run anyway. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7487 +/- ##
==========================================
- Coverage 92.87% 92.84% -0.04%
==========================================
Files 629 629
Lines 58971 58971
==========================================
- Hits 54771 54749 -22
- Misses 4200 4222 +22 ☔ View full report in Codecov by Sentry. |
FYI The easiest way to get omero working is via conda-forge. |
@Czaki I removed the core dependencies from the gallery dependencies. This should be ready to merge. 🤞 |
@Czaki investigating the nilearn issue, it seems that it's ok to keep it in the gallery dependencies — the new version is not incompatible with current NumPy. Looking at #5716, I think that I should rename the file to not include a trailing underscore (so that it gets added to the gallery in the docs), remove the ModuleNotFound checks, and remove version_denylist_gallery. I would rather do this in a follow-up PR. Do you agree with this plan? (If so then this can be merged.) |
I still suggest updating: Lines 133 to 142 in 3a46b9c
to [testenv:py{310,311,312,313}-{linux,macos,windows}-{pyqt5,pyside2,pyqt6,pyside6}-examples-{cov,no_cov}]
commands =
cov: coverage run --parallel-mode \
!cov: python \
-m pytest napari/_tests/test_examples.py -v --color=yes --basetemp={envtmpdir} {posargs} As all gallery extras are now in test dependecies.
I think that making these changes in separate PR is a good idea. |
Ah, I didn't fully grok that. Pushed! Let's just wait for CI now. 🙏 |
# References and relevant issues Part of: napari/docs#589 # Description In #7487 a few requirements were missed. This PR adds them back. I also update the `_docs` constraints -- not for any of the new versions (leave that to the normal PR), just for docs. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
# Description There are three changes here. 1. stop cloning docs repo as we are using extension group (#7487). 2. change directory to napari repo so commands on the top of constraints files napari/resources/constraints/constraints_py3.10.txt( https://github.com/napari/napari/blob/39b385d23e9f0af40dcfea205d7e3a5d52feedb8/resources/constraints/constraints_py3.10.txt#L2 could be easier executed locally as there will be no napari_repo in the path. That will allow to easier recalculate constraints locally. 3. remove PyQt5 from constraints, as there is no single PyQt5 version that provides wheels for both windows and macOS ARM. This simplifies maintenance and local bumping. As PyQt5 is in maintenance mode, I do not expect that PyQt5 may break anything and removing it from constraints allows removing separate Windows files. With these changes, it will be easier to run update of constraints locally.
# References and relevant issues closes #670 napari/napari#7642 napari/napari#7487 # Description After the most recent updates of constraints update, we could simplify this instrucition. --------- Co-authored-by: Peter Sobolewski <[email protected]> Co-authored-by: Carol Willing <[email protected]> Co-authored-by: Constantin Aronssohn <[email protected]>
Looking for feedback here, especially from @Czaki and @melissawm.
Prompted by this comment from @psobolewskiPhD.
When adding an example to the gallery, any new dependencies need to be added to
both (currently nonexistent)
docs
andtesting
optional dependency groups.That made me think that there was something a bit off with how we were thinking
about things. I thought about this a bit more and thought it best to create a
"gallery" group, which both testing and docs depend on.
I've implemented this in this PR, adding [docs] and [gallery] and then adding
dependencies on [gallery] to both [docs] and [testing]. Some questions:
dependencies, even if it is already a core dependency. The rationale here is
that if we, for example, drop the dependency on pandas, we still want the
examples using pandas to run. It's nice to have our core dependencies and our
direct example dependencies uncoupled.
keep gallery dependencies in sync. I've therefore kept gallery dependencies
bare, with no version requirements. Is that a bad idea?
docs repo.
Is that what we want to do or do we want to clean these up/add
minimum/maximum versions? (And maybe that could come in a separate PR?)