Skip to content

Commit 216b429

Browse files
authored
Merge pull request #27 from Terradue/develop
Develop
2 parents fa0cf64 + 37e8114 commit 216b429

12 files changed

Lines changed: 406 additions & 377 deletions

File tree

.github/workflows/dump_stations.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
5151
- name: Run aeronet-client dump
5252
run: |
53-
aeronet-client dump-stations --verbose --output-file=./stations.parquet
53+
aeronet-client dump-stations --verbose --timeout 60 --output-file=./stations.parquet
5454
5555
- name: Configure git author
5656
run: |

.github/workflows/package.yaml

Lines changed: 56 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -12,65 +12,86 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
name: publish-to-pypi
15+
name: package
1616

1717
on:
1818
push:
1919
branches:
20+
- feature
21+
- feature/**
2022
- develop
2123
- main
22-
paths:
23-
- src/**
24-
- .github/workflows/package.yaml
25-
- README.md
26-
release:
27-
types:
28-
- published
24+
tags:
25+
- v*.*.*
2926
pull_request:
3027
branches:
28+
- feature
29+
- feature/**
3130
- develop
3231
- main
33-
paths:
34-
- src/**
3532

3633
permissions:
3734
contents: read
38-
packages: write
3935

4036
jobs:
37+
ci:
38+
if: github.event_name == 'pull_request' || startsWith(github.ref, 'refs/heads/')
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v6
42+
43+
- name: Set up Python
44+
uses: actions/setup-python@v6
45+
with:
46+
python-version: '3.12'
47+
cache: pip
48+
49+
- name: Install tooling
50+
run: pip install hatch ruff
51+
52+
- name: Ruff Check
53+
run: ruff check src tests
54+
55+
- name: Ruff Lint
56+
run: ruff format --check src tests
4157

42-
deploy:
58+
- name: Run tests
59+
run: hatch run dev:test --verbose
60+
61+
publish:
62+
if: startsWith(github.ref, 'refs/tags/v')
4363
runs-on: ubuntu-latest
4464
environment: release
4565
permissions:
46-
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
66+
id-token: write
67+
contents: read
4768
steps:
4869
- uses: actions/checkout@v6
70+
4971
- name: Set up Python
5072
uses: actions/setup-python@v6
5173
with:
52-
python-version: '3.10'
74+
python-version: '3.12'
5375
cache: pip
54-
- name: Install dependencies
76+
77+
- name: Install Hatch
78+
run: pip install hatch
79+
80+
- name: Verify tag matches project version
5581
run: |
56-
# python -m pip install --upgrade pip
57-
# python -m pip install --upgrade pip
58-
pip install hatch
82+
TAG_VERSION="${GITHUB_REF_NAME#v}"
83+
PROJECT_VERSION="$(hatch version)"
84+
85+
echo "Tag version: ${TAG_VERSION}"
86+
echo "Project version: ${PROJECT_VERSION}"
87+
88+
if [ "${TAG_VERSION}" != "${PROJECT_VERSION}" ]; then
89+
echo "Tag ${GITHUB_REF_NAME} does not match project version ${PROJECT_VERSION}"
90+
exit 1
91+
fi
92+
5993
- name: Build package
60-
run: "hatch build \n"
61-
- name: Test package
62-
run: |
63-
# hatch test
64-
pip install nose2
65-
pip install -e .
66-
nose2
67-
- name: Publish package distributions to PyPI (main)
68-
if: github.ref == 'refs/heads/main'
69-
uses: pypa/gh-action-pypi-publish@release/v1
70-
with:
71-
repository-url: https://upload.pypi.org/legacy/
72-
- name: Publish package distributions to PyPI (develop)
73-
if: github.ref != 'refs/heads/main'
74-
uses: pypa/gh-action-pypi-publish@release/v1
75-
with:
76-
repository-url: https://test.pypi.org/legacy/
94+
run: hatch build
95+
96+
- name: Publish package distributions to PyPI
97+
uses: pypa/gh-action-pypi-publish@v1.14.0

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,5 @@ cython_debug/
187187
.pypirc
188188

189189
.codex
190+
.task
191+
uv.lock

Taskfile.yml

Lines changed: 27 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -14,72 +14,40 @@
1414

1515
version: '3'
1616

17-
tasks:
18-
install_ruff:
19-
internal: true
20-
cmds:
21-
- pip install ruff pre-commit
22-
23-
base_ruff:
24-
deps:
25-
- install_ruff
26-
cmds:
27-
- ruff --version
28-
29-
ruff_check:
30-
deps:
31-
- install_ruff
32-
cmds:
33-
#ruff check --fix-only
34-
- ruff check --output-format=gitlab > code-quality-report.json
35-
36-
ruff_format:
37-
deps:
38-
- install_ruff
39-
cmds:
40-
- ruff format --diff
41-
42-
install_hatch:
43-
internal: true
44-
cmds:
45-
- pip install hatch
46-
47-
package:
48-
deps:
49-
- install_hatch
50-
cmds:
51-
- hatch build
52-
- hatch -e default run nose2 tests
17+
includes:
18+
openapi: https://raw.githubusercontent.com/Terradue/taskfile-utils/refs/heads/main/openapi.yaml
19+
quality: https://raw.githubusercontent.com/Terradue/taskfile-utils/refs/heads/main/quality.yaml
5320

54-
install_mkdocs:
55-
internal: true
56-
cmds:
57-
- pip install mkdocs-material mkdocs-mermaid2-plugin jupytext ipykernel bash_kernel mkdocs-jupyter legacy-cgi pdocs mkdocs-build-plantuml-plugin folium "numpy<2.0.0"
21+
tasks:
5822

5923
serve-docs:
60-
deps:
61-
- install_mkdocs
6224
cmds:
63-
- mkdocs serve
25+
- |
26+
uv run \
27+
--with mkdocs-material \
28+
--with mkdocs-mermaid2-plugin \
29+
--with jupytext \
30+
--with ipykernel \
31+
--with bash_kernel \
32+
--with mkdocs-jupyter \
33+
--with legacy-cgi \
34+
--with pdocs \
35+
--with mkdocs-build-plantuml-plugin \
36+
--with folium \
37+
--with numpy \
38+
mkdocs serve
6439
6540
run-clt:
6641
cmds:
67-
- cwltool cwl-clt/aeronet-client.cwl docs/cwl/inputs.yaml
68-
69-
install_openapi_prerequisites:
70-
internal: true
71-
cmds:
72-
- npm i -g @redocly/cli@latest
73-
- pip install openapi-python-client
42+
- cwltool cwl-clt/aeronet-client.cwl docs/cwl/inputs.yaml
7443

7544
generate_openapi:
76-
deps:
77-
- install_openapi_prerequisites
7845
cmds:
79-
- redocly build-docs ./schemas/aeronet_openapi.yaml --output=./docs/aeronet_openapi.html
80-
- |
81-
openapi-python-client generate \
82-
--meta none \
83-
--path ./schemas/aeronet_openapi.yaml \
84-
--output-path ./src/pygeofilter_aeronet/aeronet_client \
85-
--overwrite
46+
- task: openapi:generate_docs
47+
vars:
48+
API: './schemas/aeronet_openapi.yaml'
49+
OUTPUT: './docs/aeronet_openapi.html'
50+
- task: openapi:generate_client
51+
vars:
52+
API: './schemas/aeronet_openapi.yaml'
53+
OUTPUT: './src/pygeofilter_aeronet/aeronet_client'

pyproject.toml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "pygeofilter-aeronet"
77
dynamic = ["version"]
88
description = ''
99
readme = "README.md"
10-
requires-python = ">=3.8"
10+
requires-python = ">=3.10"
1111
license = "Apache-2.0"
1212
keywords = []
1313
authors = [
@@ -17,10 +17,11 @@ authors = [
1717
classifiers = [
1818
"Development Status :: 4 - Beta",
1919
"Programming Language :: Python",
20-
"Programming Language :: Python :: 3.9",
2120
"Programming Language :: Python :: 3.10",
2221
"Programming Language :: Python :: 3.11",
2322
"Programming Language :: Python :: 3.12",
23+
"Programming Language :: Python :: 3.13",
24+
"Programming Language :: Python :: 3.14",
2425
"Programming Language :: Python :: Implementation :: CPython",
2526
"Programming Language :: Python :: Implementation :: PyPy",
2627
]
@@ -54,6 +55,15 @@ Source = "https://github.com/Terradue/pygeofilter-aeronet"
5455
[tool.hatch.envs.prod]
5556
path = "/app/envs/aeronet-client"
5657

58+
[tool.hatch.envs.dev]
59+
extra-dependencies = [
60+
"pytest==9.0.2",
61+
"ruff==0.15.6",
62+
]
63+
[tool.hatch.envs.dev.scripts]
64+
lint = "ruff format src tests"
65+
check = "ruff check --fix src tests"
66+
5767
[project.scripts]
5868
aeronet-client = "pygeofilter_aeronet.cli:main"
5969

@@ -86,6 +96,25 @@ exclude_lines = [
8696
"if TYPE_CHECKING:",
8797
]
8898

99+
[tool.pytest.ini_options]
100+
python_files = [
101+
"test_*.py",
102+
"tests_*.py",
103+
]
89104

90105
[tool.hatch.envs.default.scripts]
91106
test = "hatch run nose2"
107+
108+
[tool.hatch.envs.test]
109+
description = "Test environment"
110+
skip-install = false
111+
dependencies = ["pytest==9.0.2", "pytest-cov==7.0.0"]
112+
113+
[tool.hatch.envs.test.scripts]
114+
test = "pytest"
115+
test-q = "pytest -q"
116+
test-cov = "pytest --cov=transpiler_mate"
117+
test-show-setup = "pytest --setup-show"
118+
119+
[[tool.hatch.envs.test.matrix]]
120+
python = ["3.10", "3.11", "3.12", "3.13", "3.14"]

0 commit comments

Comments
 (0)