Skip to content

Commit 9e945e6

Browse files
authored
Merge pull request #10 from Deltares-research/fix/testing-workflow
Fix(ci): testing workflow and pre-commit
2 parents efc4067 + d4ffde0 commit 9e945e6

30 files changed

+977
-665
lines changed

.github/workflows/lint.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/pre-commit.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
14+
- uses: pre-commit/[email protected]

.github/workflows/tests.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010

1111
jobs:
1212
test:
13+
name: Test on ${{ matrix.os }} with Python ${{ matrix.python-version }}
1314
runs-on: "${{ matrix.os }}"
1415
defaults:
1516
run:
@@ -21,17 +22,25 @@ jobs:
2122

2223
steps:
2324
- uses: actions/checkout@v3
24-
- name: Setup Micromamba
25-
uses: mamba-org/provision-with-micromamba@main
2625
with:
27-
python_version: ${{ matrix.python_version }}
28-
cache-downloads: true
29-
cache-env: true
30-
environment-file: ./environment.yml
26+
fetch-depth: 0
27+
28+
- name: Setup MiniConda
29+
uses: conda-incubator/setup-miniconda@v3
30+
with:
31+
activate-environment: cht_cyclones
32+
auto-update-conda: true
33+
channels: conda-forge
34+
35+
- name: Create environment
36+
shell: bash -el {0}
37+
run: |
38+
conda create -n cht_cyclones python=${{ matrix.python-version }} -y
3139
3240
- name: Install test dependencies
3341
run: |
34-
pip install -e ".[tests]"
42+
conda run -n cht_cyclones pip install -e ".[tests]"
43+
3544
- name: Test with pytest
3645
run: |
37-
pytest tests
46+
conda run -n cht_cyclones pytest tests

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ dmypy.json
152152
# Cython debug symbols
153153
cython_debug/
154154

155-
# Ruff
155+
# Ruff
156156
.ruff_cache/
157157
# PyCharm
158158
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can

.pre-commit-config.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.6.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: check-case-conflict
8+
- id: trailing-whitespace
9+
- id: check-toml
10+
- id: check-merge-conflict
11+
- id: check-added-large-files
12+
- id: check-merge-conflict
13+
- id: trailing-whitespace
14+
- repo: https://github.com/astral-sh/ruff-pre-commit
15+
rev: v0.5.5
16+
hooks:
17+
- id: ruff
18+
args: ['--fix', --exit-non-zero-on-fix]
19+
- id: ruff-format
20+
21+
- repo: https://github.com/crate-ci/typos
22+
rev: v1.23.6
23+
hooks:
24+
- id: typos

.typos.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
[default.extend-words]
22
# Ignore false-positives
33
waring = "waring"
4+
fo = "fo"
5+
pn = "pn"

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
"charliermarsh.ruff",
44
"ms-python.black-formatter"
55
]
6-
}
6+
}

cht_cyclones/__init__.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@
77

88
__version__ = "1.0.2"
99

10-
from .tropical_cyclone_refactored import TropicalCyclone
11-
from .track_database import CycloneTrackDatabase
12-
from .track_dataset import CycloneTrackDataset
13-
from .track_selector import track_selector
10+
from cht_cyclones.track_database import CycloneTrackDatabase
11+
from cht_cyclones.track_dataset import CycloneTrackDataset
12+
from cht_cyclones.track_selector import track_selector
13+
from cht_cyclones.tropical_cyclone_refactored import TropicalCyclone
14+
15+
__all__ = [
16+
"CycloneTrackDatabase",
17+
"CycloneTrackDataset",
18+
"track_selector",
19+
"TropicalCyclone",
20+
]

0 commit comments

Comments
 (0)