-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* migrate to uv from poetry
- Loading branch information
Showing
6 changed files
with
812 additions
and
1,074 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Publish Package | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
- uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/uv | ||
key: publish-${{ hashFiles('pyproject.toml') }} | ||
- uses: arduino/setup-task@v1 | ||
- run: curl -LsSf https://astral.sh/uv/install.sh | sh | ||
- run: task publish | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,38 @@ | ||
version: "3" | ||
|
||
tasks: | ||
lock: | ||
desc: "lock with update" | ||
cmds: | ||
- uv lock --upgrade | ||
|
||
install: | ||
desc: "install local dependencies" | ||
cmds: | ||
- poetry install --sync --no-root --all-extras | ||
- uv sync --all-extras --frozen | ||
|
||
lint: | ||
desc: "run linters" | ||
cmds: | ||
- poetry run ruff format . | ||
- poetry run ruff check . --fix | ||
- poetry run mypy . | ||
- uv run ruff format . | ||
- uv run ruff check . --fix | ||
- uv run mypy . | ||
|
||
lint-ci: | ||
desc: "run linters" | ||
cmds: | ||
- poetry run ruff format . --check | ||
- poetry run ruff check . --no-fix | ||
- poetry run mypy . | ||
- uv run ruff format . --check | ||
- uv run ruff check . --no-fix | ||
- uv run mypy . | ||
|
||
tests: | ||
desc: "run pytest (pass args after '--')" | ||
cmds: | ||
- poetry run pytest {{.CLI_ARGS}} | ||
- uv run pytest {{.CLI_ARGS}} | ||
|
||
release: | ||
desc: "bump version, create tag and release, publish to PYPI" | ||
publish: | ||
cmds: | ||
- git checkout main | ||
- git pull | ||
- rm -rf ./dist | ||
- poetry version {{.CLI_ARGS}} | ||
- git add pyproject.toml | ||
- git commit -m "bump version to {{.CLI_ARGS}}" | ||
- poetry build | ||
- twine upload dist/* | ||
- git tag {{.CLI_ARGS}} | ||
- git push | ||
- git push --tags | ||
- gh release create --generate-notes {{.CLI_ARGS}} | ||
- gh release upload {{.CLI_ARGS}} ./dist/* | ||
- rm -rf dist/* | ||
- uv tool run --from build python -m build --installer uv | ||
- uv tool run twine check dist/* | ||
- uv tool run twine upload dist/* --username __token__ --password $PYPI_TOKEN |
Oops, something went wrong.