New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run linter and tests in CI build #48
Changes from 12 commits
fbc32eb
37449ea
7c8a221
25f8855
ad18c9c
8c3a3af
f78c3f4
96db55c
f591272
81340b4
be18e00
108a3bd
9f7ccfb
8d454b9
9f86236
6edc366
0efe8b7
39134f8
9ff82c3
eab3bf4
166cc1d
96042bc
08feace
985968c
0f33933
4e7ce32
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,56 @@ | ||
name: Test | ||
name: Build | ||
|
||
on: [push, pull_request, workflow_dispatch] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
test: | ||
name: "Test" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Poetry | ||
run: pipx install poetry | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
uses: actions/setup-python@v4 | ||
with: | ||
cache: poetry | ||
python-version: "3.9" | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: poetry install | ||
# TODO run tests | ||
- name: Test | ||
run: poetry run pytest | ||
black: | ||
girotobial marked this conversation as resolved.
Show resolved
Hide resolved
|
||
name: "Black" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Poetry | ||
run: pipx install poetry | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
cache: poetry | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: poetry install | ||
- name: Black | ||
run: poetry run black --check src | ||
mypy: | ||
name: "MyPy" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Poetry | ||
run: pipx install poetry | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
cache: poetry | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: poetry install | ||
- name: MyPy | ||
run: poetry run mypy |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,9 +75,7 @@ def ahaversin(__haversin: float) -> float: | |
return acos(1 - 2 * __haversin) | ||
|
||
|
||
def greatcircle_distance( | ||
start: tuple[float, float], end: tuple[float, float] | ||
) -> float: | ||
def greatcircle_distance(start: tuple, end: tuple) -> float: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A better fix, would be `from typing import Tuple def greatcircle_distance(start: Tuple[float, float], end: Tuple[float, float]) -> float: We should avoid removing typing information as it will prevent mypy from picking up typing bugs. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea, I'd forgotten about the typing module |
||
"""[summary] | ||
|
||
Parameters | ||
|
@@ -135,7 +133,7 @@ def transform(s_epsg, t_epsg, s_x, s_y): | |
############################################################################## | ||
|
||
############################################################################## | ||
@functools.lru_cache(maxsize=2 ** 16) | ||
@functools.lru_cache(maxsize=2**16) | ||
def gtile_to_wgs84(til_x, til_y, zoomlevel): | ||
""" | ||
Returns the latitude and longitude of the top left corner of the tile | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe try without cache to see if it runs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alas turning off the cache did not work. Still see this: