-
Notifications
You must be signed in to change notification settings - Fork 110
Migrate project dependency management from Pipenv to uv #1231
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
Changes from 1 commit
07f8086
9be0e9f
086968c
b16aa4d
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 |
|---|---|---|
|
|
@@ -8,25 +8,30 @@ on: | |
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| PYTHONUNBUFFERED: 1 | ||
| UV_PYTHON: "3.9" | ||
| UV_LOCKED: 1 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.9" | ||
| cache: "pipenv" | ||
|
|
||
| - name: Check release validity | ||
| run: sh .github/scripts/check-release.sh | ||
| - name: Install pipenv | ||
| run: pip install pipenv | ||
| - name: Install dependencies | ||
| run: | | ||
| pipenv install | ||
| pipenv run pip3 install build setuptools wheel twine | ||
|
|
||
| - name: Install uv | ||
| uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 | ||
| with: | ||
| version: "0.11.16" | ||
|
|
||
| - name: Build and publish | ||
| env: | ||
| TWINE_USERNAME: __token__ | ||
| TWINE_PASSWORD: "pypi-${{ secrets.PYPI_API_TOKEN }}" | ||
| run: | | ||
| pipenv run python3 -m build | ||
| pipenv run twine upload dist/* | ||
| uv build | ||
| uv run --with=twine -- twine upload dist/* | ||
|
Contributor
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
ls -la .github/workflows || true
sed -n '1,140p' .github/workflows/pypi-publish.yml | nl -baRepository: meilisearch/meilisearch-python Length of output: 647 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "---- pypi-publish.yml (full) ----"
cat -n .github/workflows/pypi-publish.yml | sed -n '1,200p'Repository: meilisearch/meilisearch-python Length of output: 1163 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Find all usages of PyPI API token / twine password
rg -n "PYPI_API_TOKEN|TWINE_PASSWORD|TWINE_USERNAME|twine upload|trusted publishing|oidc|OIDC" .github/workflows -S || true
# Look for uv cache-related hardening/controls
rg -n "UV_CACHE|cache|setup-uv|astral-sh/setup-uv|cache-poison" .github/workflows -S || true
# Also scan any mentioned scripts
rg -n "trusted publishing|oidc|twine|TWINE_PASSWORD|PYPI_API_TOKEN" .github/scripts -S || trueRepository: meilisearch/meilisearch-python Length of output: 1289 Switch PyPI publishing to OIDC trusted publishing (stop using The workflow uploads with 🧰 Tools🪛 zizmor (1.25.2)[info] 37-37: prefer trusted publishing for authentication (use-trusted-publishing): this command (use-trusted-publishing) 🤖 Prompt for AI Agents
Contributor
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.
@curquiza We should really consider switching to OIDC trusted publishing for publishing the project to PyPI in the near future, given the many supply chain and security attacks happening nowadays.
Contributor
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.
Contributor
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. Created #1232 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,12 @@ | ||
| FROM python:3.9-buster | ||
|
|
||
| COPY Pipfile . | ||
| COPY Pipfile.lock . | ||
| COPY pyproject.toml . | ||
| COPY uv.lock . | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| RUN apt-get update -y | ||
|
Strift marked this conversation as resolved.
|
||
|
|
||
| # Install pipenv and compilation dependencies | ||
| RUN pip3 install pipenv | ||
| RUN pipenv install --dev | ||
| # Install uv | ||
| COPY --from=ghcr.io/astral-sh/uv:0.11.16 /uv /uvx /bin/ | ||
|
|
||
| # Install dependencies | ||
| RUN uv sync --frozen | ||
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.