Skip to content

Upgrade paasta to python 3.10 #4065

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

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 6 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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
toxenv:
- py38-linux
- py310-linux
- docs
- mypy
- tests
Expand All @@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.10'
- run: python -m pip install --upgrade pip
- run: pip install -r requirements-gha.txt
- run: tox -e ${{ matrix.toxenv }}
Expand All @@ -40,7 +40,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.10'
- run: python -m pip install --upgrade pip virtualenv
- run: curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
- run: python -m pip install --upgrade pip
Expand All @@ -56,7 +56,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.10'
- run: sudo apt-get update
- run: sudo apt-get install -yq devscripts
- run: make itest_${{ matrix.dist }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
fail-fast: false
matrix:
toxenv:
- py38-linux,docs,mypy,tests
- py310-linux,docs,mypy,tests
- general_itests
env:
DOCKER_REGISTRY: ""
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.10'
- run: python -m pip install --upgrade pip
- run: pip install -r requirements-gha.txt
- run: tox -e ${{ matrix.toxenv }}
Expand All @@ -35,7 +35,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.8
python-version: '3.10'
- run: pip install build
# this will create both a source distribution and a wheel
- run: python -m build
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
default_language_version:
python: python3.8
python: python3.10
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0
Expand Down Expand Up @@ -42,7 +42,7 @@ repos:
rev: 22.3.0
hooks:
- id: black
args: ['--target-version', 'py38']
args: ['--target-version', 'py310']
exclude: ^paasta_tools/paastaapi
- repo: https://github.com/PyCQA/flake8
rev: 3.7.7
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.8"
python: "3.10"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ dev-api: .tox/py38-linux
.paasta/bin/tox -e dev-api

.paasta/bin/activate: requirements.txt requirements-dev.txt
test -d .paasta/bin/activate || virtualenv -p python3.8 .paasta
test -d .paasta/bin/activate || virtualenv -p python3.10 .paasta
.paasta/bin/pip install -r requirements-bootstrap.txt
.paasta/bin/pip install -U tox==3.28.0
touch .paasta/bin/activate
Expand Down
4 changes: 2 additions & 2 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ Source: paasta-tools
Section: python
Priority: optional
Maintainer: Compute Infrastructure <[email protected]>
Build-Depends: debhelper (>= 7), python3.8, dh-virtualenv
Build-Depends: debhelper (>= 7), python3.10, dh-virtualenv
Standards-Version: 3.8.3

Package: paasta-tools
Architecture: any
Depends: python3.8, ${shlibs:Depends}, ${misc:Depends}
Depends: python3.10, ${shlibs:Depends}, ${misc:Depends}
Description: CLI tools for PaaSTA
Conflicts: service-deployment-tools
4 changes: 2 additions & 2 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ DH_VIRTUALENV_INSTALL_ROOT=/opt/venvs
DH_VENV_DIR=debian/$(PACKAGE)$(DH_VIRTUALENV_INSTALL_ROOT)/$(PACKAGE)
override_dh_virtualenv:
dh_virtualenv \
--python=/usr/bin/python3.8 \
--python=/usr/bin/python3.10 \
--preinstall no-manylinux1 \
--preinstall=-rrequirements-bootstrap.txt
cp yelp_package/gopath/paasta_go $(DH_VENV_DIR)/bin/paasta_go
@echo patching k8s client lib
patch $(DH_VENV_DIR)/lib/python3.8/site-packages/kubernetes/client/api_client.py contrib/python-k8s-client.diff
patch $(DH_VENV_DIR)/lib/python3.10/site-packages/kubernetes/client/api_client.py contrib/python-k8s-client.diff

override_dh_shlibdeps:
# pylibmc manylinux bundle libraries fail unless this is passed.
Expand Down
2 changes: 1 addition & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[mypy]
python_version = 3.8
python_version = 3.10
check_untyped_defs = False
warn_incomplete_stub = True
follow_imports = silent
Expand Down
2 changes: 1 addition & 1 deletion paasta_tools/contrib/bounce_log_latency_parser.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3.8
#!/usr/bin/env python3.10
import itertools
import json
import sys
Expand Down
28 changes: 14 additions & 14 deletions paasta_tools/contrib/ide_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ def install_vscode_support() -> None:
"python": "${workspaceFolder}/.paasta/bin/python",
"program": "${workspaceFolder}/.paasta/bin/tox",
"subProcess": True,
"args": ["-e", "py38-linux,docs,mypy,tests"],
"args": ["-e", "py310-linux,docs,mypy,tests"],
},
{
"name": "paasta cli",
"cwd": "${workspaceFolder}",
"python": "${workspaceFolder}/.tox/py38-linux/bin/python",
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
"type": "python",
"request": "launch",
"module": "paasta_tools.cli.cli",
},
{
"name": "paasta rollback",
"cwd": "${workspaceFolder}",
"python": "${workspaceFolder}/.tox/py38-linux/bin/python",
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
"type": "python",
"request": "launch",
"module": "paasta_tools.cli.cli",
Expand All @@ -83,7 +83,7 @@ def install_vscode_support() -> None:
{
"name": "paasta mark-for-deployment",
"cwd": "${workspaceFolder}",
"python": "${workspaceFolder}/.tox/py38-linux/bin/python",
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
"type": "python",
"request": "launch",
"module": "paasta_tools.cli.cli",
Expand All @@ -101,7 +101,7 @@ def install_vscode_support() -> None:
{
"name": "paasta status",
"cwd": "${workspaceFolder}",
"python": "${workspaceFolder}/.tox/py38-linux/bin/python",
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
"type": "python",
"request": "launch",
"module": "paasta_tools.cli.cli",
Expand All @@ -118,7 +118,7 @@ def install_vscode_support() -> None:
{
"name": "paasta playground",
"cwd": "${workspaceFolder}",
"python": "${workspaceFolder}/.tox/py38-linux/bin/python",
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
"type": "python",
"request": "launch",
"module": "paasta_tools.cli.cli",
Expand All @@ -138,7 +138,7 @@ def install_vscode_support() -> None:
{
"name": "paasta status playground",
"cwd": "${workspaceFolder}",
"python": "${workspaceFolder}/.tox/py38-linux/bin/python",
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
"type": "python",
"request": "launch",
"module": "paasta_tools.cli.cli",
Expand All @@ -157,7 +157,7 @@ def install_vscode_support() -> None:
{
"name": "paasta logs",
"cwd": "${workspaceFolder}",
"python": "${workspaceFolder}/.tox/py38-linux/bin/python",
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
"type": "python",
"request": "launch",
"module": "paasta_tools.cli.cli",
Expand All @@ -175,7 +175,7 @@ def install_vscode_support() -> None:
"name": "paasta validate",
# This command has to be ran from inside the service repo in yelpsoa-configs
"cwd": "${userHome}/pg/yelpsoa-configs/",
"python": "${workspaceFolder}/.tox/py38-linux/bin/python",
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
"type": "python",
"request": "launch",
"module": "paasta_tools.cli.cli",
Expand All @@ -184,10 +184,10 @@ def install_vscode_support() -> None:
{
# 1) Follow step 1 in "Running the PaaSTA HTTP API Locally" wiki
# 2) Run this "paasta API" test to debug paasta API
# 3) Run client command, e.g. PAASTA_SYSTEM_CONFIG_DIR=./etc_paasta_for_development/ .tox/py38-linux/bin/python paasta_tools/cli/cli.py status --clusters norcal-devc --service katamari_test_service
# 3) Run client command, e.g. PAASTA_SYSTEM_CONFIG_DIR=./etc_paasta_for_development/ .tox/py310-linux/bin/python paasta_tools/cli/cli.py status --clusters norcal-devc --service katamari_test_service
"name": "paasta API",
"cwd": "${workspaceFolder}",
"python": "${workspaceFolder}/.tox/py38-linux/bin/python",
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
"type": "python",
"request": "launch",
"module": "paasta_tools.run-paasta-api-in-dev-mode",
Expand All @@ -203,7 +203,7 @@ def install_vscode_support() -> None:
{
"name": "paasta API playground",
"cwd": "${workspaceFolder}",
"python": "${workspaceFolder}/.tox/py38-linux/bin/python",
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
"type": "python",
"request": "launch",
"module": "paasta_tools.run-paasta-api-playground",
Expand All @@ -221,7 +221,7 @@ def install_vscode_support() -> None:
{
"name": "Run setup k8s job in playground",
"cwd": "${workspaceFolder}",
"python": "${workspaceFolder}/.tox/py38-linux/bin/python",
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
"type": "python",
"request": "launch",
"module": "paasta_tools.setup_kubernetes_job",
Expand All @@ -244,7 +244,7 @@ def install_vscode_support() -> None:
{
"name": "Generate deployments.json in playground",
"cwd": "${workspaceFolder}",
"python": "${workspaceFolder}/.tox/py38-linux/bin/python",
"python": "${workspaceFolder}/.tox/py310-linux/bin/python",
"type": "python",
"request": "launch",
"module": "paasta_tools.generate_deployments_for_service",
Expand Down
2 changes: 1 addition & 1 deletion paasta_tools/contrib/mock_patch_checker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3.8
#!/usr/bin/env python3.10
import ast
import sys

Expand Down
2 changes: 1 addition & 1 deletion paasta_tools/contrib/render_template.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3.8
#!/usr/bin/env python3.10
import argparse
import os
import re
Expand Down
2 changes: 1 addition & 1 deletion paasta_tools/contrib/shared_ip_check.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3.8
#!/usr/bin/env python3.10
import sys
from collections import defaultdict

Expand Down
4 changes: 2 additions & 2 deletions paasta_tools/run-paasta-api-in-dev-mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def main():
api.main("dev-mode")
else:
os.execl(
".tox/py38-linux/bin/python",
".tox/py38-linux/bin/python",
".tox/py310-linux/bin/python",
".tox/py310-linux/bin/python",
"-m",
"paasta_tools.api.api",
*["-D", "-c", cluster, str(port)],
Expand Down
4 changes: 2 additions & 2 deletions paasta_tools/run-paasta-api-playground.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def main():
api.main("dev-mode")
else:
os.execl(
".tox/py38-linux/bin/python",
".tox/py38-linux/bin/python",
".tox/py310-linux/bin/python",
".tox/py310-linux/bin/python",
"-m",
"paasta_tools.api.api",
*["-D", "-c", cluster, str(port)],
Expand Down
2 changes: 1 addition & 1 deletion paasta_tools/yaml_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import yaml

# try and catch both /opt/venvs/paasta-tools and ~/pg/paasta/.tox/py38-linux as if we're being run as an application,
# try and catch both /opt/venvs/paasta-tools and ~/pg/paasta/.tox/py310-linux as if we're being run as an application,
# we likely want to fail on a potential slowdown rather than experience a performance regression
if "paasta" in sys.prefix:
from yaml import CSafeLoader as Loader
Expand Down
2 changes: 1 addition & 1 deletion requirements-bootstrap.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pip==24.0
setuptools==68.0.0
setuptools==69.0.3
wheel==0.42.0
1 change: 1 addition & 0 deletions requirements-dev-minimal.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
appdirs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a note: the -minimal files should only contain libraries that we directly import - and it looks like this is most likely a transitive dependency

astroid
asynctest
coverage
Expand Down
12 changes: 7 additions & 5 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ Babel==2.9.1
cfgv==2.0.1
coverage==6.5.0
debugpy==1.8.0
distlib==0.3.4
distlib==0.3.9
docutils==0.12
exceptiongroup==1.1.2
filelock==3.0.12
filelock==3.13.1
flake8==3.5.0
freezegun==0.3.7
hypothesis==6.79.4
Expand All @@ -25,10 +25,12 @@ packaging==20.9
path.py==8.1
pbr==3.1.1
pep8==1.5.7

platformdirs==4.3.8
pluggy==1.2.0
pre-commit==2.17.0
pre-commit==3.7.0
pycodestyle==2.3.1
pyfakefs==4.1.0
pyfakefs==5.3.5
pyflakes==1.6.0
Pygments==2.7.4
pylint==2.6.0
Expand All @@ -48,6 +50,6 @@ sphinxcontrib-qthelp==1.0.2
sphinxcontrib-serializinghtml==1.1.3
toml==0.9.4
tomli==2.0.1
virtualenv==20.4.3
virtualenv==20.24.7
wrapt==1.12.1
zake==0.2.2
12 changes: 8 additions & 4 deletions requirements-minimal.txt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: i'm not quite sure why we ever bother with lower-bound pins in this file: we really should only ever have upper-bounds/explicit pins with comments - I don't think we ever really knowingly want to downgrade things and there's almost no way that we'll be disciplined enough to have truly accurate lower-bounds :P

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: a bunch of these additions shouldn't be here - requirements-minimal is only for libraries we directly import

Original file line number Diff line number Diff line change
Expand Up @@ -37,35 +37,39 @@ nats-py
nulltype
objgraph
ply
progressbar2 >= 3.10.0
progressbar2>=4.3.2
prometheus-client
pymesos >= 0.2.0
pyramid >= 1.8
pyramid-swagger >= 2.3.0
pyramid>=2.0.2
pyrsistent>=0.18.1
pysensu-yelp >= 0.3.4
PyStaticConfiguration
python-crontab>=2.1.1
python-dateutil >= 2.4.0
python-iptables
pytimeparse >= 1.1.0
pytz >= 2014.10
repoze.lru>=0.7
# the upper-bound is required for older docker-py (<=7.0.0)
# to function: https://github.com/psf/requests/issues/6707
requests >= 2.18.4, <2.32.0
requests-cache >= 0.4.10
retry
ruamel.yaml
ruamel.yaml.clib>=0.2.8
sensu-plugin
service-configuration-lib >= 3.2.0
signalfx
slackclient >= 1.2.1
sticht >= 1.1.0
syslogmp
task-processing
thriftpy2
thriftpy2>=0.5.2
transitions
typing-extensions
tzlocal
urllib3
utaw >= 0.2.0
WebOb>=1.8.7
wsgicors
zope.interface>=7.2
Loading
Loading