Skip to content

Commit 974d950

Browse files
seismanweiji14
andauthored
Add dependency groups to pyproject.toml following PEP 735 (#4950)
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
1 parent 5986d82 commit 974d950

5 files changed

Lines changed: 20 additions & 5 deletions

File tree

‎.github/workflows/ci_tests_dev.yaml‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ jobs:
146146
--extra-index https://pypi.anaconda.org/scientific-python-nightly-wheels/simple \
147147
numpy pandas xarray packaging \
148148
build contextily geopandas ipython pyarrow rioxarray \
149-
pytest pytest-cov pytest-doctestplus pytest-mpl pytest-rerunfailures \
150-
netCDF4 sphinx-gallery
149+
--group test
151150
152151
# Show installed pkg information for postmortem diagnostic
153152
- name: List installed packages

‎.github/workflows/format-command.yml‎

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

4141
- name: Install formatting tools
4242
run: |
43-
python -m pip install ruff prek
43+
python -m pip install --group style
4444
python -m pip list
4545
4646
# Run "make format" and commit the change to the PR branch

‎.github/workflows/style_checks.yaml‎

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

3838
- name: Install packages
3939
run: |
40-
python -m pip install ruff prek
40+
python -m pip install --group style
4141
python -m pip list
4242
4343
- name: Formatting check (Ruff + prek)

‎.github/workflows/type_checks.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
# 1. required packages
5252
# 2. type checker and stub packages
5353
# 3. other packages that are used somewhere in PyGMT
54-
python -m pip install numpy pandas xarray packaging mypy pandas-stubs pyarrow-stubs
54+
python -m pip install numpy pandas xarray packaging --group typing
5555
python -m pip list
5656
5757
- name: Static type check

‎pyproject.toml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,22 @@ gmt = "pygmt.xarray:GMTBackendEntrypoint"
6161
"Changelog" = "https://www.pygmt.org/latest/changes.html"
6262
"Issue Tracker" = "https://github.com/GenericMappingTools/pygmt/issues"
6363

64+
[dependency-groups]
65+
style = [
66+
"prek",
67+
"ruff>=0.15.22",
68+
]
69+
test=[
70+
"netCDF4",
71+
"pytest>=6.0",
72+
"pytest-cov",
73+
"pytest-doctestplus",
74+
"pytest-mpl",
75+
"pytest-rerunfailures",
76+
"sphinx-gallery"
77+
]
78+
typing = ["mypy", "pandas-stubs", "pyarrow-stubs"]
79+
6480
[tool.setuptools.packages.find]
6581
include = ["pygmt*"]
6682
exclude = ["doc"]

0 commit comments

Comments
 (0)