Skip to content

Commit

Permalink
fix: use py 3.9 and fix mypy (#57)
Browse files Browse the repository at this point in the history
* fix: update .github workflows to use py 3.9

* fix: static type checker mypy needs these changes

typing.List is better than typing.Sequence, apparently in loaders.py and
install the types packages for Markdown and Python.

* fix: mypy fails because needs deps in setyp.py

We need to install the package even though it is a static checker because
it relies on some installed packages that contain type declarations.

Fixes: #56
  • Loading branch information
shwoodard authored May 12, 2022
1 parent 9f6be8c commit 162a66e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
inspect:
runs-on: ubuntu-latest
container: python:3.8
container: python:3.9
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
prerelease: false
pypi_release:
runs-on: ubuntu-latest
container: python:3.8
container: python:3.9
needs:
- inspect
- github_release
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
tests:
runs-on: ubuntu-latest
container: python:3.8
container: python:3.9
steps:
- uses: actions/checkout@v2
- name: Install package.
Expand All @@ -17,7 +17,7 @@ jobs:
run: pytest
build:
runs-on: ubuntu-latest
container: python:3.8
container: python:3.9
steps:
- uses: actions/checkout@v2
- name: Install package.
Expand All @@ -26,7 +26,7 @@ jobs:
run: aip-site-gen tests/test_data/ /out/
lint:
runs-on: ubuntu-latest
container: python:3.8
container: python:3.9
steps:
- uses: actions/checkout@v2
- name: Install the linter (flake8).
Expand All @@ -35,9 +35,11 @@ jobs:
run: flake8 aip_site/ tests/
mypy:
runs-on: ubuntu-latest
container: python:3.8
container: python:3.9
steps:
- uses: actions/checkout@v2
- name: Install package.
run: pip install .
- name: Install mypy.
run: pip install mypy
- name: Run mypy.
Expand Down
2 changes: 1 addition & 1 deletion aip_site/jinja/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_source(self, env, template: str) -> typing.Tuple[str, str, None]:
# Return the template information.
return contents, fn, None

def list_templates(self) -> typing.Sequence[str]:
def list_templates(self) -> typing.List[str]:
answer = []

# We sort the files in the directory to read more specific
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
'pyscss==1.3.7',
'pyyaml==5.4.1',
'six==1.16.0',
'types-Markdown==3.3.15',
'types-PyYAML==6.0.7',
'werkzeug==2.0.1',
),
python_requires='>=3.8',
Expand Down

0 comments on commit 162a66e

Please sign in to comment.