Skip to content

Commit

Permalink
feat: Support Python 3.12
Browse files Browse the repository at this point in the history
* Replace the use of pkg_resources (from setuptools, which is
  no longer included in virtual environments as of 3.12) with
  importlib.metadata.

* Add Python 3.12 to the test matrix.
  • Loading branch information
Maari Tamm committed Mar 15, 2024
1 parent e128b6d commit 1fb5ff5
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
- 3.9
- "3.10"
- 3.11
- 3.12

steps:
- name: Check out code
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Unreleased
-----------------------------

* Support Python 3.12.

Version 1.2.0 (2024-01-12)
-----------------------------

Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[tox]
envlist = gitlint,py{38,39},flake8
envlist = gitlint,py{38,39,310,311,312},flake8

[gh-actions]
python =
3.8: gitlint,py38,flake8
3.9: gitlint,py39,flake8
3.10: gitlint,py310,flake8
3.11: gitlint,py311,flake8
3.12: gitlint,py312,flake8

[flake8]
ignore = E124,W504
Expand Down
5 changes: 2 additions & 3 deletions tutorregistry/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@
https://packaging.python.org/guides/single-sourcing-package-version/
"""

import pkg_resources
__version__ = pkg_resources.get_distribution(
'tutor-contrib-registry').version
from importlib import metadata
__version__ = metadata.version('tutor-contrib-registry')
16 changes: 8 additions & 8 deletions tutorregistry/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ def registry(context) -> None:

utils.kubectl(
"delete", "secret", key_name,
f"--namespace={ namespace }",
f"--namespace={namespace}",
"--wait=true",
"--ignore-not-found=true")

utils.kubectl(
"create", "secret", "docker-registry", f"{ key_name }",
f"--namespace={ namespace }",
f"--docker-server={ registry }",
f"--docker-username={ username }",
f"--docker-password={ password }",
f"--docker-email={ email }")
"create", "secret", "docker-registry", f"{key_name}",
f"--namespace={namespace}",
f"--docker-server={registry}",
f"--docker-username={username}",
f"--docker-password={password}",
f"--docker-email={email}")

all_keys["imagePullSecrets"].append({"name": key_name})

Expand All @@ -77,4 +77,4 @@ def registry(context) -> None:
utils.kubectl(
"patch", "serviceaccount", "default",
"-p", json.dumps(all_keys),
f"--namespace={ namespace }")
f"--namespace={namespace}")

0 comments on commit 1fb5ff5

Please sign in to comment.