-
Notifications
You must be signed in to change notification settings - Fork 187
chore: python project migration to uv #20135
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
Open
neo-jesse
wants to merge
13
commits into
edge
Choose a base branch
from
api-and-shared-uv-migration
base: edge
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+16,952
−15,048
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4840155
squashed commits
neo-jesse acb5c36
suggestions
neo-jesse 5dae920
numpy update
neo-jesse 72ec953
python-uv got removed
neo-jesse eafd9cd
wrong version
neo-jesse 21bdd73
more numpy updates
neo-jesse 07bc0ab
uv lock
neo-jesse 01d7b37
uv lock, numpy version again
neo-jesse 693537b
more numpy
neo-jesse e714bbd
no 3.10
neo-jesse 9e886ba
regen lock files with 3.12
neo-jesse 16950bc
should be using UV already
neo-jesse 9e7fdb4
typeguard update
neo-jesse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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,40 @@ | ||
| name: 'UV Python Setup' | ||
| description: 'Set up the environment for a UV-managed Python project' | ||
| inputs: | ||
| project: | ||
| description: 'Which project (by subdirectory) to set up' | ||
| required: true | ||
| python-version: | ||
| description: 'Python version to install via setup-uv' | ||
| required: false | ||
| default: '3.12' | ||
| install-system-deps: | ||
| description: 'Whether to install system dependencies (libsystemd-dev on Linux)' | ||
| required: false | ||
| default: 'true' | ||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - shell: bash | ||
| if: inputs.install-system-deps == 'true' | ||
| run: | | ||
| if [[ "${OSTYPE}" =~ "linux" ]]; then | ||
| # WORKAROUND: Remove microsoft debian repo due to https://github.com/microsoft/linux-package-repositories/issues/130. Remove line below after it is resolved | ||
| sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list | ||
| sudo apt-get update | ||
| sudo apt-get install -y --no-install-recommends libsystemd-dev | ||
| fi | ||
| - shell: bash | ||
| run: npm install --global [email protected] | ||
| - name: Setup Python and UV | ||
| uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| python-version: ${{ inputs.python-version }} | ||
| enable-cache: true | ||
| cache-dependency-glob: | | ||
| ${{ inputs.project }}/pyproject.toml | ||
| ${{ inputs.project }}/uv.lock | ||
| - name: Setup Python Environment | ||
| id: setup-env | ||
| shell: bash | ||
| run: make -C ${{ inputs.project }} setup |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -4,10 +4,10 @@ inputs: | |
| project: | ||
| description: 'Which project (by subdirectory) to set up' | ||
| required: true | ||
| python-version: | ||
| description: "What Python version to use to create the project's virtual environment" | ||
| install-system-deps: | ||
| description: 'Whether to install system dependencies (libsystemd-dev on Linux)' | ||
| required: false | ||
| default: "false" | ||
| default: 'true' | ||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
|
|
@@ -28,11 +28,21 @@ runs: | |
| run: echo "OT_VIRTUALENV_VERSION=${{ inputs.python-version }}" >> $GITHUB_ENV | ||
| - shell: bash | ||
| run: npm install --global [email protected] | ||
| - shell: bash | ||
| run: $OT_PYTHON -m pip install --upgrade pip | ||
| - shell: bash | ||
| run: $OT_PYTHON -m pip install --user pipenv==2023.12.1 | ||
| - shell: bash | ||
| run: $OT_PYTHON -m pip install --user virtualenv==20.30.0 | ||
| - shell: bash | ||
| run: 'make -C ${{ inputs.project }} setup || make -C ${{ inputs.project }} setup' | ||
| - name: Setup Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.12' | ||
| - name: Install pipenv and virtualenv | ||
| shell: bash | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install --user pipenv==2023.12.1 | ||
| python -m pip install --user virtualenv==20.30.0 | ||
| - name: Setup Python Environment | ||
| id: setup-env | ||
| shell: bash | ||
| run: | | ||
| # For pipenv projects, make setup runs "pipenv sync --dev" which always installs dev dependencies | ||
| # (see scripts/python.mk where pipenv_opts includes --dev) | ||
| make -C ${{ inputs.project }} setup | ||
| echo "::notice::Setup completed" | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 was deleted.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.