Skip to content

Commit bbcc8ba

Browse files
mwtoewsJamesParrott
authored andcommitted
Use dependency groups for dev and test (PEP 735)
Add "mypy" to "lint" group Four-space formatting Try ../Pyshp/pyproject.toml specify --group <path-to-pyproject.toml>:test Install deps separately for downloaded wheels
1 parent 27f2f8a commit bbcc8ba

3 files changed

Lines changed: 23 additions & 13 deletions

File tree

.github/actions/test/action.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@ runs:
7676
shell: bash
7777
working-directory: dist/
7878
run: |
79+
python -m pip install --upgrade pip
7980
WHEEL_NAME=$(ls pyshp-*py3-none-any.whl)
80-
python -m pip install $WHEEL_NAME[test]
81+
python -m pip install $WHEEL_NAME --group ../Pyshp/pyproject.toml:test
8182
8283
- name: Doctests
8384
shell: bash
@@ -113,4 +114,4 @@ runs:
113114
shell: bash
114115
run: |
115116
echo Killing http server process ID: ${{ env.HTTP_SERVER_PID }}
116-
kill ${{ env.HTTP_SERVER_PID }}
117+
kill ${{ env.HTTP_SERVER_PID }}

.github/workflows/speed_test.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,17 @@ jobs:
4444
name: PyShp_wheel_and_sdist
4545
path: dist
4646

47+
- uses: actions/checkout@v6
48+
with:
49+
path: ./Pyshp
50+
4751
- name: Install PyShp + test deps from the wheel (downloaded in prev step)
4852
shell: bash
4953
working-directory: dist/
5054
run: |
55+
python -m pip install --upgrade pip
5156
WHEEL_NAME=$(ls pyshp-*py3-none-any.whl)
52-
python -m pip install $WHEEL_NAME[test]
53-
54-
- uses: actions/checkout@v6
55-
with:
56-
path: ./Pyshp
57-
58-
57+
python -m pip install $WHEEL_NAME --group ../Pyshp/pyproject.toml:test
5958
6059
- name: Checkout shapefiles and zip file artefacts repo
6160
uses: actions/checkout@v6

pyproject.toml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,24 @@ classifiers = [
2626
"Topic :: Software Development :: Libraries",
2727
"Topic :: Software Development :: Libraries :: Python Modules",
2828
]
29-
dependencies = [
30-
]
3129

3230
[project.optional-dependencies]
33-
dev = ["pyshp[test]", "pre-commit", "ruff"]
34-
test = ["pytest"]
3531
stubs=["pyshp-stubs"]
3632

33+
[dependency-groups]
34+
dev = [
35+
{include-group = "lint"},
36+
{include-group = "test"}
37+
]
38+
lint = [
39+
"mypy",
40+
"pre-commit",
41+
"ruff",
42+
]
43+
test = [
44+
"pytest",
45+
]
46+
3747
[project.urls]
3848
Repository = "https://github.com/GeospatialPython/pyshp"
3949

0 commit comments

Comments
 (0)