Skip to content

Commit

Permalink
Refactor CI workflows and migration to Hatchling 🎉
Browse files Browse the repository at this point in the history
- `.github/workflows/release-cli.yml`: Added PyPI environment info, updated
build and publish steps to use `uv`.
- `.github/workflows/test-cli.yml`: Modified test platform to use `uv`
instead of `poetry`.
- `cli/pyproject.toml`: Replaced `[tool.poetry]` with `[project]`, updated
dependencies format, set build system to `hatchling`.
  • Loading branch information
horta committed Jan 16, 2025
1 parent 58dbe2d commit dea1bee
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 36 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/release-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,27 @@ jobs:
release:
runs-on: ubuntu-latest

environment:
name: pypi
url: https://pypi.org/p/deciphon-cli

permissions:
id-token: write

steps:
- uses: actions/checkout@v4

- name: Build
run: pipx run build
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Deploy
run: |
uv sync --all-extras --dev
uv build
uv publish
- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{secrets.PYPI_API_TOKEN}}
packages-dir: cli/dist
skip-existing: true
verbose: true
11 changes: 7 additions & 4 deletions .github/workflows/test-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ defaults:

jobs:
test:
runs-on: ${{ matrix.os }}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, macos-13]
os: [ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Run tests
run: |
pipx run poetry install
pipx run poetry run pytest
uv sync --all-extras --dev
uv run pytest
63 changes: 34 additions & 29 deletions cli/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,39 +1,44 @@
[tool.poetry]
[project]
name = "deciphon"
version = "1.0.3"
description = "Individually annotate long, error-prone nucleotide sequences into proteins"
authors = ["Danilo Horta <[email protected]>"]
license = "MIT"
authors = [{ name = "Danilo Horta", email = "[email protected]" }]
requires-python = "~=3.9"
readme = "README.md"
packages = [{ include = "deciphon" }]
license = "MIT"
dependencies = [
"cffi~=1.17",
"fasta-reader>=3.0.3,<4",
"hmmer~=3.4",
"ijson~=3.3",
"pydantic~=2.9",
"typer>=0.12,<0.13",
"rich~=13.8",
"deciphon-snap>=1.0.3,<2",
"more-itertools~=10.5",
"psutil>=6.1.0,<7",
"deciphon-core>=1.0.5,<2",
"h3daemon>=0.14.8,<0.15",
"h3result>=1.0.3,<2",
"loguru>=0.7.2,<0.8",
"deciphon-worker>=0.3.1,<0.4",
]

[tool.poetry.dependencies]
python = "^3.9"
cffi = "^1.17"
fasta-reader = "^3.0.3"
hmmer = "^3.4"
ijson = "^3.3"
pydantic = "^2.9"
typer = "^0.12"
rich = "^13.8"
deciphon-snap = "^1.0.3"
more-itertools = "^10.5"
psutil = "^6.1.0"
deciphon-core = "^1.0.5"
h3daemon = "^0.14.8"
h3result = "^1.0.3"
loguru = "^0.7.2"
deciphon-worker = "^0.3.1"
[project.scripts]
deciphon = "deciphon.cli:app"

[tool.poetry.group.dev.dependencies]
pytest = "^8.2"
[dependency-groups]
dev = ["pytest~=8.2"]

[tool.pytest.ini_options]
pythonpath = ["."]
[tool.hatch.build.targets.sdist]
include = ["deciphon"]

[tool.poetry.scripts]
deciphon = 'deciphon.cli:app'
[tool.hatch.build.targets.wheel]
include = ["deciphon"]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.pytest.ini_options]
pythonpath = ["."]

0 comments on commit dea1bee

Please sign in to comment.