Skip to content

Commit 7de4c89

Browse files
committed
Upgrade Tron to Python 3.10
1 parent 0192aa1 commit 7de4c89

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+327
-435
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
toxenv:
18-
- py38,docs
18+
- py310,docs
1919
steps:
2020
- uses: actions/checkout@v2
2121
- uses: actions/setup-python@v2
2222
with:
23-
python-version: 3.8
23+
python-version: 3.10
2424
# GHA won't setup tox for us
2525
- run: pip install tox==3.2
2626
# there are no pre-built wheels for bsddb3, so we need to install
@@ -44,7 +44,7 @@ jobs:
4444
- uses: actions/checkout@v2
4545
- uses: actions/setup-python@v2
4646
with:
47-
python-version: 3.8
47+
python-version: 3.10
4848
# Update package lists to ensure we have the latest information
4949
- run: sudo apt-get update
5050
# the container provided by GitHub doesn't include utilities

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
default_language_version:
3-
python: python3.8
3+
python: python3.10
44
repos:
55
- repo: https://github.com/pre-commit/pre-commit-hooks
66
rev: v2.5.0
@@ -27,10 +27,10 @@ repos:
2727
- id: reorder-python-imports
2828
args: [--py3-plus]
2929
- repo: https://github.com/asottile/pyupgrade
30-
rev: v3.3.1
30+
rev: v3.20.0
3131
hooks:
3232
- id: pyupgrade
33-
args: [--py38-plus]
33+
args: [--py39-plus]
3434
- repo: local
3535
hooks:
3636
- id: patch-enforce-autospec
@@ -44,4 +44,4 @@ repos:
4444
rev: 22.3.0
4545
hooks:
4646
- id: black
47-
args: [--target-version, py38]
47+
args: [--target-version, py310]

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ version: 2
88
build:
99
os: ubuntu-22.04
1010
tools:
11-
python: "3.8"
11+
python: "3.10"
1212
# You can also specify other tool versions:
1313
# nodejs: "20"
1414
# rust: "1.70"

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ coffee_%: docker_%
6060
'
6161

6262
test:
63-
tox -e py38
63+
tox -e py310
6464

6565
test_in_docker_%: docker_%
66-
$(DOCKER_RUN) tron-builder-$* python3.8 -m tox -vv -e py38
66+
$(DOCKER_RUN) tron-builder-$* python3.10 -m tox -vv -e py310
6767

6868
tox_%:
6969
tox -e $*
@@ -78,13 +78,13 @@ itest_%: debitest_%
7878
@echo "itest $* OK"
7979

8080
dev:
81-
SSH_AUTH_SOCK=$(SSH_AUTH_SOCK) .tox/py38/bin/trond --debug --working-dir=dev -l logging.conf --host=0.0.0.0
81+
SSH_AUTH_SOCK=$(SSH_AUTH_SOCK) .tox/py310/bin/trond --debug --working-dir=dev -l logging.conf --host=0.0.0.0
8282

8383
example_cluster:
8484
tox -e example-cluster
8585

8686
yelpy:
87-
.tox/py38/bin/pip install -r yelp_package/extra_requirements_yelp.txt
87+
.tox/py310/bin/pip install -r yelp_package/extra_requirements_yelp.txt
8888

8989

9090
# 1. Bump version at the top of this file

bin/tronctl

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ import logging
1111
import pprint
1212
import sys
1313
from collections import defaultdict
14+
from collections.abc import Callable
15+
from collections.abc import Generator
1416
from typing import Any
15-
from typing import Callable
16-
from typing import Dict
17-
from typing import Generator
18-
from typing import Optional
19-
from typing import Tuple
2017
from urllib.parse import urljoin
2118

2219
import argcomplete # type: ignore
@@ -238,7 +235,7 @@ def parse_cli():
238235
return args
239236

240237

241-
def request(url: str, data: Dict[str, Any], headers=None, method=None) -> bool:
238+
def request(url: str, data: dict[str, Any], headers=None, method=None) -> bool:
242239
# We want every tronctl request to be attributable
243240
response = client.request(url, data=data, headers=headers, method=method, user_attribution=True)
244241
if response.error:
@@ -264,7 +261,7 @@ def event_discard(args):
264261
)
265262

