File tree Expand file tree Collapse file tree 4 files changed +119
-53
lines changed Expand file tree Collapse file tree 4 files changed +119
-53
lines changed Original file line number Diff line number Diff line change
1
+ name :
2
+ Test
3
+
4
+ description :
5
+ Run pytest, and run the doctest runner (shapefile.py as a script).
6
+
7
+ runs :
8
+ using : " composite"
9
+ steps :
10
+ # The Repo is required to already be checked out, e.g. by the calling workflow
11
+
12
+ # The Python to be tested with is required to already be setup, with "python" and "pip" on the system Path
13
+
14
+ - name : Doctests
15
+ shell : bash
16
+ run : python shapefile.py
17
+
18
+ - name : Install test dependencies.
19
+ shell : bash
20
+ run : |
21
+ python -m pip install --upgrade pip
22
+ pip install -r requirements.test.txt
23
+
24
+ - name : Pytest
25
+ shell : bash
26
+ run : |
27
+ pytest
28
+
29
+ - name : Show versions for logs.
30
+ shell : bash
31
+ run : |
32
+ python --version
33
+ python -m pytest --version
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -23,13 +23,24 @@ jobs:
23
23
uses : actions/setup-python@v2
24
24
with :
25
25
python-version : ' 3.x'
26
+
27
+ # In general tests should be run after building a distribution, to test that distribution.
28
+ # However as long as PyShp is a pure Python library, with pure Python deps (or no deps)
29
+ # then it's not crucial.
30
+
31
+ # Prevent deployment of releases that fail any hooks (e.g. linting) or that fail any tests.
32
+ - name : Run tests and hooks
33
+ uses : ./.github/workflows/run_tests_and_hooks.yml
34
+
26
35
- name : Install dependencies
27
36
run : |
28
37
python -m pip install --upgrade pip
29
38
pip install build
30
39
- name : Build package
31
40
run : python -m build
41
+
32
42
- name : Publish package
43
+ if : github.repository == 'GeospatialPython/pyshp'
33
44
uses : pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
34
45
with :
35
46
user : __token__
Original file line number Diff line number Diff line change
1
+ # This workflow will run the pre-commit hooks (including linters), and the tests with a variety of Python versions
2
+
3
+ name : Run pre-commit hooks and tests
4
+
5
+ on :
6
+ push :
7
+ pull_request :
8
+ branches : [ master ]
9
+ workflow_call :
10
+ workflow_dispatch :
11
+
12
+ jobs :
13
+ pre-commit :
14
+ runs-on : ubuntu-latest
15
+ steps :
16
+ - uses : actions/checkout@v4
17
+ - uses : actions/setup-python@v5
18
+ -
uses :
pre-commit/[email protected]
19
+
20
+ test_in_slim_Python_containers :
21
+ strategy :
22
+ fail-fast : false
23
+ matrix :
24
+ python-version : [
25
+ " 2.7" ,
26
+ " 3.5" ,
27
+ " 3.6" ,
28
+ " 3.7" ,
29
+ " 3.8" ,
30
+ " 3.9" ,
31
+ " 3.10" ,
32
+ " 3.11" ,
33
+ " 3.12" ,
34
+ " 3.13.0a2" ,
35
+ ]
36
+
37
+ runs-on : ubuntu-latest
38
+ container :
39
+ image : python:${{ matrix.python-version }}-slim
40
+
41
+ steps :
42
+ - uses : actions/checkout@v4
43
+
44
+ - name : Run tests
45
+ uses : ./.github/actions/test
46
+
47
+
48
+ test_on_MacOS_and_Windows :
49
+ if : github.repository == 'GeospatialPython/pyshp'
50
+ strategy :
51
+ fail-fast : false
52
+ matrix :
53
+ python-version : [
54
+ " 3.12" ,
55
+ ]
56
+ os : [
57
+ " macos-latest" ,
58
+ " windows-latest" ,
59
+ ]
60
+ # include:
61
+ # - os: "windows-latest"
62
+ # python-version: "3.13"
63
+ # - os: "macos-latest"
64
+ # python-version: "3.13"
65
+
66
+ runs-on : matrix.os
67
+ steps :
68
+ - uses : actions/checkout@v4
69
+
70
+ - uses : actions/setup-python@v5
71
+ with :
72
+ python-version : ${{ inputs.python_version }}
73
+
74
+ - name : Run tests
75
+ uses : ./.github/actions/test
You can’t perform that action at this time.
0 commit comments