Skip to content

Commit 8ff109f

Browse files
authored
Merge pull request #1411 from manics/min-python
Require Python 3.9 to run repo2docker
2 parents f50c0c5 + 89e78b7 commit 8ff109f

File tree

14 files changed

+75
-80
lines changed

14 files changed

+75
-80
lines changed

.github/workflows/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ on:
2929

3030
jobs:
3131
docker:
32-
runs-on: ubuntu-22.04
32+
runs-on: ubuntu-24.04
3333
steps:
3434
- name: Checkout code
3535
uses: actions/checkout@v4

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ on:
2929

3030
jobs:
3131
build-n-publish:
32-
runs-on: ubuntu-22.04
32+
runs-on: ubuntu-24.04
3333
steps:
3434
- uses: actions/checkout@v4
3535
- uses: actions/setup-python@v5
3636
with:
37-
python-version: "3.9"
37+
python-version: "3.13"
3838

3939
- name: install build requirements
4040
run: |
@@ -62,7 +62,7 @@ jobs:
6262
password: ${{ secrets.PYPI_PASSWORD }}
6363

6464
publish-docker:
65-
runs-on: ubuntu-22.04
65+
runs-on: ubuntu-24.04
6666
env:
6767
DEFAULT_REGISTRY: quay.io
6868
IMAGE_NAME: jupyterhub/repo2docker

.github/workflows/test.yml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ jobs:
5050
strategy:
5151
fail-fast: false
5252
matrix:
53-
ubuntu_version: ["22.04"]
54-
python_version: ["3.9"]
53+
ubuntu_version: ["24.04"]
54+
python_version: ["3.13"]
5555
repo_type:
5656
- base
5757
- conda
@@ -64,17 +64,13 @@ jobs:
6464
- unit
6565
- venv
6666
- contentproviders
67+
# Playwright test
68+
- ui
6769
include:
68-
# The actions/setup-python action with Python version 3.6 isn't
69-
# possible to use with the ubuntu-22.04 runner, so we use ubuntu-20.04
70-
# for this test where Python 3.6 remain available.
71-
- ubuntu_version: "20.04"
72-
python_version: "3.6"
70+
# The earliest actions/setup-python versions depend on the runner.
71+
- ubuntu_version: "22.04"
72+
python_version: "3.9"
7373
repo_type: venv
74-
# Playwright test
75-
- ubuntu_version: "24.04"
76-
python_version: "3.13"
77-
repo_type: ui
7874

7975
steps:
8076
- uses: actions/checkout@v4

.pre-commit-config.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ repos:
1515
hooks:
1616
- id: pyupgrade
1717
args:
18-
- --py36-plus
18+
- --py38-plus
1919
# check-tmp is a Python based test script run in created environments
20-
# that can be at least Python 3.5 even though we require Python 3.6 for
21-
# repo2docker itself.
20+
# that can be Python 3.5, older than the Python version required to run
21+
# repo2docker.
2222
exclude: check-tmp
2323

2424
# Autoformat: Python code
@@ -27,12 +27,11 @@ repos:
2727
hooks:
2828
- id: black
2929
args:
30-
- --target-version=py36
31-
- --target-version=py37
32-
- --target-version=py38
3330
- --target-version=py39
3431
- --target-version=py310
3532
- --target-version=py311
33+
- --target-version=py312
34+
- --target-version=py313
3635

3736
# Autoformat: Python code
3837
- repo: https://github.com/pycqa/isort

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ For more information, please visit
3636

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

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

repo2docker/buildpacks/base.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ def __init__(self, base_image):
236236
)
237237
self.platform = ""
238238

239-
@lru_cache()
239+
@lru_cache
240240
def get_packages(self):
241241
"""
242242
List of packages that are installed in this BuildPack.
@@ -246,7 +246,7 @@ def get_packages(self):
246246
"""
247247
return set()
248248

