-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: migrate from Poetry to uv (#220)
- Loading branch information
Showing
13 changed files
with
662 additions
and
1,046 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
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 |
---|---|---|
|
@@ -12,54 +12,19 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v4 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Get Python version | ||
id: python-version | ||
run: echo version="$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")" >> "$GITHUB_OUTPUT" | ||
|
||
- name: Run Poetry image | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: "1.1.12" | ||
|
||
- name: Set Poetry virtualenv | ||
run: poetry config virtualenvs.in-project true | ||
|
||
- name: Set up cache | ||
uses: actions/cache@v4 | ||
id: cache | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.python-version.outputs.version }}-${{ hashFiles('poetry.lock') }} | ||
|
||
- name: Ensure cache is healthy | ||
if: steps.cache.outputs.cache-hit == 'true' | ||
shell: bash | ||
run: timeout 10s python -m poetry run pip --version || rm -rf .venv | ||
|
||
- name: Install dependencies | ||
run: poetry install --no-interaction | ||
|
||
# - name: Bump version | ||
# env: | ||
# VERSION: ${{ github.event.release.tag_name }} | ||
# run: poetry version $(echo $VERSION | sed -e 's/^v//') | ||
version: latest | ||
|
||
- name: Build | ||
run: poetry build | ||
run: uv build | ||
|
||
- name: Publish TestPyPI | ||
run: uv publish --trusted-publishing always -r testpypi | ||
env: | ||
POETRY_REPOSITORIES_TESTPYPI_URL: https://test.pypi.org/legacy/ | ||
POETRY_HTTP_BASIC_TESTPYPI_USERNAME: __token__ | ||
POETRY_HTTP_BASIC_TESTPYPI_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
run: poetry publish -r testpypi | ||
UV_PUBLISH_URL: https://test.pypi.org/legacy/ | ||
|
||
- name: Publish PyPI | ||
env: | ||
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_API_TOKEN }} | ||
run: poetry publish | ||
run: uv publish --trusted-publishing always |
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 |
---|---|---|
|
@@ -44,16 +44,10 @@ things.commit(todo) | |
|
||
See [main.py](./main.py). | ||
|
||
1. Install dependencies | ||
Pass your Things Cloud credentials as environment examples to run the example | ||
|
||
```sh | ||
poetry install | ||
``` | ||
|
||
2. Pass your Things Cloud credentials as environment examples to run the example | ||
|
||
```sh | ||
[email protected] THINGS_PASSWORD=your-password python main.py | ||
[email protected] THINGS_PASSWORD=your-password uv run main.py | ||
``` | ||
|
||
### Progress | ||
|
Oops, something went wrong.