-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tooling: use uv and set up publishing (#9)
* refactor: migrate from rye to uv package manager and update tooling The commit message reflects a significant change in the project's development tooling, switching from rye to uv for package management, and replacing multiple linting tools (pylint, flake8) with ruff for better performance and maintainability. * ci: add GitHub Actions workflows for continuous integration and deployment * chore: remove tox configuration as it's no longer used for test automation
- Loading branch information
Showing
8 changed files
with
834 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# publish.yml | ||
|
||
name: "Publish" | ||
|
||
on: | ||
release: | ||
types: ["published"] | ||
|
||
jobs: | ||
run: | ||
name: "Build and publish release" | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write # needed for Trusted Publishing on PyPi | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: uv.lock | ||
|
||
- name: Set up Python | ||
run: uv python install 3.12 | ||
|
||
- name: Build | ||
run: uv build | ||
|
||
- name: Publish | ||
run: uv publish |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install just | ||
uses: taiki-e/install-action@just | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: "uv.lock" | ||
|
||
- name: Set up Python | ||
run: uv python install 3.12 | ||
|
||
- name: Install dependencies | ||
run: uv sync --all-extras --dev | ||
|
||
- name: Lint | ||
run: just lint | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install just | ||
uses: taiki-e/install-action@just | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: "uv.lock" | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install dependencies | ||
run: uv sync --all-extras --dev | ||
|
||
- name: Test | ||
run: just test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,25 @@ | ||
default: | ||
@just --list | ||
|
||
tox: | ||
@tox | ||
|
||
test: | ||
@pytest -s | ||
@uv run pytest | ||
|
||
test-s: | ||
@uv run pytest -s -o log_cli=True -o log_cli_level=DEBUG | ||
|
||
pylint: | ||
rye run pylint labfile | ||
ruff-fix: | ||
uv run ruff format labfile | ||
|
||
flake8: | ||
rye run flake8 labfile | ||
ruff-check: | ||
uv run ruff check labfile | ||
|
||
pyright: | ||
rye run pyright labfile | ||
uv run pyright labfile | ||
|
||
lint: | ||
just pylint | ||
just flake8 | ||
just ruff-check | ||
just pyright | ||
|
||
|
||
lint-file file: | ||
- pylint {{file}} | ||
- flake8 {{file}} | ||
- ruff {{file}} | ||
- pyright {{file}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,54 @@ | ||
[project] | ||
name = "labfile" | ||
version = "0.1.0" | ||
description = "Add your description here" | ||
description = "A declarative file format for scientific experiments." | ||
authors = [ | ||
{ name = "Rory Byrne", email = "[email protected]" } | ||
] | ||
requires-python = ">=3.8" | ||
dependencies = [ | ||
"pydantic>=2.9.2", | ||
"pydantic-settings>=2.6.1", | ||
"lark>=1.2.2", | ||
"pydantic>=2.10.3", | ||
] | ||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Operating System :: OS Independent", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Topic :: Scientific/Engineering", | ||
"Intended Audience :: Developers", | ||
'Intended Audience :: Information Technology', | ||
"Typing :: Typed", | ||
] | ||
license = "MIT" | ||
readme = "README.md" | ||
requires-python = ">= 3.8" | ||
dynamic = ["version"] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/flywhl/labfile" | ||
Repository = "https://github.com/flywhl/labfile" | ||
Documentation = "https://github.com/flywhl/labfile#readme" | ||
"Bug Tracker" = "https://github.com/flywhl/labfile/issues" | ||
|
||
[build-system] | ||
requires = ["hatchling"] | ||
requires = ["hatchling", "hatch-vcs"] | ||
build-backend = "hatchling.build" | ||
|
||
[tool.rye] | ||
managed = true | ||
[tool.hatch.version] | ||
source = "vcs" | ||
|
||
[tool.uv] | ||
dev-dependencies = [ | ||
"pytest>=8.3.3", | ||
"black>=24.10.0", | ||
"pylint>=3.3.1", | ||
"isort>=5.13.2", | ||
"flake8>=7.1.1", | ||
"pyright>=1.1.388", | ||
"flake8-pyproject>=1.2.3", | ||
"tox>=4.23.2", | ||
"coverage>=7.6.4", | ||
"pre-commit>=4.0.1", | ||
"coverage>=7.6.1", | ||
"pre-commit>=3.5.0", | ||
"pyright>=1.1.391", | ||
"pytest>=8.3.4", | ||
"ruff>=0.9.1", | ||
] | ||
|
||
[tool.hatch.metadata] | ||
allow-direct-references = true | ||
|
||
[tool.hatch.build.targets.wheel] | ||
packages = ["labfile"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.