Skip to content

Commit

Permalink
Add RHEL support to the python feature (#830)
Browse files Browse the repository at this point in the history
* install gpg2.22 on centos 7 when installing python

* RHEL support, exisiting tests pass, new RHEL tests pass.

* add tests, cleanup install organization

* update testing to include RHEL tests

* update testing to include RHEL tests

* undo addition of installing additional pip modules

* fix errors installing os-provided Python on recent Debian systems and on Mariner systems

* adjust to properly use newly installed python (PYTHON_SRC) instead of assuming "python" will work

* When installing pipx, check if python is marked as externally
managed. If so, add "--break-system-packages" to the pip install
flags.

This does not really breack system packages due to the setting of
PYTHONUSERBASE during the install of pipx, but does get us past
checks for installing python packages into the system python install.

* merge from main

* update check for managed python install. pass all tests.

* add "packages" option from PR #768

* remove "packages" option

* Address PR feedback, passes all tests locally.

* fix install error on centos

---------

Co-authored-by: Jeff Putsch <[email protected]>
  • Loading branch information
jdputschadi and Jeff Putsch authored Feb 9, 2024
1 parent 1592dd5 commit 30e03b6
Show file tree
Hide file tree
Showing 23 changed files with 1,073 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:

test-scenarios:
needs: [detect-changes]
runs-on: ubuntu-latest
runs-on: devcontainer-image-builder-ubuntu
continue-on-error: true
strategy:
matrix:
Expand Down
2 changes: 1 addition & 1 deletion src/python/NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

## OS Support

This Feature should work on recent versions of Debian/Ubuntu-based distributions with the `apt` package manager installed.
This Feature should work on recent versions of Debian/Ubuntu, RedHat Enterprise Linux, Fedora, Alma, and RockyLinux distributions with the apt, yum, dnf, or microdnf package manager installed.

`bash` is required to execute the `install.sh` script.
20 changes: 15 additions & 5 deletions src/python/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "python",
"version": "1.3.2",
"version": "1.4.0",
"name": "Python",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/python",
"description": "Installs the provided version of Python, as well as PIPX, and other common Python utilities. JupyterLab is conditionally installed with the python feature. Note: May require source code compilation.",
Expand All @@ -25,13 +25,23 @@
"installTools": {
"type": "boolean",
"default": true,
"description": "Install common Python tools like pylint"
"description": "Flag indicating whether or not to install the tools specified via the 'toolsToInstall' option. Default is 'true'."
},
"toolsToInstall": {
"type": "string",
"default": "flake8,autopep8,black,yapf,mypy,pydocstyle,pycodestyle,bandit,pipenv,virtualenv,pytest,pylint",
"description": "Comma-separated list of tools to install when 'installTools' is true. Defaults to a set of common Python tools like pylint."
},
"optimize": {
"type": "boolean",
"default": false,
"description": "Optimize Python for performance when compiled (slow)"
},
"enableShared": {
"type": "boolean",
"default": false,
"description": "Enable building a shared Python library"
},
"installPath": {
"type": "string",
"default": "/usr/local/python",
Expand Down Expand Up @@ -71,7 +81,7 @@
}
},
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils",
"ghcr.io/devcontainers/features/oryx"
"ghcr.io/devcontainers/features/common-utils",
"ghcr.io/devcontainers/features/oryx"
]
}
}
Loading

0 comments on commit 30e03b6

Please sign in to comment.