Skip to content

Commit 28b2bc8

Browse files
committed
Merge branch 'main' into options
2 parents 5100006 + 49b5afd commit 28b2bc8

File tree

10 files changed

+21
-18
lines changed

10 files changed

+21
-18
lines changed

.github/workflows/cache_data.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535

3636
# Install Micromamba with conda-forge dependencies
3737
- name: Setup Micromamba
38-
uses: mamba-org/[email protected].0
38+
uses: mamba-org/[email protected].3
3939
with:
4040
environment-name: pygmt
4141
condarc: |

.github/workflows/ci_docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565

6666
# Install Micromamba with conda-forge dependencies
6767
- name: Setup Micromamba
68-
uses: mamba-org/[email protected].0
68+
uses: mamba-org/[email protected].3
6969
with:
7070
environment-name: pygmt
7171
condarc: |
@@ -101,7 +101,7 @@ jobs:
101101
102102
# Download cached remote files (artifacts) from GitHub
103103
- name: Download remote data from GitHub
104-
uses: dawidd6/action-download-artifact@v2.28.0
104+
uses: dawidd6/action-download-artifact@v3.0.0
105105
with:
106106
workflow: cache_data.yaml
107107
workflow_conclusion: success

.github/workflows/ci_doctests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
# Install Micromamba with conda-forge dependencies
4242
- name: Setup Micromamba
43-
uses: mamba-org/[email protected].0
43+
uses: mamba-org/[email protected].3
4444
with:
4545
environment-name: pygmt
4646
condarc: |
@@ -69,7 +69,7 @@ jobs:
6969
7070
# Download cached remote files (artifacts) from GitHub
7171
- name: Download remote data from GitHub
72-
uses: dawidd6/action-download-artifact@v2.28.0
72+
uses: dawidd6/action-download-artifact@v3.0.0
7373
with:
7474
workflow: cache_data.yaml
7575
workflow_conclusion: success

.github/workflows/ci_tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494

9595
# Install Micromamba with conda-forge dependencies
9696
- name: Setup Micromamba
97-
uses: mamba-org/[email protected].0
97+
uses: mamba-org/[email protected].3
9898
with:
9999
environment-name: pygmt
100100
condarc: |
@@ -123,7 +123,7 @@ jobs:
123123
124124
# Download cached remote files (artifacts) from GitHub
125125
- name: Download remote data from GitHub
126-
uses: dawidd6/action-download-artifact@v2.28.0
126+
uses: dawidd6/action-download-artifact@v3.0.0
127127
with:
128128
workflow: cache_data.yaml
129129
workflow_conclusion: success

.github/workflows/ci_tests_dev.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888

8989
# Install Micromamba with conda-forge dependencies
9090
- name: Setup Micromamba
91-
uses: mamba-org/[email protected].0
91+
uses: mamba-org/[email protected].3
9292
with:
9393
environment-name: pygmt
9494
condarc: |
@@ -169,7 +169,7 @@ jobs:
169169
170170
# Download cached remote files (artifacts) from GitHub
171171
- name: Download remote data from GitHub
172-
uses: dawidd6/action-download-artifact@v2.28.0
172+
uses: dawidd6/action-download-artifact@v3.0.0
173173
with:
174174
workflow: cache_data.yaml
175175
workflow_conclusion: success

.github/workflows/ci_tests_legacy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252

5353
# Install Micromamba with conda-forge dependencies
5454
- name: Setup Micromamba
55-
uses: mamba-org/[email protected].0
55+
uses: mamba-org/[email protected].3
5656
with:
5757
environment-name: pygmt
5858
condarc: |
@@ -85,7 +85,7 @@ jobs:
8585
8686
# Download cached remote files (artifacts) from GitHub
8787
- name: Download remote data from GitHub
88-
uses: dawidd6/action-download-artifact@v2.28.0
88+
uses: dawidd6/action-download-artifact@v3.0.0
8989
with:
9090
workflow: cache_data.yaml
9191
workflow_conclusion: success

