Skip to content
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

Require Python 3.9 to run repo2docker #1411

Merged
merged 4 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:

jobs:
docker:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ on:

jobs:
build-n-publish:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
python-version: "3.13"

- name: install build requirements
run: |
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
password: ${{ secrets.PYPI_PASSWORD }}

publish-docker:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
env:
DEFAULT_REGISTRY: quay.io
IMAGE_NAME: jupyterhub/repo2docker
Expand Down
18 changes: 7 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
strategy:
fail-fast: false
matrix:
ubuntu_version: ["22.04"]
python_version: ["3.9"]
ubuntu_version: ["24.04"]
python_version: ["3.13"]
repo_type:
- base
- conda
Expand All @@ -64,17 +64,13 @@ jobs:
- unit
- venv
- contentproviders
# Playwright test
- ui
include:
# The actions/setup-python action with Python version 3.6 isn't
# possible to use with the ubuntu-22.04 runner, so we use ubuntu-20.04
# for this test where Python 3.6 remain available.
- ubuntu_version: "20.04"
python_version: "3.6"
# The earliest actions/setup-python versions depend on the runner.
- ubuntu_version: "22.04"
python_version: "3.9"
repo_type: venv
# Playwright test
- ubuntu_version: "24.04"
python_version: "3.13"
repo_type: ui

steps:
- uses: actions/checkout@v4
Expand Down
11 changes: 5 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ repos:
hooks:
- id: pyupgrade
args:
- --py36-plus
- --py38-plus
# check-tmp is a Python based test script run in created environments
# that can be at least Python 3.5 even though we require Python 3.6 for
# repo2docker itself.
# that can be Python 3.5, older than the Python version required to run
# repo2docker.
exclude: check-tmp

# Autoformat: Python code
Expand All @@ -27,12 +27,11 @@ repos:
hooks:
- id: black
args:
- --target-version=py36
- --target-version=py37
- --target-version=py38
- --target-version=py39
- --target-version=py310
- --target-version=py311
- --target-version=py312
- --target-version=py313

# Autoformat: Python code
- repo: https://github.com/pycqa/isort
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ For more information, please visit

1. Docker to build & run the repositories. The [community edition](https://store.docker.com/search?type=edition&offering=community)
is recommended.
2. Python 3.6+.
2. Python 3.9+.

Supported on Linux and macOS. [See documentation note about Windows support.](http://repo2docker.readthedocs.io/en/latest/install.html#note-about-windows-support)

Expand Down
38 changes: 19 additions & 19 deletions repo2docker/buildpacks/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def __init__(self, base_image):
)
self.platform = ""

@lru_cache()
@lru_cache
def get_packages(self):
"""
List of packages that are installed in this BuildPack.
Expand All @@ -246,7 +246,7 @@ def get_packages(self):
"""
return set()

@lru_cache()
@lru_cache
def get_base_packages(self):
"""
Base set of apt packages that are installed for all images.
Expand All @@ -265,7 +265,7 @@ def get_base_packages(self):
"gettext-base",
}

@lru_cache()
@lru_cache
def get_build_env(self):
"""
Ordered list of environment variables to be set for this image.
Expand All @@ -281,7 +281,7 @@ def get_build_env(self):
"""
return []

@lru_cache()
@lru_cache
def get_env(self):
"""
Ordered list of environment variables to be set for this image.
Expand All @@ -296,7 +296,7 @@ def get_env(self):
"""
return []

@lru_cache()
@lru_cache
def get_path(self):
"""
Ordered list of file system paths to look for executables in.
Expand All @@ -306,14 +306,14 @@ def get_path(self):
"""
return []

@lru_cache()
@lru_cache
def get_labels(self):
"""
Docker labels to set on the built image.
"""
return self.labels

@lru_cache()
@lru_cache
def get_build_script_files(self):
"""
Dict of files to be copied to the container image for use in building.
Expand All @@ -338,7 +338,7 @@ def _check_stencila(self):
f"Found a stencila manifest.xml at {root}. Stencila is no longer supported."
)

@lru_cache()
@lru_cache
def get_build_scripts(self):
"""
Ordered list of shell script snippets to build the base image.
Expand All @@ -360,7 +360,7 @@ def get_build_scripts(self):

return []

@lru_cache()
@lru_cache
def get_preassemble_script_files(self):
"""
Dict of files to be copied to the container image for use in preassembly.
Expand All @@ -374,7 +374,7 @@ def get_preassemble_script_files(self):
"""
return {}

@lru_cache()
@lru_cache
def get_preassemble_scripts(self):
"""
Ordered list of shell snippets to build an image for this repository.
Expand All @@ -391,7 +391,7 @@ def get_preassemble_scripts(self):
"""
return []

@lru_cache()
@lru_cache
def get_assemble_scripts(self):
"""
Ordered list of shell script snippets to build the repo into the image.
Expand All @@ -418,7 +418,7 @@ def get_assemble_scripts(self):
"""
return []

@lru_cache()
@lru_cache
def get_post_build_scripts(self):
"""
An ordered list of executable scripts to execute after build.
Expand All @@ -431,7 +431,7 @@ def get_post_build_scripts(self):
"""
return []

@lru_cache()
@lru_cache
def get_start_script(self):
"""
The path to a script to be executed at container start up.
Expand Down Expand Up @@ -672,22 +672,22 @@ def _filter_tar(tarinfo):


