Skip to content

Commit 32bb63e

Browse files
committed
update ci config
1 parent e3eeca3 commit 32bb63e

4 files changed

Lines changed: 24 additions & 12 deletions

File tree

.github/workflows/main.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ on:
77
tags: 'v[0-9]+.*' # only trigger on 'release' tags for PyPi
88
# Ideally I would put this in the pypi job... but github syntax doesn't allow for regexes there :shrug:
99
# P.S. fuck made up yaml DSLs.
10-
# TODO cron?
10+
pull_request: # needed to trigger on others' PRs
11+
# Note that people who fork it need to go to "Actions" tab on their fork and click "I understand my workflows, go ahead and enable them".
1112
workflow_dispatch: # needed to trigger workflows manually
13+
# todo cron?
1214

1315
env:
1416
# useful for scripts & sometimes tests to know
@@ -18,8 +20,8 @@ jobs:
1820
build:
1921
strategy:
2022
matrix:
21-
platform: [ubuntu-latest] # macos-latest] # TODO windows-latest??
22-
python-version: [3.6, 3.7, 3.8]
23+
platform: [ubuntu-latest, macos-latest] # TODO windows-latest??
24+
python-version: [3.6, 3.7, 3.8, 3.9]
2325

2426
runs-on: ${{ matrix.platform }}
2527

@@ -36,7 +38,7 @@ jobs:
3638
submodules: recursive
3739

3840
# uncomment for SSH debugging
39-
# - uses: mxschmitt/action-tmate@v2
41+
# - uses: mxschmitt/action-tmate@v3
4042

4143
- run: .ci/run
4244

@@ -64,15 +66,15 @@ jobs:
6466

6567
- name: 'release to test pypi'
6668
# always deploy merged master to test pypi
67-
if: github.event.ref == 'refs/heads/master'
69+
if: github.event_name != 'pull_request' && github.event.ref == 'refs/heads/master'
6870
env:
6971
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_TEST }}
7072
run: pip3 install --user wheel twine && .ci/release --test
7173

7274
- name: 'release to pypi'
7375
# always deploy tags to release pypi
7476
# NOTE: release tags are guarded by on: push: tags on the top
75-
if: startsWith(github.event.ref, 'refs/tags')
77+
if: github.event_name != 'pull_request' && startsWith(github.event.ref, 'refs/tags')
7678
env:
7779
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
7880
run: pip3 install --user wheel twine && .ci/release

orgparse/node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import re
22
import itertools
3-
from typing import List, Iterable, Iterator, Optional, Union, Tuple, cast, Dict, Set, Sequence
3+
from typing import List, Iterable, Iterator, Optional, Union, Tuple, cast, Dict, Set, Sequence, Any
44
try:
55
from collections.abc import Sequence
66
except ImportError:
@@ -201,7 +201,7 @@ def parse_duration_to_minutes_float(duration: str) -> float:
201201
0.0
202202
"""
203203

204-
match: Optional[re.Match[str]]
204+
match: Optional[Any]
205205
if duration == "":
206206
return 0.0
207207
if isinstance(duration, float):

pytest.ini

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[pytest]
2+
# discover files that don't follow test_ naming. Useful to keep tests along with the source code
3+
python_files = *.py
4+
addopts =
5+
-rap
6+
--verbose
7+
8+
# otherwise it won't discover doctests
9+
--doctest-modules

tox.ini

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
[tox]
22
minversion = 3.5
33
# relies on the correct version of Python installed
4-
envlist = py3,mypy
4+
envlist = tests,mypy
55

66
[testenv]
7+
passenv = CI CI_*
8+
9+
[testenv:tests]
710
commands =
811
pip install -e .[testing]
9-
python -m pytest -rap --doctest-modules --ignore-glob='**/_py3compat.py' orgparse {posargs}
10-
12+
python -m pytest --ignore-glob='**/_py3compat.py' orgparse {posargs}
1113

1214
[testenv:mypy]
13-
skip_install = true
1415
commands =
1516
pip install -e .[linting]
1617
python -m mypy orgparse \

0 commit comments

Comments
 (0)