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

infra: migrate to uv #84

Merged
merged 24 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
896c4ab
infra: migrate to uv
JacobCoffee Oct 9, 2024
323cee3
infra: migrate to uv
JacobCoffee Oct 9, 2024
9b16ed9
ci: remove extra from template
JacobCoffee Oct 9, 2024
caf3e2e
ci: add changelog genny
JacobCoffee Oct 9, 2024
2e4f84a
Update README.md
JacobCoffee Oct 9, 2024
4d46fc6
chore: update startcmd
JacobCoffee Oct 9, 2024
5fbd4a8
fix: adjust targets
JacobCoffee Oct 9, 2024
49c40b6
fix: adjust for dep updates
JacobCoffee Oct 9, 2024
3a29068
fix: try to make railway happy
JacobCoffee Oct 9, 2024
b22d757
fix: try to make railway happy again
JacobCoffee Oct 9, 2024
91d4f7c
Revert "fix: try to make railway happy again"
JacobCoffee Oct 9, 2024
cec03f3
fix: try to make railway happy again 3
JacobCoffee Oct 9, 2024
0fa1ef0
fix: try to make railway happy again 4
JacobCoffee Oct 9, 2024
e5928c2
fix: try to make railway happy again 5
JacobCoffee Oct 9, 2024
707a53c
fix: try to make railway happy again 6
JacobCoffee Oct 9, 2024
8003b10
fix: try to make railway happy again 7
JacobCoffee Oct 9, 2024
fef0ad7
fix: try to make railway happy again 8
JacobCoffee Oct 10, 2024
8fa14fc
fix: try to make railway happy again 9
JacobCoffee Oct 10, 2024
5bf6d2e
fix: try to make railway happy again 10
JacobCoffee Oct 10, 2024
fc2c521
fix: try to make railway happy again 11
JacobCoffee Oct 10, 2024
7fa9f5d
fix: try to make railway happy again 12
JacobCoffee Oct 10, 2024
fa98e00
fix: try to make railway happy again 13
JacobCoffee Oct 10, 2024
c031637
python packaging is so fucking stupid
JacobCoffee Oct 10, 2024
3a96cf5
ci: apply lint
JacobCoffee Oct 11, 2024
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
64 changes: 30 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Set up Python
run: uv python install 3.11

- name: Install Pre-Commit
run: python -m pip install pre-commit && pre-commit install
- name: Create virtual environment
run: uv sync --all-extras --dev

- name: Install Pre-Commit hooks
run: uv run pre-commit install

- name: Load cached Pre-Commit Dependencies
JacobCoffee marked this conversation as resolved.
Show resolved Hide resolved
id: cached-pre-commit-dependencies
Expand All @@ -27,14 +32,12 @@ jobs:
key: pre-commit|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}

- name: Execute Pre-Commit
run: pre-commit run --show-diff-on-failure --color=always --all-files
run: uv run pre-commit run --show-diff-on-failure --color=always --all-files

test:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
python-version: ["3.11"]
timeout-minutes: 15
defaults:
run:
Expand All @@ -43,18 +46,17 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- uses: pdm-project/setup-pdm@v3
name: Set up PDM
with:
python-version: ${{ matrix.python-version }}
allow-python-prereleases: true
cache: true
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install dependencies
run: pdm install
- name: Set up Python
run: uv python install 3.11

- name: Create virtual environment
run: uv sync --all-extras --dev

- name: Test
run: pdm run pytest
run: uv run pytest

build-docs:
env:
Expand All @@ -70,33 +72,27 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v3

- uses: pdm-project/setup-pdm@v3
name: Set up PDM
with:
python-version: "3.11"
allow-python-prereleases: true
cache: true
- name: Set up Python
run: uv python install 3.11

- name: Install dependencies
run: pdm install -G:docs
- name: Create virtual environment
run: uv sync --all-extras --dev

- name: Build docs
run: pdm run make docs
run: uv run make docs

- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
run: echo $PR_NUMBER > .pr_number
run: |
echo "${{ github.event.number }}" > .pr_number

- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: docs-preview
path: |
docs/_build/html
.pr_number
include-hidden-files: true
16 changes: 11 additions & 5 deletions .github/workflows/docs-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,33 @@ jobs:
uses: actions/checkout@v4

- name: Download artifact
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v6
with:
workflow_conclusion: success
run_id: ${{ github.event.workflow_run.id }}
path: docs-preview
name: docs-preview

- name: Set PR number
run: echo "PR_NUMBER=$(cat docs-preview/.pr_number)" >> $GITHUB_ENV
- name: Validate and set PR number
run: |
PR_NUMBER=$(cat docs-preview/.pr_number)
if ! [[ "$PR_NUMBER" =~ ^[0-9]+$ ]]; then
echo "Invalid PR number: $PR_NUMBER"
exit 1
fi
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV

- name: Deploy docs preview
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: docs-preview/docs/_build/html
token: ${{ secrets.DOCS_PREVIEW_DEPLOY_TOKEN }}
token: ${{ secrets.DOCS_PREVIEW_DEPLOY_KEY }}
repository-name: JacobCoffee/byte-docs-preview
clean: false
target-folder: ${{ env.PR_NUMBER }}
branch: gh-pages

- uses: actions/github-script@v6
- uses: actions/github-script@v7
env:
PR_NUMBER: ${{ env.PR_NUMBER }}
with:
Expand Down
19 changes: 7 additions & 12 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,24 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install uv
uses: astral-sh/setup-uv@v3

- uses: pdm-project/setup-pdm@v3
name: Set up PDM
with:
python-version: "3.11"
allow-python-prereleases: true
cache: true
- name: Set up Python
run: uv python install 3.11

- name: Install dependencies
run: pdm install -G:docs
run: uv sync --all-extras --dev

- name: Fetch gh pages
run: git fetch origin gh-pages --depth=1

- name: Build release docs
run: pdm run python tools/build_docs.py docs-build
run: uv run python tools/build_docs.py docs-build
if: github.event_name == 'release'

- name: Build dev docs
run: pdm run python tools/build_docs.py docs-build
run: uv run python tools/build_docs.py docs-build
if: github.event_name == 'push'

- name: Deploy
Expand Down
Loading
Loading