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
34 changes: 15 additions & 19 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,29 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- id: setup-python
uses: actions/setup-python@v5
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.11"
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Install dependencies
run: poetry install --no-interaction --with docs
- name: Quarto Doc Build
enable-cache: true
python-version: "3.12"
- name: Install project
run: uv sync --group docs
- name: Run quartodoc build
run: |
cd docs
poetry run quartodoc build
poetry run python objects.py
poetry run quartodoc interlinks
- uses: quarto-dev/quarto-actions/setup@v2
cd docs
uv run quartodoc build
uv run python objects.py
uv run quartodoc interlinks
- name: Setup quarto
uses: quarto-dev/quarto-actions/setup@v2
- name: Load cached quarto freeze
id: cached-quarto-freeze
uses: actions/cache@v3
with:
path: docs/_freeze
key: ${{ runner.os }}-freeze
- name: Render and publish to gh pages
- name: Render and publush to gh-pages
run: |
git config --global user.email "quarto-github-actions-publish@example.com"
git config --global user.name "Quarto GHA Workflow Runner"
poetry run quarto publish gh-pages docs --no-browser
uv run quarto publish gh-pages docs --no-browser
34 changes: 34 additions & 0 deletions .github/workflows/dev-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Dev Tag

on:
pull_request:
types:
- closed
branches:
- 'dev'

jobs:
dev-tag:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
python-version: "3.12"
- name: Bump Version
run: echo "PKG_VERSION=$(uv version --bump alpha | awk '{print $2}')" >> $GITHUB_ENV
- name: Test
run: echo ${{ env.PKG_VERSION }}
- name: Run latest-tag
uses: EndBug/latest-tag@latest
with:
ref: ${{ env.PKG_VERSION }}
- name: Push Dev Version
run: |
git config --global user.name "Dev Tagger"
git config --global user.email "username@users.noreply.github.com"
git commit -a -m "${{ env.PKG_VERSION }}"
git push
36 changes: 24 additions & 12 deletions .github/workflows/pypi_publish.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
name: pypi publish

on:
push:
branches:
- main
push:
branches:
- main
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
- uses: JRubics/poetry-publish@v2.0
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
publish:
runs-on: ubuntu-latest
environment:
name: pypi
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v7
with:
python-version: "3.12"
enable-cache: true
- name: Build
run: uv build
- name: Publish
run: uv publish
47 changes: 16 additions & 31 deletions .github/workflows/test_and_run.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,38 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: "Build"
name: Python CI

on:
push:
branches: [ $default-branch, "workflows" ]
branches: [ $default-branch, "main", "dev", "workflows" ]
pull_request:
branches: [ $default-branch, "dev" , "main", "feature/**"]
branches: [ $default-branch, "main", "dev", "feature/**", "release/**" ]

defaults:
run:
shell: bash

jobs:
lint-and-test:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Install uv and set the Python version
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --with test --no-interaction --no-root
enable-cache: true
- name: Install project
run: uv sync --group test
- name: Test with pytest
run: |
source $VENV
pytest
run: uv run pytest
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
67 changes: 33 additions & 34 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,46 +1,45 @@
[tool.poetry]
[project]
name = "aligned_textgrid"
packages = [{include = "aligned_textgrid", from="src"}]
version = "0.8.1"
description = "Classes for defining sequential information from TextGrids"
authors = ["JoFrhwld <JoFrhwld@gmail.com>", "chrisbrickhouse <brickhouse@stanford.edu>"]
authors = [
{name="Josef Fruehwald", email = "JoFrhwld@gmail.com>"},
{name="chrisbrickhouse", email = "brickhouse@stanford.edu"}
]
license = "GPL-3.0-or-later"
readme = "README.md"
packages = [{include = "aligned_textgrid", from="src"}]
exclude = [
"notebooks/",
"examples/",
"docs/"
]
homepage = "https://forced-alignment-and-vowel-extraction.github.io/alignedTextGrid/"
repository = "https://github.com/Forced-Alignment-and-Vowel-Extraction/alignedTextGrid"

[tool.poetry.dependencies]
python = "^3.10"
praatio = "^6.0.0"
cloudpickle = "^3.0.0"
toml = "^0.10.2"
polars = "^1.23.0"
numpy = "^2.1.0"

[tool.poetry.group.dev.dependencies]
jupyter = "^1.0.0"

[tool.poetry.group.test.dependencies]
pytest = "^7.2.1"
importlib = "^1.0.4"
pytest-cov = "^4.0.0"
pytest-html = "^3.2.0"
flake8 = "^6.1.0"
codecov = "^2.1.13"

[tool.poetry.group.docs.dependencies]
textgrid = "^1.5"
quartodoc = "0.6.5"
jupyter = "^1.0.0"
requires-python = ">=3.10"
dependencies = [
"cloudpickle>=3.1.2",
"numpy>=2.2.6",
"polars>=1.39.3",
"praatio>=6.2.2",
"toml>=0.10.2",
]

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
requires = ["uv_build>=0.10.0,<0.11.0"]
build-backend = "uv_build"

[dependency-groups]
dev = [
"jupyter>=1.1.1",
]
docs = [
"jupyter>=1.1.1",
"quartodoc>=0.11.1",
"textgrid>=1.6.1",
]
test = [
"codecov>=2.1.13",
"importlib>=1.0.4",
"pytest>=9.0.2",
"pytest-cov>=7.1.0",
"pytest-html>=4.2.0",
]

[tool.pytest.ini_options]
addopts = [
Expand Down
Loading
Loading