Skip to content

Commit

Permalink
ci: Setup build/publish with uv (#692)
Browse files Browse the repository at this point in the history
* ci: Setup build/publish with uv

* Upgrade to v3
  • Loading branch information
manzt authored Sep 24, 2024
1 parent 1bcbf07 commit 94bc169
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
# Disable jupyter-builder build hook because not needed for linting/formatting, and requires pnpm
- run: |
sed -i '' 's/\[tool.hatch.build.hooks.\(.*\)\]/\[_tool.hatch.build.hooks.\1\]/' pyproject.toml
- uses: astral-sh/setup-uv@v2
- uses: astral-sh/setup-uv@v3
with:
version: "0.4.6"
version: "0.4.16"
- run: |
uv run ruff check
uv run ruff format
Expand All @@ -37,9 +37,9 @@ jobs:
# Disable jupyter-builder build hook because not needed for typechecking, and requires pnpm
- run: |
sed -i '' 's/\[tool.hatch.build.hooks.\(.*\)\]/\[_tool.hatch.build.hooks.\1\]/' pyproject.toml
- uses: astral-sh/setup-uv@v2
- uses: astral-sh/setup-uv@v3
with:
version: "0.4.6"
version: "0.4.16"
- run: uv run mypy

TestPython:
Expand All @@ -61,9 +61,9 @@ jobs:
- uses: pnpm/action-setup@v4
with:
run_install: true
- uses: astral-sh/setup-uv@v2
- uses: astral-sh/setup-uv@v3
with:
version: "0.4.6"
version: "0.4.16"
- name: Run tests
run: uv run --with pytest-cov pytest ./tests --color=yes --cov anywidget --cov-report xml
- uses: codecov/codecov-action@v4
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
- uses: pnpm/action-setup@v4
with:
run_install: true
- uses: astral-sh/setup-uv@v2
- uses: astral-sh/setup-uv@v3
with:
version: "0.4.6"
version: "0.4.16"
- name: Create Release Pull Request or Publish
id: changesets
uses: changesets/action@v1
Expand All @@ -36,5 +36,5 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
UV_PUBLISH_USERNAME: __token__
UV_PUBLISH_PASSWORD: ${{ secrets.TWINE_API_KEY }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"build:packages": "tsc --build && pnpm --filter=\"./packages/**\" -r build && pnpm publint",
"clean": "rm -rf anywidget/nbextension/index.js anywidget/labextension && pnpm -r exec rm -rf dist",
"version": "changeset version",
"release": "pnpm build:packages && uvx --from build pyproject-build && changeset publish && uvx twine upload --skip-existing dist/*",
"release": "pnpm build:packages && uv build && changeset publish && uv publish dist/*",
"test": "vitest --environment=happy-dom --run",
"typecheck": "tsc --build && vitest --typecheck.only --run",
"fix": "biome check --write .",
Expand Down
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ dev-dependencies = [
"watchfiles>=0.23.0",
]

[tool.uv.sources]
anywidget = { workspace = true }

[tool.hatch.build.targets.wheel.shared-data]
"anywidget/nbextension" = "share/jupyter/nbextensions/anywidget"
"anywidget/labextension" = "share/jupyter/labextensions/anywidget"
Expand Down

0 comments on commit 94bc169

Please sign in to comment.