249-
@lru_cache()
249+
@lru_cache
250250
def get_base_packages(self):
251251
"""
252252
Base set of apt packages that are installed for all images.
@@ -265,7 +265,7 @@ def get_base_packages(self):
265265
"gettext-base",
266266
}
267267

268-
@lru_cache()
268+
@lru_cache
269269
def get_build_env(self):
270270
"""
271271
Ordered list of environment variables to be set for this image.
@@ -281,7 +281,7 @@ def get_build_env(self):
281281
"""
282282
return []
283283

284-
@lru_cache()
284+
@lru_cache
285285
def get_env(self):
286286
"""
287287
Ordered list of environment variables to be set for this image.
@@ -296,7 +296,7 @@ def get_env(self):
296296
"""
297297
return []
298298

299-
@lru_cache()
299+
@lru_cache
300300
def get_path(self):
301301
"""
302302
Ordered list of file system paths to look for executables in.
@@ -306,14 +306,14 @@ def get_path(self):
306306
"""
307307
return []
308308

309-
@lru_cache()
309+
@lru_cache
310310
def get_labels(self):
311311
"""
312312
Docker labels to set on the built image.
313313
"""
314314
return self.labels
315315

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

341-
@lru_cache()
341+
@lru_cache
342342
def get_build_scripts(self):
343343
"""
344344
Ordered list of shell script snippets to build the base image.
@@ -360,7 +360,7 @@ def get_build_scripts(self):
360360

361361
return []
362362

363-
@lru_cache()
363+
@lru_cache
364364
def get_preassemble_script_files(self):
365365
"""
366366
Dict of files to be copied to the container image for use in preassembly.
@@ -374,7 +374,7 @@ def get_preassemble_script_files(self):
374374
"""
375375
return {}
376376

377-
@lru_cache()
377+
@lru_cache
378378
def get_preassemble_scripts(self):
379379
"""
380380
Ordered list of shell snippets to build an image for this repository.
@@ -391,7 +391,7 @@ def get_preassemble_scripts(self):
391391
"""
392392
return []
393393

394-
@lru_cache()
394+
@lru_cache
395395
def get_assemble_scripts(self):
396396
"""
397397
Ordered list of shell script snippets to build the repo into the image.
@@ -418,7 +418,7 @@ def get_assemble_scripts(self):
418418
"""
419419
return []
420420

421-
@lru_cache()
421+
@lru_cache
422422
def get_post_build_scripts(self):
423423
"""
424424
An ordered list of executable scripts to execute after build.
@@ -431,7 +431,7 @@ def get_post_build_scripts(self):
431431
"""
432432
return []
433433

434-
@lru_cache()
434+
@lru_cache
435435
def get_start_script(self):
436436
"""
437437
The path to a script to be executed at container start up.
@@ -672,22 +672,22 @@ def _filter_tar(tarinfo):
672672

673673

674674
class BaseImage(BuildPack):
675-
@lru_cache()
675+
@lru_cache
676676
def get_build_env(self):
677677
"""Return env directives required for build"""
678678
return [
679679
("APP_BASE", "/srv"),
680680
]
681681

682-
@lru_cache()
682+
@lru_cache
683683
def get_env(self):
684684
"""Return env directives to be set after build"""
685685
return []
686686

687687
def detect(self):
688688
return True
689689

690-
@lru_cache()
690+
@lru_cache
691691
def get_preassemble_scripts(self):
692692
scripts = []
693693
try:
@@ -727,19 +727,19 @@ def get_preassemble_scripts(self):
727727

728728
return scripts
729729

730-
@lru_cache()
730+
@lru_cache
731731
def get_assemble_scripts(self):
732732
"""Return directives to run after the entire repository has been added to the image"""
733733
return []
734734

735-
@lru_cache()
735+
@lru_cache
736736
def get_post_build_scripts(self):
737737
post_build = self.binder_path("postBuild")
738738
if os.path.exists(post_build):
739739
return [post_build]
740740
return []
741741

742-
@lru_cache()
742+
@lru_cache
743743
def get_start_script(self):
744744
start = self.binder_path("start")
745745
if os.path.exists(start):

repo2docker/buildpacks/conda/__init__.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def _conda_platform(self):
4646
return "linux-aarch64"
4747
raise ValueError(f"Unknown platform {self.platform}")
4848

49-
@lru_cache()
49+
@lru_cache
5050
def get_build_env(self):
5151
"""Return environment variables to be set.
5252
@@ -90,13 +90,13 @@ def get_build_env(self):
9090
env.append(("KERNEL_PYTHON_PREFIX", "${NB_PYTHON_PREFIX}"))
9191
return env
9292

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

