Skip to content

Commit

Permalink
Use a more standard pyproject.toml file format and use uv for the Git…
Browse files Browse the repository at this point in the history
…Hub actions (#36)
  • Loading branch information
bryant1410 authored Jan 14, 2025
1 parent 4ec14c9 commit 9262f82
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 50 deletions.
33 changes: 15 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,27 @@ name: CI
on:
pull_request:
branches:
- main
- main
push:
branches:
- main
- main
release:
types: [published]
types: [ published ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9, '3.10', '3.11', '3.12', '3.13']
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry
uses: abatilo/actions-poetry@v3
- name: Check package setup
run: poetry check
- name: Install dependencies
run: poetry install --with test
- name: Test
run: poetry run pytest --doctest-modules
- name: Checkout
uses: actions/checkout@v4
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install the project
run: uv sync
- name: Test
run: uv run pytest --doctest-modules
23 changes: 10 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
name: Publish
on:
release:
types: [created]
types: [ created ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Set up Poetry
uses: abatilo/actions-poetry@v3
- name: Build and publish
env:
POETRY_HTTP_BASIC_PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: poetry publish --build
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
run: uv python install
- name: Build
run: uv build
- name: Publish
run: uv publish
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
build
dist

# codespaces:
pythonenv3.9

poetry.lock
uv.lock
39 changes: 22 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
[tool.poetry]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "krippendorff"
version = "0.8.1-dev"
version = "0.8.1.dev0"
description = "Fast computation of the Krippendorff's alpha measure."
authors = ["Santiago Castro <[email protected]>"]
authors = [
{ name = "Santiago Castro", email = "[email protected]" },
]
license = "GPL-3.0-or-later"
license-files = ["LICENSE.txt"]

readme = "README.md"

homepage = "https://github.com/pln-fing-udelar/fast-krippendorff"
repository = "https://github.com/pln-fing-udelar/fast-krippendorff"

keywords = ["Krippendorff", "alpha", "agreement", "reliability", "coding", "coders", "units", "values"]
classifiers = [
"Development Status :: 4 - Beta",
Expand All @@ -27,16 +31,17 @@ classifiers = [
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]

[tool.poetry.dependencies]
python = "^3.9"
numpy = ">=1.21" # For NumPy Typing.

[tool.poetry.group.test]
optional = true
requires-python = ">=3.9"
dependencies = [
"numpy>=1.21", # For NumPy Typing.
]

[tool.poetry.group.test.dependencies]
pytest = ">=7,<9"
[dependency-groups]
dev = ["pytest>=7,<9"]

[build-system]
requires = ["poetry_core"]
build-backend = "poetry.core.masonry.api"
[project.urls]
Homepage = "https://github.com/pln-fing-udelar/fast-krippendorff"
Documentation = "https://github.com/pln-fing-udelar/fast-krippendorff"
Repository = "https://github.com/pln-fing-udelar/fast-krippendorff"
"Bug Tracker" = "https://github.com/pln-fing-udelar/fast-krippendorff/issues"
Changelog = "https://github.com/pln-fing-udelar/fast-krippendorff/releases"

0 comments on commit 9262f82

Please sign in to comment.