commit 9cee33c405dd529267074c93ce33b1b239df4745 Author: asreva Date: Fri May 1 09:24:14 2026 +0200 Initial commit diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..d6e78ee --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..aa9a7e4 --- /dev/null +++ b/.github/workflows/tests.yml @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..76c6119 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +# Python cache +*.pyc +.ipynb_checkpoints/ +*.egg-info/ + +# IDE settings +.vscode/ +.idea/ + +# OSX-specific +.DS_Store diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..2df5661 --- /dev/null +++ b/.gitlab-ci.yml @@ -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 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..5609faf --- /dev/null +++ b/.pre-commit-config.yaml @@ -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 diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..e4fba21 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.12 diff --git a/README.md b/README.md new file mode 100644 index 0000000..e9f1c04 --- /dev/null +++ b/README.md @@ -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/). diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/notebooks/.gitkeep b/notebooks/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..37ccefa --- /dev/null +++ b/pyproject.toml @@ -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"] diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..de6f95a --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +# This file will be autogenerated from pyproject.toml diff --git a/src/river_annotation_tool/__init__.py b/src/river_annotation_tool/__init__.py new file mode 100644 index 0000000..3dc1f76 --- /dev/null +++ b/src/river_annotation_tool/__init__.py @@ -0,0 +1 @@ +__version__ = "0.1.0" diff --git a/uv.lock b/uv.lock new file mode 100644 index 0000000..0bd4a4d --- /dev/null +++ b/uv.lock @@ -0,0 +1,3 @@ +# This file will be autogenerated from pyproject.toml +version = 1 +requires-python = "~=3.12.0"