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
17 changes: 4 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
uses: actions/checkout@v6

- uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Set up the environment
uses: ./.github/actions/setup-python-env

- name: Run checks
run: uv run just check
- uses: j178/prek-action@v1

tests-and-type-check:
runs-on: ubuntu-latest
Expand All @@ -36,7 +27,7 @@ jobs:
shell: bash
steps:
- name: Check out
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up the environment
uses: ./.github/actions/setup-python-env
Expand All @@ -55,7 +46,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up the environment
uses: ./.github/actions/setup-python-env
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/on-release-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
set-version:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Export tag
id: vars
Expand All @@ -24,7 +24,7 @@ jobs:
if: ${{ github.event_name == 'release' }}

- name: Upload updated pyproject.toml
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: pyproject-toml
path: pyproject.toml
Expand All @@ -34,13 +34,13 @@ jobs:
needs: [set-version]
steps:
- name: Check out
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up the environment
uses: ./.github/actions/setup-python-env

- name: Download updated pyproject.toml
uses: actions/download-artifact@v4
uses: actions/download-artifact@v7
with:
name: pyproject-toml

Expand All @@ -57,7 +57,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v4
uses: actions/checkout@v6

- name: Set up the environment
uses: ./.github/actions/setup-python-env
Expand Down
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
- **Test**: `uv run pytest --doctest-modules` or `just test`
- **Test single**: `uv run pytest tests/test_specific.py::test_function`
- **Test with coverage**: `uv run pytest --cov=src/bub`
- **Lint/Check**: `just check` (runs pre-commit, mypy, lock check)
- **Lint/Check**: `just check` (runs prek, mypy, lock check)
- **Type check**: `uv run mypy` (targets `src/` only)
- **Format**: `uv run ruff format .` and `uv run ruff check --fix .`
- **Build**: `just build` (creates wheel with uvx pyproject-build)
- **Docs**: `just docs` (serve) or `just docs-test` (build only)
- **Install dev**: `just install` (uv sync + pre-commit install)
- **Install dev**: `just install` (uv sync + prek install)
- **Sync dependencies**: `uv sync`
- **Add dependency**: `uv add package-name` or `uv add --dev package-name`
- **Update lock**: `uv lock`
Expand Down Expand Up @@ -135,7 +135,7 @@ uv sync
- **Ignore `.pytest_cache/`**: Test cache directories

## Development Workflow
1. **Setup**: `just install` or `uv sync && pre-commit install`
1. **Setup**: `just install` or `uv sync && prek install`
2. **Add feature**: Create feature branch
3. **Code**: Follow style guidelines, add tests
4. **Check**: Run `just check` before committing
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ Then, install and activate the environment with:
uv sync
```

4. Install pre-commit to run linters/formatters at commit time:
1. Install prek to run linters/formatters at commit time:

```bash
uv run pre-commit install
uv run prek install
```

5. Create a branch for local development:
Expand Down
8 changes: 4 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@ install:
#!/usr/bin/env bash
echo "🚀 Creating virtual environment using uv"
uv sync
uv run pre-commit install
uv run prek install

# Run code quality tools
check:
#!/usr/bin/env bash
echo "🚀 Checking lock file consistency with 'pyproject.toml'"
uv lock --locked
echo "🚀 Linting code: Running pre-commit"
uv run pre-commit run -a
echo "🚀 Linting code: Running prek"
uv run prek run -a
echo "🚀 Static type checking: Running mypy"
uv run mypy src

# Run vulture to check for unused code
vulture:
#!/usr/bin/env bash
echo "🚀 Checking for unused code with vulture"
uv run pre-commit run vulture --hook-stage manual --all-files
uv run prek run vulture --hook-stage manual --all-files

# Test the code with pytest
test:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ bub = "bub.cli:app"
[dependency-groups]
dev = [
"pytest>=7.2.0",
"pre-commit>=2.20.0",
"tox-uv>=1.11.3",
"mypy>=0.991",
"ruff>=0.11.5",
"mkdocs>=1.4.2",
"mkdocs-terminal>=4.7.0",
"mkdocstrings[python]>=0.26.1",
"rust-just>=1.42.0",
"prek>=0.3.1",
]

[build-system]
Expand Down
65 changes: 23 additions & 42 deletions uv.lock

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

Loading