Skip to content

Commit a56fdd3

Browse files
authored
Modernize CI (#85)
1 parent a7b879b commit a56fdd3

File tree

6 files changed

+51
-40
lines changed

6 files changed

+51
-40
lines changed

.github/workflows/main.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
include:
16+
- python-version: "3.10"
17+
optional-deps: true
18+
dependencies: "pandas==1.5.3 numpy==1.24.4"
19+
- python-version: "3.11"
20+
optional-deps: false
21+
dependencies: "pandas==2.0.3 numpy==1.24.4"
22+
- python-version: "3.11"
23+
optional-deps: true
24+
dependencies: "pandas==2.1.4 numpy==1.26.4"
25+
- python-version: "3.13"
26+
optional-deps: false
27+
dependencies: "pandas>2.2.0"
28+
29+
steps:
30+
- uses: actions/checkout@v3
31+
- name: Set up Python ${{ matrix.python-version }}
32+
uses: astral-sh/setup-uv@v5
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
- name: Install dependencies
36+
run: |
37+
uv pip install ${{ matrix.dependencies }}
38+
if [ "${{ matrix.optional-deps }}" = "true" ]; then
39+
uv pip install thefuzz[speedup]
40+
fi
41+
uv pip install -e .
42+
- name: Test with pytest
43+
run: |
44+
uv pip install pytest pytest-httpserver
45+
pytest

.github/workflows/python-tests.yml

-31
This file was deleted.

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ repos:
66
- id: end-of-file-fixer
77
- id: trailing-whitespace
88
- repo: https://github.com/astral-sh/ruff-pre-commit
9-
rev: "v0.8.6"
9+
rev: "v0.11.2"
1010
hooks:
1111
- id: ruff
1212
args: [--fix]
1313
- id: ruff-format
1414

1515

1616
- repo: https://github.com/pre-commit/mirrors-mypy
17-
rev: v1.14.1
17+
rev: v1.15.0
1818
hooks:
1919
- id: mypy
2020
files: ".+.py"

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ For additional documentation see
2020

2121
# Installation
2222

23-
pgeocode requires Python 3.10+ as well as `numpy` and `pandas` packages.
23+
pgeocode requires Python 3.10+ and the pandas 1.5.0+ package.
2424
It can be installed with,
2525

2626
```

doc/conf.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,5 @@
183183
# The following is used by sphinx.ext.linkcode to provide links to github
184184
linkcode_resolve = make_linkcode_resolve(
185185
"pgeocode",
186-
"https://github.com/symerio/"
187-
"pgeocode/blob/{revision}/"
188-
"{package}/{path}#L{lineno}",
186+
"https://github.com/symerio/pgeocode/blob/{revision}/{package}/{path}#L{lineno}",
189187
)

test_pgeocode.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ def test_open_extract_url(httpserver):
213213
"download_url",
214214
[
215215
"https://download.geonames.org/export/zip/{country}.zip",
216-
"https://symerio.github.io/postal-codes-data/data/" "geonames/{country}.txt",
216+
"https://symerio.github.io/postal-codes-data/data/geonames/{country}.txt",
217217
],
218218
ids=["geonames", "gitlab-pages"],
219219
)
@@ -245,8 +245,7 @@ def test_first_url_fails(httpserver, monkeypatch, temp_dir):
245245
"DOWNLOAD_URL",
246246
[
247247
httpserver.url_for(download_url),
248-
"https://symerio.github.io/postal-codes-data/data/"
249-
"geonames/{country}.txt",
248+
"https://symerio.github.io/postal-codes-data/data/geonames/{country}.txt",
250249
],
251250
)
252251
msg = "IE.txt failed with: HTTP Error 404.*Trying next URL"

0 commit comments

Comments
 (0)