Skip to content

Bump to ruff 0.10.0 and fix violations #3850

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

Merged
merged 2 commits into from
Mar 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies:
# Dev dependencies (style checks)
- codespell
- pre-commit
- ruff>=0.9.6
- ruff>=0.10.0
Copy link
Member Author

Choose a reason for hiding this comment

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

Ruff 0.10.0 isn't available on conda-forge yet, wait for PR at https://github.com/conda-forge/ruff-feedstock/pulls before merging.

Copy link
Member Author

Choose a reason for hiding this comment

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

conda-forge/ruff-feedstock#260 is merged now 🚀

# Dev dependencies (unit testing)
- matplotlib-base
- pytest>=6.0
Expand Down
2 changes: 1 addition & 1 deletion pygmt/tests/test_datasets_load_remote_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def test_load_remote_dataset_invalid_resolutions():
"""
Make sure _load_remote_dataset fails for invalid resolutions.
"""
resolutions = "1m 1d bla 60d 001m 03".split()
resolutions = ["1m", "1d", "bla", "60d", "001m", "03"]
resolutions.append(60)
for resolution in resolutions:
with pytest.raises(GMTInvalidInput):
Expand Down
17 changes: 15 additions & 2 deletions pygmt/tests/test_figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,20 @@ def test_figure_savefig_exists():
fig = Figure()
fig.basemap(region="10/70/-300/800", projection="X3i/5i", frame="af")
prefix = "test_figure_savefig_exists"
for fmt in "bmp eps jpg jpeg pdf png ppm tif PNG JPG JPEG Png".split():
for fmt in [
"bmp",
"eps",
"jpg",
"jpeg",
"pdf",
"png",
"ppm",
"tif",
"PNG",
"JPG",
"JPEG",
"Png",
]:
fname = Path(f"{prefix}.{fmt}")
fig.savefig(fname)
assert fname.exists()
Expand Down Expand Up @@ -192,7 +205,7 @@ def test_figure_savefig_transparent():
fig = Figure()
fig.basemap(region="10/70/-300/800", projection="X3i/5i", frame="af")
prefix = "test_figure_savefig_transparent"
for fmt in "pdf jpg bmp eps tif".split():
for fmt in ["pdf", "jpg", "bmp", "eps", "tif"]:
fname = f"{prefix}.{fmt}"
with pytest.raises(GMTInvalidInput):
fig.savefig(fname, transparent=True)
Expand Down
Loading