Skip to content

Commit 978b301

Browse files
committed
Update poetry version and ci.yaml
1 parent 9af693c commit 978b301

File tree

4 files changed

+37
-19
lines changed

4 files changed

+37
-19
lines changed

.github/workflows/ci.yaml

+28-9
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,45 @@ jobs:
66
test:
77
runs-on: ubuntu-latest
88
strategy:
9-
fail-fast: false
9+
fail-fast: true
1010
matrix:
11-
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
11+
python: ["3.9", "3.10", "3.11", "3.12"]
12+
poetry-version: [1.8.2]
1213

1314
steps:
1415
- uses: actions/checkout@v4
1516
with:
1617
fetch-depth: 1
1718

18-
- name: Set up Python
19+
- name: Set up Python ${{ matrix.python }}
1920
uses: actions/setup-python@v5
2021
with:
2122
python-version: ${{ matrix.python }}
2223

23-
- name: Install Dependencies
24-
run: |
25-
python -m pip install --upgrade pip
26-
pip install -r requirements.txt
24+
- name: Set up Poetry ${{ matrix.poetry-version }}
25+
uses: abatilo/[email protected]
26+
with:
27+
poetry-version: ${{ matrix.poetry-version }}
28+
29+
- name: Set up cache
30+
uses: actions/[email protected]
31+
id: cache
32+
with:
33+
path: .venv
34+
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
35+
36+
- name: Ensure cache is healthy
37+
if: steps.cache.outputs.cache-hit == 'true'
38+
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
39+
40+
- name: Install dependencies
41+
if: steps.cache.outputs.cache-hit != 'true'
42+
run: poetry install
2743

2844
- name: Code Quality
2945
run: |
30-
pip install black
31-
black -l 80 --check .
46+
poetry run black -l 80 --check .
47+
48+
- name: Unit tests
49+
run: |
50+
poetry run pytest --cov .

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ pytest-cov = "^5.0.0"
4545
mypy = "^1.9.0"
4646

4747
[build-system]
48-
requires = ["poetry>=1.1.2"]
48+
requires = ["poetry>=1.8.2"]
4949
build-backend = "poetry.masonry.api"

tests/test_map.py

+6-7
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,17 @@
77

88
@pytest.fixture
99
def map_properties() -> Dict[str, Any]:
10-
return dict(identifier="gmap",
11-
varname="gmap",
12-
lat=37.4419,
13-
lng=-122.1419)
10+
return dict(identifier="gmap", varname="gmap", lat=37.4419, lng=-122.1419)
1411

1512

1613
@pytest.fixture
1714
def markers() -> List[Dict]:
1815
return [
1916
{
20-
"content": {"icon_url": "http://maps.google.com/"
21-
"mapfiles/ms/icons/green-dot.png"},
17+
"content": {
18+
"icon_url": "http://maps.google.com/"
19+
"mapfiles/ms/icons/green-dot.png"
20+
},
2221
"latitude": 37.4419,
2322
"longitude": -122.1419,
2423
"infobox": "<b>Hello World</b>",
@@ -33,7 +32,7 @@ def markers() -> List[Dict]:
3332
"background": "",
3433
"glyph": "",
3534
"scale": 2.0,
36-
}
35+
},
3736
},
3837
]
3938

tests/test_marker.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ def marker_pin_url() -> Marker:
2121
longitude=-122.1419,
2222
content={
2323
"icon_url": "https://developers.google.com/maps/"
24-
"documentation/javascript/examples/"
25-
"full/images/beachflag.png"
24+
"documentation/javascript/examples/"
25+
"full/images/beachflag.png"
2626
},
2727
infobox="<b>Hello World</b>",
2828
)

0 commit comments

Comments
 (0)