class BaseImage(BuildPack):
@lru_cache()
@lru_cache
def get_build_env(self):
"""Return env directives required for build"""
return [
("APP_BASE", "/srv"),
]

@lru_cache()
@lru_cache
def get_env(self):
"""Return env directives to be set after build"""
return []

def detect(self):
return True

@lru_cache()
@lru_cache
def get_preassemble_scripts(self):
scripts = []
try:
Expand Down Expand Up @@ -727,19 +727,19 @@ def get_preassemble_scripts(self):

return scripts

@lru_cache()
@lru_cache
def get_assemble_scripts(self):
"""Return directives to run after the entire repository has been added to the image"""
return []

@lru_cache()
@lru_cache
def get_post_build_scripts(self):
post_build = self.binder_path("postBuild")
if os.path.exists(post_build):
return [post_build]
return []

@lru_cache()
@lru_cache
def get_start_script(self):
start = self.binder_path("start")
if os.path.exists(start):
Expand Down
18 changes: 9 additions & 9 deletions repo2docker/buildpacks/conda/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def _conda_platform(self):
return "linux-aarch64"
raise ValueError(f"Unknown platform {self.platform}")

@lru_cache()
@lru_cache
def get_build_env(self):
"""Return environment variables to be set.

Expand Down Expand Up @@ -90,13 +90,13 @@ def get_build_env(self):
env.append(("KERNEL_PYTHON_PREFIX", "${NB_PYTHON_PREFIX}"))
return env

@lru_cache()
@lru_cache
def get_env(self):
"""Make kernel env the default for `conda install`"""
env = super().get_env() + [("CONDA_DEFAULT_ENV", "${KERNEL_PYTHON_PREFIX}")]
return env

@lru_cache()
@lru_cache
def get_path(self):
"""Return paths (including conda environment path) to be added to
the PATH environment variable.
Expand All @@ -111,7 +111,7 @@ def get_path(self):
path.append("${NPM_DIR}/bin")
return path

@lru_cache()
@lru_cache
def get_build_scripts(self):
"""
Return series of build-steps common to all Python 3 repositories.
Expand Down Expand Up @@ -149,7 +149,7 @@ def get_build_scripts(self):

major_pythons = {"2": "2.7", "3": "3.10"}

@lru_cache()
@lru_cache
def get_build_script_files(self):
"""
Dict of files to be copied to the container image for use in building.
Expand Down Expand Up @@ -374,7 +374,7 @@ def separate_kernel_env(self):
self.kernel_env_cutoff_version
)

@lru_cache()
@lru_cache
def get_preassemble_script_files(self):
"""preassembly only requires environment.yml

Expand All @@ -388,7 +388,7 @@ def get_preassemble_script_files(self):
assemble_files[environment_yml] = environment_yml
return assemble_files

@lru_cache()
@lru_cache
def get_env_scripts(self):
"""Return series of build-steps specific to this source repository."""
scripts = []
Expand Down Expand Up @@ -455,14 +455,14 @@ def get_env_scripts(self):
]
return scripts

@lru_cache()
@lru_cache
def get_preassemble_scripts(self):
scripts = super().get_preassemble_scripts()
if self._should_preassemble_env:
scripts.extend(self.get_env_scripts())
return scripts

@lru_cache()
@lru_cache
def get_assemble_scripts(self):
scripts = super().get_assemble_scripts()
if not self._should_preassemble_env:
Expand Down
10 changes: 5 additions & 5 deletions repo2docker/buildpacks/julia/julia_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def julia_version(self):
raise RuntimeError("Failed to find a matching Julia version: {compat}")
return match

@lru_cache()
@lru_cache
def get_build_env(self):
"""Get additional environment settings for Julia and Jupyter

Expand Down Expand Up @@ -112,11 +112,11 @@ def project_dir(self):
else:
return "${REPO_DIR}"

@lru_cache()
@lru_cache
def get_env(self):
return super().get_env() + [("JULIA_PROJECT", self.project_dir)]

@lru_cache()
@lru_cache
def get_path(self):
"""Adds path to Julia binaries to user's PATH.

Expand All @@ -127,7 +127,7 @@ def get_path(self):
"""
return super().get_path() + ["${JULIA_PATH}/bin"]

@lru_cache()
@lru_cache
def get_build_scripts(self):
"""
Return series of build-steps common to "ALL" Julia repositories
Expand Down Expand Up @@ -156,7 +156,7 @@ def get_build_scripts(self):
),
]

@lru_cache()
@lru_cache
def get_assemble_scripts(self):
"""
Return series of build-steps specific to "this" Julia repository
Expand Down
Loading