Skip to content
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

Improve repo configuration based on scientific python suggestions #6554

Merged
merged 65 commits into from
Apr 13, 2024

Conversation

Czaki
Copy link
Collaborator

@Czaki Czaki commented Dec 25, 2023

Description

The Scientific python has tool named repo-review with set of rules that they think are good for projects.

Not all apply to napari, but some of them looks usefull. To see the check on napari repo one may use this link
https://learn.scientific-python.org/development/guides/repo-review/?repo=napari%2Fnapari&branch=main

This PR contains non mypy improvements, as mypy ones requires improvements in code.

It depends on #6557

This PR also enables automatically dump graph when QtViewer is leaked during tests. Then such graph in pdf is uploaded as job artifact.

@github-actions github-actions bot added tests Something related to our tests task Tasks for contributors and maintainers labels Dec 25, 2023
@Czaki Czaki added the maintenance PR with maintance changes, label Dec 25, 2023
@Czaki Czaki added this to the 0.5.0 milestone Dec 25, 2023
Copy link

codecov bot commented Dec 25, 2023

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 92.39%. Comparing base (6f4d4e5) to head (564e6cf).
Report is 23 commits behind head on main.

Files Patch % Lines
napari/utils/_testsupport.py 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6554      +/-   ##
==========================================
- Coverage   92.41%   92.39%   -0.02%     
==========================================
  Files         615      614       -1     
  Lines       54892    54908      +16     
==========================================
+ Hits        50729    50733       +4     
- Misses       4163     4175      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Czaki Czaki marked this pull request as draft December 27, 2023 16:06
@Czaki Czaki marked this pull request as ready for review February 11, 2024 23:26
@@ -103,6 +103,7 @@ commands =
!cov: python \
-m pytest {env:PYTEST_PATH:} --color=yes --basetemp={envtmpdir} \
--ignore tools --maxfail=5 --json-report \
linux: --pystack-threshold=60 --pystack-args="--native-all" \
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change? I guess it's because of the added -ra option maybe?

@@ -151,10 +148,12 @@ xarray = "xr"
[tool.pytest.ini_options]
# These follow standard library warnings filters syntax. See more here:
# https://docs.python.org/3/library/warnings.html#describing-warning-filters
addopts = "--maxfail=5 --durations=10 -rXxs"
addopts = ["--maxfail=5", "--durations=10", "-ra", "--strict-markers", "--strict-config"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@brisvag Asked changes comes from using --strict-config here.

It causes pytest to fail if some option is not recognized. It makes harder to configure optional plugins, but save from making typos in configuration options.

Here issue in pytest-pystack bloomberg/pytest-pystack#9

@psobolewskiPhD psobolewskiPhD self-requested a review February 14, 2024 19:51
@brisvag
Copy link
Contributor

brisvag commented Apr 5, 2024

I'll mark my review as stale since you're still doing lots of testing and I wanna avoid accidental merge. Ping me when you think things are ok!

@brisvag brisvag dismissed their stale review April 5, 2024 12:59

Many changes still happening

pyproject.toml Outdated Show resolved Hide resolved
Czaki added a commit to Czaki/napari that referenced this pull request Apr 11, 2024
pyproject.toml Outdated Show resolved Hide resolved
@Czaki
Copy link
Collaborator Author

Czaki commented Apr 12, 2024

@brisvag I found that the problem was caused by logging level (I do not know why). But now it is ready for review, and debug of logging will be another PR.

@Czaki Czaki added the ready to merge Last chance for comments! Will be merged in ~24h label Apr 12, 2024
@Czaki Czaki merged commit 66176ed into napari:main Apr 13, 2024
35 checks passed
@Czaki Czaki deleted the scientific_python_repo_review branch April 13, 2024 13:38
@github-actions github-actions bot removed the ready to merge Last chance for comments! Will be merged in ~24h label Apr 13, 2024
brisvag pushed a commit that referenced this pull request Apr 15, 2024
# References and relevant issues

# Description
In #6554 I have added the graphviz installation step to produce a leaked
widgets graph. Unfortunately, brew is reporting some errors on
installing python 3.12 during installation of graphviz.

This PR makes graphviz installation steep optional. So in post cases we
will still have leaked widgets graph, but do not crash the test suite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance PR with maintance changes, qt Relates to qt task Tasks for contributors and maintainers tests Something related to our tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants