Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16811c53fa | ||
|
|
7c2604108c | ||
|
|
9b063bf58f | ||
|
|
fbf73fc6d7 | ||
|
|
0bbf4c22d4 |
+53
-46
@@ -1,46 +1,53 @@
|
||||
# Continuous integration for the squirrel census project: runs the pytest tests
|
||||
# on Python 3.13 for every push and pull request. Read by Gitea Actions (a
|
||||
# runner must be registered for the repository). It changes nothing outside the
|
||||
# repository and uses no secret. Decision: MIL-001 task "Add CI workflow".
|
||||
# Host: Gitea Actions; uses only github.* contexts, so it also runs on GitHub.
|
||||
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
PYTHON_VERSION: "3.13"
|
||||
PIP_VERSION: "26.2.1"
|
||||
|
||||
concurrency:
|
||||
group: tests-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
pytest:
|
||||
name: Run the tests
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Check out the code
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5.6.0
|
||||
with:
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
|
||||
- name: Create the virtual environment and install
|
||||
run: |
|
||||
python -m venv .venv
|
||||
.venv/bin/python -m pip install --upgrade "pip==${PIP_VERSION}"
|
||||
.venv/bin/python -m pip install -e ".[dev]"
|
||||
|
||||
- name: Run the tests
|
||||
run: .venv/bin/python -m pytest
|
||||
# Continuous integration for the squirrel census project: lints the YAML and
|
||||
# workflow files and runs the pytest tests on Python 3.13 for every push and
|
||||
# pull request. Read by Gitea Actions (a runner must be registered for the
|
||||
# repository). It changes nothing outside the repository and uses no secret.
|
||||
# Decision: MIL-001 task "Add CI workflow".
|
||||
# Host: Gitea Actions; uses only github.* contexts, so it also runs on GitHub.
|
||||
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
env:
|
||||
PYTHON_VERSION: "3.13"
|
||||
PIP_VERSION: "26.2.1"
|
||||
|
||||
concurrency:
|
||||
group: tests-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
pytest:
|
||||
name: Run the tests
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- name: Check out the code
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5.6.0
|
||||
with:
|
||||
python-version: ${{ env.PYTHON_VERSION }}
|
||||
|
||||
- name: Create the virtual environment and install
|
||||
run: |
|
||||
python -m venv .venv
|
||||
.venv/bin/python -m pip install --upgrade "pip==${PIP_VERSION}"
|
||||
.venv/bin/python -m pip install -e ".[dev]"
|
||||
|
||||
- name: Lint the YAML files
|
||||
run: .venv/bin/python -m yamllint -c .yamllint.yml .gitea .yamllint.yml
|
||||
|
||||
- name: Lint the workflow files
|
||||
run: .venv/bin/actionlint .gitea/workflows/*.yml
|
||||
|
||||
- name: Run the tests
|
||||
run: .venv/bin/python -m pytest
|
||||
|
||||
@@ -6,3 +6,6 @@ rules:
|
||||
max: 100
|
||||
truthy:
|
||||
check-keys: false
|
||||
# Line endings are normalised by git (LF in the repository, CRLF in some
|
||||
# Windows checkouts), so the rule would fail on a local checkout only.
|
||||
new-lines: disable
|
||||
|
||||
@@ -20,7 +20,7 @@ There are no runtime dependencies: the program uses only the Python standard lib
|
||||
## Set up
|
||||
|
||||
Create a local virtual environment named `.venv` in the project folder, upgrade `pip`
|
||||
and install the project with its development tools (pytest, ruff, mypy).
|
||||
and install the project with its development tools (pytest, ruff, mypy, yamllint, actionlint).
|
||||
|
||||
### Windows powershell
|
||||
|
||||
@@ -90,7 +90,8 @@ it is present.
|
||||
|
||||
The workflow [`.gitea/workflows/ci.yml`][ci] runs for every push to `main` and for every
|
||||
pull request. It sets up Python 3.13, creates a `.venv`, upgrades `pip`, installs the
|
||||
project with `.[dev]` and runs `python -m pytest`. It uses `github.*` contexts only, so
|
||||
project with `.[dev]`, lints the YAML and workflow files with `yamllint` and
|
||||
`actionlint`, and runs `python -m pytest`. It uses `github.*` contexts only, so
|
||||
it also runs on GitHub Actions.
|
||||
|
||||
## Build the source documentation
|
||||
|
||||
+49
-48
@@ -1,48 +1,49 @@
|
||||
# Project configuration for the squirrel census assignment (day 25).
|
||||
# Read by pip, setuptools and pytest. The decision to use the standard library
|
||||
# only is recorded in docs/adr/adr-0001-standard-library-instead-of-pandas.md.
|
||||
|
||||
[build-system]
|
||||
requires = ["setuptools>=68"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "squirrel"
|
||||
version = "0.1.0"
|
||||
description = "Count the squirrels of the 2018 Central Park Squirrel Census by primary fur colour."
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.13"
|
||||
license = "AGPL-3.0-or-later"
|
||||
license-files = ["LICENSE"]
|
||||
dependencies = []
|
||||
classifiers = [
|
||||
"Programming Language :: Python :: 3.13",
|
||||
"Intended Audience :: Education",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = ["pytest==9.1.1", "ruff==0.17.0", "mypy==2.4.0",
|
||||
"pyyaml==6.0.3", "types-PyYAML==6.0.12.20260906"]
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
where = ["src"]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
pythonpath = ["src"]
|
||||
testpaths = ["tests"]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 88
|
||||
src = ["src", "tests"]
|
||||
extend-exclude = ["docs"]
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["E", "F", "I", "UP", "B", "D"]
|
||||
ignore = ["D203", "D213"]
|
||||
|
||||
[tool.mypy]
|
||||
strict = true
|
||||
files = ["src", "tests"]
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"tests/**" = ["D"]
|
||||
# Project configuration for the squirrel census assignment (day 25).
|
||||
# Read by pip, setuptools and pytest. The decision to use the standard library
|
||||
# only is recorded in docs/adr/adr-0001-standard-library-instead-of-pandas.md.
|
||||
|
||||
[build-system]
|
||||
requires = ["setuptools>=68"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "squirrel"
|
||||
version = "0.1.0"
|
||||
description = "Count the squirrels of the 2018 Central Park Squirrel Census by primary fur colour."
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.13"
|
||||
license = "AGPL-3.0-or-later"
|
||||
license-files = ["LICENSE"]
|
||||
dependencies = []
|
||||
classifiers = [
|
||||
"Programming Language :: Python :: 3.13",
|
||||
"Intended Audience :: Education",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = ["pytest==9.1.1", "ruff==0.17.0", "mypy==2.4.0",
|
||||
"pyyaml==6.0.3", "types-PyYAML==6.0.12.20260906",
|
||||
"yamllint==1.38.0", "actionlint-py==1.7.12.25"]
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
where = ["src"]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
pythonpath = ["src"]
|
||||
testpaths = ["tests"]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 88
|
||||
src = ["src", "tests"]
|
||||
extend-exclude = ["docs"]
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["E", "F", "I", "UP", "B", "D"]
|
||||
ignore = ["D203", "D213"]
|
||||
|
||||
[tool.mypy]
|
||||
strict = true
|
||||
files = ["src", "tests"]
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"tests/**" = ["D"]
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
# Installation
|
||||
|
||||
Projektet kræver **Python 3.13 eller nyere**. Det har ingen kørselsafhængigheder; `pytest`, `ruff` og `mypy` er udviklingsværktøjer.
|
||||
Projektet kræver **Python 3.13 eller nyere**. Det har ingen kørselsafhængigheder; `pytest`, `ruff`, `mypy`, `yamllint` og `actionlint` er udviklingsværktøjer.
|
||||
|
||||
## Windows PowerShell
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
# Install
|
||||
|
||||
The project needs **Python 3.13 or later**. It has no runtime dependencies; `pytest`, `ruff` and `mypy` are development tools.
|
||||
The project needs **Python 3.13 or later**. It has no runtime dependencies; `pytest`, `ruff`, `mypy`, `yamllint` and `actionlint` are development tools.
|
||||
|
||||
## Windows PowerShell
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
# Pemasangan
|
||||
|
||||
Projek ini memerlukan **Python 3.13 atau lebih baharu**. Ia tiada kebergantungan masa jalan; `pytest`, `ruff` dan `mypy` ialah alat pembangunan.
|
||||
Projek ini memerlukan **Python 3.13 atau lebih baharu**. Ia tiada kebergantungan masa jalan; `pytest`, `ruff`, `mypy`, `yamllint` dan `actionlint` ialah alat pembangunan.
|
||||
|
||||
## Windows PowerShell
|
||||
|
||||
|
||||
Reference in New Issue
Block a user