Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI

on:
push:
branches: [master]
pull_request:

jobs:
test:
name: Test on Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Install project
run: uv sync --locked

- name: Run tests
run: uv run python -m unittest discover --verbose

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
enable-cache: true

- name: Install project
run: uv sync --locked

- name: Ruff check
run: uv run ruff check .

- name: Ruff format check
run: uv run ruff format --check .
24 changes: 7 additions & 17 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,17 @@ jobs:
url: https://pypi.org/p/init-data-py
permissions:
id-token: write

steps:
- uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Search and replace version
run: |
VERSION="${TAG_NAME//v/}"
sed -i "s/1\.0+versionplaceholder\.1/$VERSION/" pyproject.toml
env:
TAG_NAME: ${{ github.event.release.tag_name }}

- uses: eifinger/setup-rye@v4
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
with:
enable-cache: true

- name: Build
run: |
rye build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
run: uv build --no-sources

- name: Publish to PyPI
run: uv publish
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,24 @@ is_valid = init_data.validate(
)
```

## Development

This project uses [uv](https://docs.astral.sh/uv/) for dependency management and packaging. After installing uv, set up the environment:

```bash
uv sync
```

Then use the following commands:

```bash
uv run python -m unittest discover --verbose # run the tests
uv run ruff check . # lint
uv run ruff format . # format
uv run mypy src # type check
uv build # build the distributions
```

## License

This library is licensed under the [MIT License](LICENCE).
9 changes: 2 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ license = "MIT"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.rye]
managed = true
dev-dependencies = [
[dependency-groups]
dev = [
"mypy>=1.11.1",
"tox>=4.17.1",
"ruff>=0.5.7",
]

Expand All @@ -28,9 +26,6 @@ allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["src/init_data_py"]

[tool.rye.scripts]
tests = "python -m unittest discover --verbose"

[tool.ruff]
exclude = [
".bzr",
Expand Down
42 changes: 0 additions & 42 deletions requirements-dev.lock

This file was deleted.

12 changes: 0 additions & 12 deletions requirements.lock

This file was deleted.

Loading
Loading