Repository navigation
Migrate python install to uv #52
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
WojciechKozak98
wants to merge
28
commits into
main
Choose a base branch
from
migrate-python-install-to-uv
base: main
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.
Open
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
72b7233
Refactor Python installation tasks in main.yml
WojciechKozak98 2698712
Refactor Python installation tasks in main.yml
WojciechKozak98 a83e26a
Update pip install commands with extra_args
WojciechKozak98 e47f704
Update install-jupyter.yml
WojciechKozak98 4deec81
Fix typo in system_dependencies key
WojciechKozak98 6fba485
Update _rocky-8.yml
WojciechKozak98 909ef8d
Update .ansible-lint
WojciechKozak98 6fc1938
Change uv installation method to use a script
WojciechKozak98 2377f7f
Download uv install script before installation
WojciechKozak98 ca147b0
Update _ubuntu.yml
WojciechKozak98 019bae7
Add curl to system dependencies in _redhat-9.yml
WojciechKozak98 b250c66
Add curl to system dependencies in rocky-8.yml
WojciechKozak98 7db857d
Refactor pip installation to use environment variables
WojciechKozak98 777b1b5
Refactor Jupyter package installation in Ansible playbook
WojciechKozak98 d8a8fac
Refactor Jupyter package installation task
WojciechKozak98 6e6390e
Refactor Jupyter package installation task
WojciechKozak98 e2aad60
Add 'allowerasing' option to dnf task
WojciechKozak98 21f4f7f
Add uv_version to main.yml
WojciechKozak98 33428fe
Add Ansible tasks for installing Python using uv
WojciechKozak98 d666009
Refactor Python installation tasks in main.yml
WojciechKozak98 d940c28
Refactor Python installation tasks in main.yml
WojciechKozak98 ea152c9
Fix formatting in install-jupyter.yml
WojciechKozak98 1f44cda
Remove Python installation task inclusion
WojciechKozak98 61701ed
Remove Python installation task inclusion
WojciechKozak98 0260373
Add shared installation tasks for Python
WojciechKozak98 d77fc58
Update description for Python installation role
WojciechKozak98 bfa4491
Update installation method and add uv version info
WojciechKozak98 3361818
Add changelog for Python installation updates
WojciechKozak98 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
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 |
|---|---|---|
|
|
@@ -9,5 +9,4 @@ exclude_paths: | |
| - molecule/jupyter-system | ||
| offline: false | ||
| use_default_rules: true | ||
| parseable: true | ||
| verbosity: 1 | ||
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,21 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to this project will be documented in this file. | ||
|
|
||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). | ||
|
|
||
| ## [Unreleased] | ||
|
|
||
| ### Changed | ||
| - Python installation now uses [`uv`](https://docs.astral.sh/uv/) instead of Posit's prebuilt binaries, which are no longer being built by Posit for new Python versions. | ||
| - `uv` itself is installed by downloading a pinned release archive from GitHub releases, rather than running the upstream install script. | ||
| - The symlink from `/opt/python/{{ version }}` to the actual `uv`-managed install directory is now created with the `ansible.builtin.file` module instead of a raw shell command. | ||
| - Installation tasks shared between Debian and RedHat families were extracted into a common `tasks/install-python.yml`, included by both `tasks/debian/main.yml` and `tasks/redhat/main.yml`. | ||
| - `pip` calls that install directly into the `uv`-managed Python now set `PIP_BREAK_SYSTEM_PACKAGES`/`PIP_ROOT_USER_ACTION` as environment variables (needed for PEP 668 "externally managed environment" enforcement on newer Python/pip versions). | ||
|
|
||
| ### Added | ||
| - New `uv_version` variable controlling which `uv` release gets installed. | ||
| - `curl` added to the system dependencies list (needed by the `uv` install process). | ||
|
|
||
| ### Removed | ||
| - `python_download_url` variable (no longer used now that Python isn't downloaded as a distro-specific package). |
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 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,45 @@ | ||
| --- | ||
| - name: Install Python | Download uv release archive | ||
| ansible.builtin.get_url: | ||
| url: "https://github.com/astral-sh/uv/releases/download/{{ uv_version }}/uv-x86_64-unknown-linux-gnu.tar.gz" | ||
| dest: /tmp/uv.tar.gz | ||
| mode: "0644" | ||
|
|
||
| - name: Install Python | Extract uv binary | ||
| ansible.builtin.unarchive: | ||
| src: /tmp/uv.tar.gz | ||
| dest: /usr/local/bin | ||
| remote_src: true | ||
| extra_opts: | ||
| - --strip-components=1 | ||
| - --wildcards | ||
| - "*/uv" | ||
| creates: /usr/local/bin/uv | ||
|
|
||
| - name: Install Python | Install Python versions via uv | ||
| ansible.builtin.command: /usr/local/bin/uv python install {{ item }} --install-dir=/opt/python | ||
| loop: "{{ python_versions }}" | ||
| register: command_result | ||
| changed_when: "'Installed' in command_result.stdout" | ||
| tags: | ||
| - python-install-install-archives | ||
| - python-install-setup-versions | ||
|
|
||
| - name: Install Python | Find installed build directory | ||
| ansible.builtin.find: | ||
| paths: /opt/python | ||
| patterns: "cpython-{{ item }}-*" | ||
| file_type: directory | ||
| loop: "{{ python_versions }}" | ||
| register: python_build_dirs | ||
| tags: | ||
| - python-install-setup-versions | ||
|
|
||
| - name: Install Python | Symlink versioned path | ||
| ansible.builtin.file: | ||
| src: "{{ (item.files | first).path }}" | ||
| dest: "/opt/python/{{ item.item }}" | ||
| state: link | ||
| loop: "{{ python_build_dirs.results }}" | ||
| tags: | ||
| - python-install-setup-versions |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| # vars file | ||
| --- | ||
| system_dependecies: | ||
| - curl | ||
| - libev-devel | ||
| python_download_url: "https://cdn.rstudio.com/python/rhel-9/pkgs" |
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 |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| # vars file | ||
| --- | ||
| system_dependecies: | ||
| - curl | ||
| - libev-devel | ||
| python_download_url: "https://cdn.rstudio.com/python/centos-8/pkgs" |
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 |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| --- | ||
| python_system_dependecies: | ||
| - build-essential | ||
| - curl | ||
| - libffi-dev | ||
| - libgdbm-dev | ||
| - libsqlite3-dev | ||
|
|
||
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.