266263

267-
def _get_triggers_for_action(server: str, action_identifier: str) -> Optional[Tuple[str, ...]]:
264+
def _get_triggers_for_action(server: str, action_identifier: str) -> tuple[str, ...] | None:
268265
try:
269266
namespace, job_name, run_number, action_name = action_identifier.split(".")
270267
except ValueError:
@@ -452,7 +449,7 @@ def tron_version(args):
452449
yield True
453450

454451

455-
COMMANDS: Dict[str, Callable[[argparse.Namespace], Generator[bool, None, None]]] = defaultdict(
452+
COMMANDS: dict[str, Callable[[argparse.Namespace], Generator[bool, None, None]]] = defaultdict(
456453
lambda: control_objects,
457454
publish=event_publish,
458455
discard=event_discard,

contrib/mock_patch_checker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python3.8
1+
#!/usr/bin/env python3.10
22
import ast
33
import sys
44

contrib/patch-config-loggers.diff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
--- a/debian/tron/opt/venvs/tron/lib/python3.8/site-packages/kubernetes/client/configuration.py
2-
+++ b/debian/tron/opt/venvs/tron/lib/python3.8/site-packages/kubernetes/client/configuration.py
1+
--- a/debian/tron/opt/venvs/tron/lib/python3.10/site-packages/kubernetes/client/configuration.py
2+
+++ b/debian/tron/opt/venvs/tron/lib/python3.10/site-packages/kubernetes/client/configuration.py
33
@@ -71,11 +71,11 @@
44
"""
55

debian/control

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ Source: tron
22
Section: admin
33
Priority: optional
44
Maintainer: Daniel Nephin <[email protected]>
5-
Build-Depends: debhelper (>= 7), python3.8-dev, libdb5.3-dev, libyaml-dev, libssl-dev, libffi-dev, dh-virtualenv
5+
Build-Depends: debhelper (>= 7), python3.10-dev, libdb5.3-dev, libyaml-dev, libssl-dev, libffi-dev, dh-virtualenv
66
Standards-Version: 3.8.3
77

88
Package: tron
99
Architecture: all
1010
Homepage: http://github.com/yelp/Tron
11-
Depends: bsdutils, python3.8, libdb5.3, libyaml-0-2, ${shlibs:Depends}, ${misc:Depends}
11+
Depends: bsdutils, python3.10, libdb5.3, libyaml-0-2, ${shlibs:Depends}, ${misc:Depends}
1212
Description: Tron is a job scheduling, running and monitoring package.
1313
Designed to replace Cron for complex scheduling and dependencies.
1414
Provides:

debian/rules

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ override_dh_virtualenv:
2222
dh_virtualenv --index-url $(PIP_INDEX_URL) \
2323
--extra-pip-arg --trusted-host=169.254.255.254 \
2424
--extra-pip-arg --only-binary=cryptography \
25-
--python=/usr/bin/python3.8 \
25+
--python=/usr/bin/python3.10 \
2626
--preinstall cython==0.29.36 \
2727
--preinstall pip==24.3.1 \
2828
--preinstall setuptools==65.5.1
2929
@echo patching k8s client lib for configuration class
30-
patch debian/tron/opt/venvs/tron/lib/python3.8/site-packages/kubernetes/client/configuration.py contrib/patch-config-loggers.diff
30+
patch debian/tron/opt/venvs/tron/lib/python3.10/site-packages/kubernetes/client/configuration.py contrib/patch-config-loggers.diff
3131
override_dh_installinit:
3232
dh_installinit --noscripts

dev/config/MASTER.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ nodes:
1717
# action_runner:
1818
# runner_type: "subprocess"
1919
# remote_status_path: "pg/tron/status"
20-
# remote_exec_path: "pg/tron/.tox/py38/bin"
20+
# remote_exec_path: "pg/tron/.tox/py310/bin"
2121

2222
jobs:
2323
testjob0:

0 commit comments

Comments
 (0)