-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Convert project & packaging config to uv
- Loading branch information
Showing
8 changed files
with
2,771 additions
and
3,346 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,9 +26,7 @@ jobs: | |
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: snok/[email protected] | ||
with: | ||
virtualenvs-in-project: true | ||
- uses: yezz123/setup-uv@v4 | ||
|
||
# Cache packages per python version, and reuse until lockfile changes | ||
- name: Cache python packages | ||
|
@@ -39,11 +37,11 @@ jobs: | |
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} | ||
- name: Install dependencies | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: poetry install -v -E all | ||
run: uv sync | ||
|
||
# Run tests with coverage report | ||
- name: Run tests | ||
run: poetry run pytest -rs -x -vv ${{ env.XDIST_ARGS }} ${{ env.COVERAGE_ARGS }} | ||
run: uv run pytest -rs -x -vv ${{ env.XDIST_ARGS }} ${{ env.COVERAGE_ARGS }} | ||
|
||
# Latest python version: send coverage report to codecov | ||
- name: "Upload coverage report to Codecov" | ||
|
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 |
---|---|---|
|
@@ -27,30 +27,19 @@ jobs: | |
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.LATEST_PY_VERSION }} | ||
- uses: snok/[email protected] | ||
with: | ||
virtualenvs-in-project: true | ||
- uses: yezz123/setup-uv@v4 | ||
|
||
- name: Set pre-release version | ||
if: ${{ !startsWith(github.ref, 'refs/tags/v') }} | ||
env: | ||
pre-release-suffix: ${{ github.event.inputs.pre-release-suffix || 'dev' }} | ||
pre-release-version: ${{ github.event.inputs.pre-release-version || github.run_number }} | ||
run: | | ||
poetry version $(poetry version -s).${{ env.pre-release-suffix }}${{ env.pre-release-version }} | ||
poetry version | ||
PKG_VERSION=$(sed -n "s/^version\s*=\s*'\(.*\)'/\1/p") | ||
DEV_VERSION=$PKG_VERSION.${{ env.pre-release-suffix }}${{ env.pre-release-version }} | ||
echo "Setting version to $DEV_VERSION" | ||
sed -i "s/^version\s*=.*/version='$DEV_VERSION'/" pyproject.toml | ||
- name: Build package distributions | ||
run: poetry build | ||
run: uvx --from build pyproject-build --installer uv | ||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
# Notify Docker image repo that there's a new release available | ||
#- name: Repository Dispatch | ||
# if: ${{ startsWith(github.ref, 'refs/tags/v') }} | ||
# uses: peter-evans/repository-dispatch@v1 | ||
# with: | ||
# token: ${{ secrets.DOCKERHUB_TRIGGER_TOKEN }} | ||
# repository: JWCook/pyinaturalist-notebook | ||
# event-type: post-release | ||
# client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' |
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 |
---|---|---|
|
@@ -18,6 +18,7 @@ eggs | |
lib | ||
lib64 | ||
parts | ||
scratch | ||
sdist | ||
var | ||
venv/ | ||
|
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
Oops, something went wrong.