Skip to content

Commit

Permalink
Refactor workflows & pyproject for hatch deploy 🚀
Browse files Browse the repository at this point in the history
- Updated `release-snap.yml` and `test-snap.yml` to use `uv` for installation
and deployment.
- Modified `release-snap.yml` to include environment setup and permissions.
- Converted `pyproject.toml` to utilize `hatch`, replacing `poetry` with
`hatchling` as the build system.
- Updated dependencies and moved them to the new `dependencies` and
`dependency-groups` format.
  • Loading branch information
horta committed Jan 16, 2025
1 parent 6f46bc3 commit 58dbe2d
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 22 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/release-snap.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-snap

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: snap/dist
skip-existing: true
verbose: true
7 changes: 5 additions & 2 deletions .github/workflows/test-snap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ jobs:
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
39 changes: 22 additions & 17 deletions snap/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
[tool.poetry]
[project]
name = "deciphon-snap"
version = "1.0.3"
description = "Reader for Deciphon snap files."
authors = ["Danilo Horta <[email protected]>"]
license = "MIT"
authors = [{ name = "Danilo Horta", email = "[email protected]" }]
requires-python = "~=3.9"
readme = "README.md"
packages = [{ include = "deciphon_snap" }]
license = "MIT"
dependencies = [
"fsspec>=2024.9.0",
"h3result>=1.0.1,<2",
"fasta-reader>=3.0.3,<4",
"deciphon-intervals>=1.0.0,<2",
"prettytable~=3.11",
"pydantic~=2.9",
"hmmer-tables>=1.0.1,<2",
]

[dependency-groups]
dev = ["pytest~=8.2"]

[tool.poetry.dependencies]
python = "^3.9"
fsspec = ">=2024.9.0"
h3result = "^1.0.1"
fasta-reader = "^3.0.3"
deciphon-intervals = "^1.0.0"
prettytable = "^3.11"
pydantic = "^2.9"
hmmer-tables = "^1.0.1"
[tool.hatch.build.targets.sdist]
include = ["deciphon_snap"]

[tool.poetry.group.dev.dependencies]
pytest = "^8.2"
[tool.hatch.build.targets.wheel]
include = ["deciphon_snap"]

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

0 comments on commit 58dbe2d

Please sign in to comment.