Initial commit

This commit is contained in:
2026-05-01 09:24:14 +02:00
commit 9cee33c405
13 changed files with 187 additions and 0 deletions

10
.gitattributes vendored Normal file
View File

@@ -0,0 +1,10 @@
# By default, normalize line endings
* text=auto
# Force Windows batch files to use CRLF
*.{cmd,[cC][mM][dD]} text eol=crlf
*.{bat,[bB][aA][tT]} text eol=crlf
*.{ics,[iI][cC][sS]} text eol=crlf
# Force Unix bash files to use LF
*.sh text eol=lf

38
.github/workflows/tests.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: Run tests
on: [push]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
env:
PIP_ROOT_USER_ACTION: ignore
UV_LINK_MODE: copy
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install uv
uv sync --locked
- name: Check format with ruff
run: |
uv run ruff format --check
- name: Check code linting with ruff
run: |
uv run ruff check

11
.gitignore vendored Normal file
View File

@@ -0,0 +1,11 @@
# Python cache
*.pyc
.ipynb_checkpoints/
*.egg-info/
# IDE settings
.vscode/
.idea/
# OSX-specific
.DS_Store

16
.gitlab-ci.yml Normal file
View File

@@ -0,0 +1,16 @@
stages:
- test
run-tests:
stage: test
image: python:3.12
variables:
PIP_ROOT_USER_ACTION: ignore
UV_LINK_MODE: copy
before_script:
- python -m pip install --upgrade pip
- pip install uv
- uv sync --locked
script:
- uv run ruff format --check
- uv run ruff check

28
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,28 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-added-large-files
args: ["--maxkb=2000"]
- id: check-case-conflict
- id: check-illegal-windows-names
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-xml
- id: check-yaml
- id: destroyed-symlinks
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.0
hooks:
- id: ruff-check
args: [ --fix ]
- id: ruff-format
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.10.2
hooks:
- id: uv-lock
- id: uv-export

1
.python-version Normal file
View File

@@ -0,0 +1 @@
3.12

37
README.md Normal file
View File

@@ -0,0 +1,37 @@
# river-annotation-tool
This project is made using [this template](https://github.com/SwissDataScienceCenter/innovation-cookiecutter).
Next steps include:
- [x] Create project from the Cookiecutter template.
- [ ] Create a virtual environment to work in an isolated Python installation.
- [ ] Install [pre-commit](https://pre-commit.com/) hooks.
- [ ] Keep either [`.gitlab-ci.yml`](https://docs.gitlab.com/ee/ci/yaml/gitlab_ci_yaml.html) or [`.github/`](https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python), according to your Git hosting platform.
- [ ] Update `authors` and `description`, in `pyproject.toml`.
- [ ] Add development and installation dependencies in `pyproject.toml`, with permissive version constraints.
- [ ] Add a `LICENSE` file, if applicable. This is *highly recommended* if the project is open source.
- [ ] Add a [`CITATION.cff`](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-citation-files), to ease citation of your work.
- [ ] Replace this `README.md` with a proper one. Among others, it must explain the overall context, the installation instructions, a quick start guide, and a repository structure description.
## Getting started
In order to use [pre-commit](https://pre-commit.com/) hooks, they need to be registered:
```sh
pre-commit install
```
It is a good practice to manually invoke hooks after installation, just in case:
```sh
pre-commit run --all-files
```
During development, install pinned dependencies in your virtual environment, including the module itself in [editable mode](https://setuptools.pypa.io/en/latest/userguide/development_mode.html), using:
```sh
uv sync
```
New dependencies can be added using [`uv add`](https://docs.astral.sh/uv/concepts/projects/dependencies/) (or `uv add --dev` for development dependencies), or by manually configuring `pyproject.toml` and using [`uv lock && uv sync`](https://docs.astral.sh/uv/concepts/projects/sync/).

0
data/.gitkeep Normal file
View File

0
notebooks/.gitkeep Normal file
View File

41
pyproject.toml Normal file
View File

@@ -0,0 +1,41 @@
[build-system]
requires = ["setuptools>=61.0.0"]
build-backend = "setuptools.build_meta"
[project]
name = "river_annotation_tool"
authors = [
# TODO configure authors
# { name = "Jane Smith", email = "jane.smith@example.com" },
# { name = "John Doe", email = "john.doe@example.com" },
]
description = ""
readme = "README.md"
requires-python = "~=3.12.0"
dependencies = [
# TODO configure install dependencies
]
dynamic = ["version"]
[dependency-groups]
dev = [
"notebook~=7.5",
"pre-commit~=4.5",
"ruff==0.15.0",
]
[tool.setuptools.dynamic]
version = {attr = "river_annotation_tool.__version__"}
[tool.ruff]
target-version = "py312"
line-length = 88
[tool.ruff.lint]
extend-select = ["B", "I", "RUF1", "UP", "W"]
[tool.ruff.lint.isort]
lines-after-imports = 2
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]

1
requirements.txt Normal file
View File

@@ -0,0 +1 @@
# This file will be autogenerated from pyproject.toml

View File

@@ -0,0 +1 @@
__version__ = "0.1.0"

3
uv.lock generated Normal file
View File

@@ -0,0 +1,3 @@
# This file will be autogenerated from pyproject.toml
version = 1
requires-python = "~=3.12.0"