99-
@lru_cache()
99+
@lru_cache
100100
def get_path(self):
101101
"""Return paths (including conda environment path) to be added to
102102
the PATH environment variable.
@@ -111,7 +111,7 @@ def get_path(self):
111111
path.append("${NPM_DIR}/bin")
112112
return path
113113

114-
@lru_cache()
114+
@lru_cache
115115
def get_build_scripts(self):
116116
"""
117117
Return series of build-steps common to all Python 3 repositories.
@@ -149,7 +149,7 @@ def get_build_scripts(self):
149149

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

152-
@lru_cache()
152+
@lru_cache
153153
def get_build_script_files(self):
154154
"""
155155
Dict of files to be copied to the container image for use in building.
@@ -374,7 +374,7 @@ def separate_kernel_env(self):
374374
self.kernel_env_cutoff_version
375375
)
376376

377-
@lru_cache()
377+
@lru_cache
378378
def get_preassemble_script_files(self):
379379
"""preassembly only requires environment.yml
380380
@@ -388,7 +388,7 @@ def get_preassemble_script_files(self):
388388
assemble_files[environment_yml] = environment_yml
389389
return assemble_files
390390

391-
@lru_cache()
391+
@lru_cache
392392
def get_env_scripts(self):
393393
"""Return series of build-steps specific to this source repository."""
394394
scripts = []
@@ -455,14 +455,14 @@ def get_env_scripts(self):
455455
]
456456
return scripts
457457

458-
@lru_cache()
458+
@lru_cache
459459
def get_preassemble_scripts(self):
460460
scripts = super().get_preassemble_scripts()
461461
if self._should_preassemble_env:
462462
scripts.extend(self.get_env_scripts())
463463
return scripts
464464

465-
@lru_cache()
465+
@lru_cache
466466
def get_assemble_scripts(self):
467467
scripts = super().get_assemble_scripts()
468468
if not self._should_preassemble_env:

repo2docker/buildpacks/julia/julia_project.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def julia_version(self):
6969
raise RuntimeError("Failed to find a matching Julia version: {compat}")
7070
return match
7171

72-
@lru_cache()
72+
@lru_cache
7373
def get_build_env(self):
7474
"""Get additional environment settings for Julia and Jupyter
7575
@@ -112,11 +112,11 @@ def project_dir(self):
112112
else:
113113
return "${REPO_DIR}"
114114

115-
@lru_cache()
115+
@lru_cache
116116
def get_env(self):
117117
return super().get_env() + [("JULIA_PROJECT", self.project_dir)]
118118

119-
@lru_cache()
119+
@lru_cache
120120
def get_path(self):
121121
"""Adds path to Julia binaries to user's PATH.
122122
@@ -127,7 +127,7 @@ def get_path(self):
127127
"""
128128
return super().get_path() + ["${JULIA_PATH}/bin"]
129129

130-
@lru_cache()
130+
@lru_cache
131131
def get_build_scripts(self):
132132
"""
133133
Return series of build-steps common to "ALL" Julia repositories
@@ -156,7 +156,7 @@ def get_build_scripts(self):
156156
),
157157
]
158158

159-
@lru_cache()
159+
@lru_cache
160160
def get_assemble_scripts(self):
161161
"""
162162
Return series of build-steps specific to "this" Julia repository

0 commit comments

Comments
 (0)