Skip to content

Commit

Permalink
update ci config
Browse files Browse the repository at this point in the history
  • Loading branch information
karlicoss committed Apr 21, 2021
1 parent e3eeca3 commit 32bb63e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
14 changes: 8 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ on:
tags: 'v[0-9]+.*' # only trigger on 'release' tags for PyPi
# Ideally I would put this in the pypi job... but github syntax doesn't allow for regexes there :shrug:
# P.S. fuck made up yaml DSLs.
# TODO cron?
pull_request: # needed to trigger on others' PRs
# 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".
workflow_dispatch: # needed to trigger workflows manually
# todo cron?

env:
# useful for scripts & sometimes tests to know
Expand All @@ -18,8 +20,8 @@ jobs:
build:
strategy:
matrix:
platform: [ubuntu-latest] # macos-latest] # TODO windows-latest??
python-version: [3.6, 3.7, 3.8]
platform: [ubuntu-latest, macos-latest] # TODO windows-latest??
python-version: [3.6, 3.7, 3.8, 3.9]

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

Expand All @@ -36,7 +38,7 @@ jobs:
submodules: recursive

# uncomment for SSH debugging
# - uses: mxschmitt/action-tmate@v2
# - uses: mxschmitt/action-tmate@v3

- run: .ci/run

Expand Down Expand Up @@ -64,15 +66,15 @@ jobs:

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

- name: 'release to pypi'
# always deploy tags to release pypi
# NOTE: release tags are guarded by on: push: tags on the top
if: startsWith(github.event.ref, 'refs/tags')
if: github.event_name != 'pull_request' && startsWith(github.event.ref, 'refs/tags')
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: pip3 install --user wheel twine && .ci/release
4 changes: 2 additions & 2 deletions orgparse/node.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import re
import itertools
from typing import List, Iterable, Iterator, Optional, Union, Tuple, cast, Dict, Set, Sequence
from typing import List, Iterable, Iterator, Optional, Union, Tuple, cast, Dict, Set, Sequence, Any
try:
from collections.abc import Sequence
except ImportError:
Expand Down Expand Up @@ -201,7 +201,7 @@ def parse_duration_to_minutes_float(duration: str) -> float:
0.0
"""

match: Optional[re.Match[str]]
match: Optional[Any]
if duration == "":
return 0.0
if isinstance(duration, float):
Expand Down
9 changes: 9 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[pytest]
# discover files that don't follow test_ naming. Useful to keep tests along with the source code
python_files = *.py
addopts =
-rap
--verbose

# otherwise it won't discover doctests
--doctest-modules
9 changes: 5 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
[tox]
minversion = 3.5
# relies on the correct version of Python installed
envlist = py3,mypy
envlist = tests,mypy

[testenv]
passenv = CI CI_*

[testenv:tests]
commands =
pip install -e .[testing]
python -m pytest -rap --doctest-modules --ignore-glob='**/_py3compat.py' orgparse {posargs}

python -m pytest --ignore-glob='**/_py3compat.py' orgparse {posargs}

[testenv:mypy]
skip_install = true
commands =
pip install -e .[linting]
python -m mypy orgparse \
Expand Down

0 comments on commit 32bb63e

Please sign in to comment.