pygmt/clib/session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ def print_func(file_pointer, message):
381381
self._error_log.append(message)
382382
# flush to make sure the messages are printed even if we have a
383383
# crash.
384-
print(message, file=sys.stderr, flush=True)
384+
print(message, file=sys.stderr, flush=True) # noqa: T201
385385
return 0
386386

387387
# Need to store a copy of the function because ctypes doesn't and it

pygmt/helpers/decorators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@
281281
""",
282282
"projection": r"""
283283
projection : str
284-
*projcode*\[*projparams*/]\ *width*\ |*scale*.
284+
*projcode*\[*projparams*/]\ *width*\|\ *scale*.
285285
Select map :doc:`projection </projections/index>`.""",
286286
"region": r"""
287287
region : str or list
@@ -438,7 +438,7 @@ def fmt_docstring(module_func):
438438
*xmin/xmax/ymin/ymax*\ [**+r**][**+u**\ *unit*].
439439
Specify the :doc:`region </tutorials/basics/regions>` of interest.
440440
projection : str
441-
*projcode*\[*projparams*/]\ *width*\ |*scale*.
441+
*projcode*\[*projparams*/]\ *width*\|\ *scale*.
442442
Select map :doc:`projection </projections/index>`.
443443
<BLANKLINE>
444444
**Aliases:**

pygmt/tests/test_clib_virtualfiles.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def test_virtual_file_fails():
8080
with clib.Session() as lib, mock(lib, "GMT_Open_VirtualFile", returns=1):
8181
with pytest.raises(GMTCLibError):
8282
with lib.open_virtual_file(*vfargs):
83-
print("Should not get to this code")
83+
pass
8484

8585
# Test the status check when closing the virtual file
8686
# Mock the opening to return 0 (success) so that we don't open a file that
@@ -91,7 +91,6 @@ def test_virtual_file_fails():
9191
with pytest.raises(GMTCLibError):
9292
with lib.open_virtual_file(*vfargs):
9393
pass
94-
print("Shouldn't get to this code either")
9594

9695

9796
def test_virtual_file_bad_direction():
@@ -107,7 +106,7 @@ def test_virtual_file_bad_direction():
107106
)
108107
with pytest.raises(GMTInvalidInput):
109108
with lib.open_virtual_file(*vfargs):
110-
print("This should have failed")
109+
pass
111110

112111

113112
@pytest.mark.parametrize(
@@ -280,7 +279,7 @@ def test_virtualfile_from_vectors_diff_size():
280279
with clib.Session() as lib:
281280
with pytest.raises(GMTInvalidInput):
282281
with lib.virtualfile_from_vectors(x, y):
283-
print("This should have failed")
282+
pass
284283

285284

286285
def test_virtualfile_from_matrix(dtypes):

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,11 @@ select = [
117117
"PGH", # pygrep-hooks
118118
"PIE", # flake8-pie
119119
"PL", # pylint
120+
"RET", # flake8-return
120121
"RSE", # flake8-raise
121122
"S", # flake8-bandit
122123
"SIM", # flake8-simplify
124+
"T20", # flake8-print
123125
"TCH", # flake8-type-checking
124126
"TID", # flake8-tidy-imports
125127
"UP", # pyupgrade
@@ -131,6 +133,7 @@ ignore = [
131133
"ISC001", # Single-line-implicit-string-concatenation, conflict with formatter
132134
"PD901", # Allow using the generic variable name `df` for DataFrames
133135
"PLR2004", # Allow any magic values
136+
"RET504", # Allow variable assignment and return immediately for readability
134137
"S603", # Allow method calls that initiate a subprocess without a shell
135138
"SIM117", # Allow nested `with` statements
136139
]
@@ -141,6 +144,7 @@ known-third-party = ["pygmt"]
141144
[tool.ruff.lint.per-file-ignores]
142145
"__init__.py" = ["F401"] # Ignore `F401` (unused-import) in all `__init__.py` files
143146
"*/tests/test_*.py" = ["S101"] # Ignore `S101` (use of assert) in all tests files
147+
"examples/**/*.py" = ["T201"] # Allow `print` in examples
144148

145149
[tool.ruff.lint.pycodestyle]
146150
max-doc-length = 79

0 commit comments

Comments
 (0)