Create wiki page 'Development and CI'

2026-05-27 14:53:12 +00:00
parent 3b4150418a
commit d0f4d5dfa9
+78
@@ -0,0 +1,78 @@
# Development and CI
## Local development
Install development dependencies:
```bash
uv sync --group dev
```
Useful commands:
```bash
make format
make lint
make typecheck
make test
make ci-check
make build
make package-version
```
## Tooling
- Ruff for linting and formatting
- mypy in strict mode
- pytest for tests
- deptry for dependency checks
- local `stubs` directory for untyped third-party packages
## Architecture
Project layout:
- `src/yt_shorts_downloader/api.py`: public API
- `src/yt_shorts_downloader/cli.py`: CLI
- `src/yt_shorts_downloader/models`: typed models
- `src/yt_shorts_downloader/services`: session validation
- `src/yt_shorts_downloader/core`: yt-dlp integration, runtime detection, URL validation
- `stubs`: local typing stubs
## CI workflow
The main Gitea Actions workflow runs:
- Ruff
- mypy
- deptry
- pytest
After successful CI on a push to `main`, the workflow attempts publication to Gitea Packages.
## Package publishing
The package version is read from `[project].version` in `pyproject.toml`.
Publishing rules:
- if the current version does not exist in Gitea Packages, it is uploaded
- if the current version already exists, upload is skipped
- old published versions remain available in the registry
Required CI secrets:
- `PYPI_REPOSITORY_URL`
- `PACKAGE_USERNAME`
- `PACKAGE_TOKEN`
Local publish example:
```bash
export PYPI_REPOSITORY_URL='https://gitea.example.com/api/packages/<owner>/pypi'
export PACKAGE_USERNAME='<username>'
export PACKAGE_TOKEN='<token>'
make package-version
make publish-gitea
```