Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: justfile, python version fix, easier doc deploy #106

Merged
merged 2 commits into from
Feb 1, 2025
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
6 changes: 2 additions & 4 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ jobs:

- name: Setup dependencies
run: |
uv venv
uv sync --extra dev
uv sync --all-extras --all-groups

- name: Lint with flake8
run: |
Expand Down Expand Up @@ -68,8 +67,7 @@ jobs:

- name: Install dependencies
run: |
uv venv
uv sync --extra dev
uv sync --all-extras --all-groups

- name: Test with pytest
run: |
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:

jobs:
deploy:

runs-on: ubuntu-latest

steps:
Expand All @@ -28,8 +27,7 @@ jobs:

- name: Install dependencies
run: |
uv venv
uv sync --all-extras
uv sync --all-extras --all-groups

- name: Build and publish
env:
Expand Down
1 change: 0 additions & 1 deletion .python-version

This file was deleted.

6 changes: 3 additions & 3 deletions docs/gen_ref_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

nav = mkdocs_gen_files.Nav()

for path in sorted(Path("jiwer").rglob("*.py")):
doc_path = path.relative_to("jiwer").with_suffix(".md")
for path in sorted(Path("src/jiwer").rglob("*.py")):
doc_path = path.relative_to("src/jiwer").with_suffix(".md")
full_doc_path = Path("reference", doc_path)

module_path = path.relative_to("jiwer").with_suffix("")
module_path = path.relative_to("src/jiwer").with_suffix("")
parts = list(module_path.parts)

if parts[-1] == "__init__" or parts[-1] == "cli":
Expand Down
19 changes: 19 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
test-quick:
uv run --group dev pytest \
--ignore=tests/test_large_vocab.py \
--ignore=tests/test_speed.py

test:
uv run --group dev pytest

serve-docs:
uv run --group docs mkdocs serve

[confirm]
publish-docs:
# make sure the remote exists
git remote -v | grep deploy-doc > /dev/null || git remote add deploy-docs [email protected]:jitsi/jiwer.git
git remote set-url deploy-docs [email protected]:jitsi/jiwer.git

# push to deploy-docs remote and gh-pages branch
uv run --group docs mkdocs gh-publish -r deploy-docs -b gh-pages
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ plugins:
- mkdocstrings:
handlers:
python:
paths: [jiwer]
paths: [src/jiwer]
options:
separate_signature: true
show_root_heading: true
Expand All @@ -44,4 +44,4 @@ markdown_extensions:

watch:
- docs
- jiwer
- src/jiwer
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ license = "Apache-2.0"
[project.scripts]
jiwer = "jiwer.cli:cli"

[project.optional-dependencies]
[dependency-groups]
dev = [
"black>=24.8.0",
"flake8>=5.0.4",
Expand Down
26 changes: 16 additions & 10 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.