-
Notifications
You must be signed in to change notification settings - Fork 7
uv migration #92
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
base: develop
Are you sure you want to change the base?
uv migration #92
Changes from all commits
e80e08b
d45c5ea
54743c6
7993b4f
5d78e95
70c0206
b5724bc
d150b82
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,54 +10,32 @@ permissions: | |
| actions: read | ||
| contents: read | ||
|
|
||
| env: | ||
| POETRY_VERSION: "1.6.1" | ||
| PYTHON_VERSION: "3.11" | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| id: setup-python | ||
| with: | ||
| python-version: ${{ env.PYTHON_VERSION }} | ||
| - name: 🛎️ Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Load cached Poetry installation | ||
| id: cached-poetry | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.local | ||
| key: poetry-${{ runner.os }}-${{ env.POETRY_VERSION }}-${{ steps.setup-python.outputs.python-version }} | ||
| - name: Install Poetry | ||
| id: install-poetry | ||
| if: steps.cached-poetry.outputs.cache-hit != 'true' | ||
| uses: snok/install-poetry@v1 | ||
| with: | ||
| version: ${{ env.POETRY_VERSION }} | ||
| virtualenvs-create: true | ||
| virtualenvs-in-project: true | ||
| installer-parallel: true | ||
| - name: Poetry git plugin | ||
| run: poetry self add poetry-git-version-plugin | ||
| - name: Load cached venv | ||
| id: cached-poetry-dependencies | ||
| uses: actions/cache@v4 | ||
| - name: 📦 Install uv | ||
| uses: astral-sh/setup-uv@v4 | ||
|
|
||
| - name: 🐍 Set up Python | ||
| uses: actions/setup-python@v5 | ||
|
Comment on lines
+23
to
+24
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's no need for this; (I can't suggest it as a change because of the interrupted diff unfortunately) |
||
| with: | ||
| path: .venv | ||
| key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
|
||
| - name: Poetry Install | ||
| run: poetry install -n -v | ||
| - name: Poetry Build | ||
| run: poetry build -v | ||
|
|
||
| - name: Ruff | ||
| run: poetry run ruff . | ||
| - name: Black | ||
| run: poetry run black . | ||
| - name: Pytest | ||
| run: poetry run pytest | ||
| - name: Check stubs | ||
| run: poetry run python -m ziglang build generate-stubs -Dcheck-stubs=true | ||
| python-version-file: ".python-version" | ||
|
|
||
| - name: 🦾 Install dependencies | ||
| run: uv sync --all-extras | ||
|
|
||
| - name: 🔍 Lint with Ruff | ||
| run: uv run ruff check . | ||
|
|
||
| - name: 🖌️ Format with Black | ||
| run: uv run black --check . | ||
|
|
||
| - name: 🧪 Run tests | ||
| run: uv run pytest | ||
|
|
||
| - name: 🔎 Check stubs | ||
| run: uv run -m ziglang build generate-stubs -Dcheck-stubs=true | ||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,48 +8,26 @@ permissions: | |||||||||
| id-token: write | ||||||||||
| contents: read | ||||||||||
|
|
||||||||||
| env: | ||||||||||
| POETRY_VERSION: "1.6.1" | ||||||||||
| PYTHON_VERSION: "3.11" | ||||||||||
|
|
||||||||||
| jobs: | ||||||||||
| publish: | ||||||||||
| environment: | ||||||||||
| name: pypi | ||||||||||
| url: https://pypi.org/p/ziggy-pydust-template | ||||||||||
| runs-on: ubuntu-latest | ||||||||||
| steps: | ||||||||||
| - uses: actions/checkout@v4 | ||||||||||
| - uses: actions/setup-python@v5 | ||||||||||
| id: setup-python | ||||||||||
| with: | ||||||||||
| python-version: ${{ env.PYTHON_VERSION }} | ||||||||||
| - name: 🛎️ Checkout | ||||||||||
| uses: actions/checkout@v4 | ||||||||||
|
|
||||||||||
| - name: Load cached Poetry installation | ||||||||||
| id: cached-poetry | ||||||||||
| uses: actions/cache@v4 | ||||||||||
| with: | ||||||||||
| path: ~/.local | ||||||||||
| key: poetry-${{ runner.os }}-${{ env.POETRY_VERSION }}-${{ steps.setup-python.outputs.python-version }} | ||||||||||
| - name: Install Poetry | ||||||||||
| id: install-poetry | ||||||||||
| if: steps.cached-poetry.outputs.cache-hit != 'true' | ||||||||||
| uses: snok/install-poetry@v1 | ||||||||||
| with: | ||||||||||
| version: ${{ env.POETRY_VERSION }} | ||||||||||
| virtualenvs-create: true | ||||||||||
| virtualenvs-in-project: true | ||||||||||
| installer-parallel: true | ||||||||||
| - name: Poetry git plugin | ||||||||||
| run: poetry self add poetry-git-version-plugin | ||||||||||
| - name: Load cached venv | ||||||||||
| id: cached-poetry-dependencies | ||||||||||
| uses: actions/cache@v4 | ||||||||||
| - name: 📦 Install uv | ||||||||||
| uses: astral-sh/setup-uv@v4 | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see my comment above for the juicy deets:
Suggested change
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. v5 and enable cache https://github.com/spiraldb/actions/blob/develop/.github/actions/setup-uv/action.yml#L21 maybe |
||||||||||
|
|
||||||||||
| - name: 🐍 Set up Python | ||||||||||
| uses: actions/setup-python@v5 | ||||||||||
|
Comment on lines
+24
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this still needed?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤔
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just run |
||||||||||
| with: | ||||||||||
| path: .venv | ||||||||||
| key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||||||||||
| python-version-file: ".python-version" | ||||||||||
|
|
||||||||||
| - name: 🛠️ Build package | ||||||||||
| run: uv build | ||||||||||
|
|
||||||||||
| - name: Poetry Build | ||||||||||
| run: poetry build -v | ||||||||||
| - name: Publish package distributions to PyPI | ||||||||||
| - name: 🚀 Publish to PyPI | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe you're already aware, but
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://docs.astral.sh/uv/guides/package/#publishing-your-package There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hm yea... that would complicate things
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. By loginless, do you mean trusted publishing? |
||||||||||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||||||||||
|
itsmeadarsh2008 marked this conversation as resolved.
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 3.12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the meantime this
setup-uvaction has gotten av5release.Also, by explicitly setting a
python-version, you avoid having to use a.python-versionfileUh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think using a
.python-versionuses a standard way is a better way to declare compatible python version which I can refer to anywhere in the code, if I use it explicitly, I would have edit all the places where I referred to the incompatibility whenever I had to increment the python version.Edit: Anyways, I am good with using v5