Skip to content

Commit 6c69fb6

Browse files
authored
Unpin docformatter 1.5.1 (#2538)
* Unpin docformatter 1.5.1 Docformatter=1.7.0 has a `--black` option to make it compatible with the black linter. Also updated a few docstrings in the unit test where docformatter tried to capitalize the first letter. * Lint with docformatter=1.7.2 Shorten some docstrings to remove whitespace. * Bump minimum docformatter version to 1.7.2 in environment.yml Skip docformatter=1.7.1 as it was a bit buggy, see docformatter=1.7.2 release notes at https://github.com/PyCQA/docformatter/releases/tag/v1.7.2.
1 parent 7404011 commit 6c69fb6

9 files changed

+14
-15
lines changed

.github/workflows/format-command.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
# Install formatting tools
3333
- name: Install formatting tools
3434
run: |
35-
python -m pip install black blackdoc docformatter==1.5.1 flakeheaven isort
35+
python -m pip install black blackdoc docformatter flakeheaven isort
3636
sudo apt-get install dos2unix
3737
3838
# Run "make format" and commit the change to the PR branch

.github/workflows/style_checks.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434

3535
- name: Install packages
3636
run: |
37-
python -m pip install black blackdoc docformatter==1.5.1 flakeheaven pylint isort
37+
python -m pip install black blackdoc docformatter flakeheaven pylint isort
3838
sudo apt-get install dos2unix
3939
4040
- name: Formatting check (black, blackdoc, docformatter, flakeheaven and isort)

environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies:
2424
# Dev dependencies (style checks)
2525
- black
2626
- blackdoc
27-
- docformatter>=1.5.0,<1.6.0
27+
- docformatter>=1.7.2
2828
- flakeheaven>=3
2929
- isort>=5
3030
- pylint

pygmt/tests/test_grdcut.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def fixture_expected_grid():
4444

4545
def test_grdcut_dataarray_in_file_out(grid, expected_grid, region):
4646
"""
47-
grdcut an input DataArray, and output to a grid file.
47+
Test grdcut on an input DataArray, and output to a grid file.
4848
"""
4949
with GMTTempFile(suffix=".nc") as tmpfile:
5050
result = grdcut(grid, outgrid=tmpfile.name, region=region)
@@ -55,7 +55,7 @@ def test_grdcut_dataarray_in_file_out(grid, expected_grid, region):
5555

5656
def test_grdcut_dataarray_in_dataarray_out(grid, expected_grid, region):
5757
"""
58-
grdcut an input DataArray, and output as DataArray.
58+
Test grdcut on an input DataArray, and output as DataArray.
5959
"""
6060
outgrid = grdcut(grid, region=region)
6161
assert isinstance(outgrid, xr.DataArray)

pygmt/tests/test_grdproject.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def fixture_expected_grid():
4242

4343
def test_grdproject_file_out(grid, expected_grid):
4444
"""
45-
grdproject with an outgrid set.
45+
Test grdproject with an outgrid set.
4646
"""
4747
with GMTTempFile(suffix=".nc") as tmpfile:
4848
result = grdproject(

pygmt/tests/test_plot.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -381,11 +381,11 @@ def test_plot_lines_with_arrows():
381381
"""
382382
Plot lines with arrows.
383383
384-
The test is slightly different from test_plot_vectors().
385-
Here the vectors are plotted as lines, with arrows at the end.
384+
The test is slightly different from test_plot_vectors(). Here the vectors
385+
are plotted as lines, with arrows at the end.
386386
387-
The test also checks if the API crashes.
388-
See https://github.com/GenericMappingTools/pygmt/issues/406.
387+
The test also checks if the API crashes. See
388+
https://github.com/GenericMappingTools/pygmt/issues/406.
389389
"""
390390
fig = Figure()
391391
fig.basemap(region=[-2, 2, -2, 2], frame=True)

pygmt/tests/test_plot3d.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ def fixture_region():
3333
@pytest.mark.mpl_image_compare
3434
def test_plot3d_red_circles_zscale(data, region):
3535
"""
36-
Plot the 3-D data in red circles passing in vectors and setting
37-
zscale = 5
36+
Plot the 3-D data in red circles passing in vectors and setting zscale=5.
3837
"""
3938
fig = Figure()
4039
fig.plot3d(
@@ -55,8 +54,7 @@ def test_plot3d_red_circles_zscale(data, region):
5554
@pytest.mark.mpl_image_compare
5655
def test_plot3d_red_circles_zsize(data, region):
5756
"""
58-
Plot the 3-D data in red circles passing in vectors and setting
59-
zsize = "6c"
57+
Plot the 3-D data in red circles passing in vectors and setting zsize="6c".
6058
"""
6159
fig = Figure()
6260
fig.plot3d(

pygmt/tests/test_psconvert.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
def test_psconvert():
1212
"""
13-
psconvert creates a figure in the current directory.
13+
Check that psconvert creates a figure in the current directory.
1414
"""
1515
fig = Figure()
1616
fig.basemap(region="10/70/-3/8", projection="X4i/3i", frame="a")

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ line-length = 79
7575
omit = ["*/tests/*", "*pygmt/__init__.py"]
7676

7777
[tool.docformatter]
78+
black = true
7879
recursive = true
7980
pre-summary-newline = true
8081
make-summary-multi-line = true

0 commit comments

Comments
 (0)