Skip to content

Commit

Permalink
Switch all references of py37 to py38 (#3672)
Browse files Browse the repository at this point in the history
Python3.7 is pretty old, we should at least be on 3.8
  • Loading branch information
nemacysts authored Aug 10, 2023
1 parent 2e09cdd commit 57619bc
Show file tree
Hide file tree
Showing 29 changed files with 85 additions and 172 deletions.
2 changes: 1 addition & 1 deletion .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:
- py37-linux,docs,mypy,tests
- py38-linux,docs,mypy,tests
- general_itests
env:
DOCKER_REGISTRY: ""
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
fail-fast: false
matrix:
toxenv:
- py37-linux,docs,mypy,tests
- py38-linux,docs,mypy,tests
- general_itests
env:
DOCKER_REGISTRY: ""
Expand Down
6 changes: 4 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
default_language_version:
python: python3.8
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0
Expand Down Expand Up @@ -39,8 +42,7 @@ repos:
rev: 22.3.0
hooks:
- id: black
language_version: python3.7
args: ['--target-version', 'py37']
args: ['--target-version', 'py38']
exclude: ^paasta_tools/paastaapi
- repo: https://github.com/PyCQA/flake8
rev: 3.7.7
Expand Down
30 changes: 15 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@ test-yelpy: .paasta/bin/activate
test-not-yelpy: .paasta/bin/activate
.paasta/bin/tox -e tests

quick-test: .tox/py37-linux
TZ=UTC .tox/py37-linux/bin/py.test --last-failed -x -- tests
quick-test: .tox/py38-linux
TZ=UTC .tox/py38-linux/bin/py.test --last-failed -x -- tests

.tox/py37-linux: .paasta/bin/activate
.tox/py38-linux: .paasta/bin/activate
.paasta/bin/tox

dev-api: .tox/py37-linux
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.7 .paasta
test -d .paasta/bin/activate || virtualenv -p python3.8 .paasta
.paasta/bin/pip install -U \
pip==18.1 \
virtualenv==16.2.0 \
Expand Down Expand Up @@ -102,7 +102,7 @@ k8s_itests: .paasta/bin/activate
make -C k8s_itests all

.PHONY: k8s_fake_cluster
k8s_fake_cluster: .tox/py37-linux
k8s_fake_cluster: .tox/py38-linux
make -C k8s_itests .fake_cluster

.PHONY: k8s_clean
Expand Down Expand Up @@ -133,37 +133,37 @@ swagger-validate:
-i paasta_tools/api/api_docs/swagger.json

.PHONY: vscode_settings
vscode_settings: .paasta/bin/activate .tox/py37-linux
vscode_settings: .paasta/bin/activate .tox/py38-linux
.paasta/bin/python paasta_tools/contrib/ide_helper.py

etc_paasta_playground soa_config_playground: .paasta/bin/activate .tox/py37-linux
.tox/py37-linux/bin/python paasta_tools/contrib/create_paasta_playground.py
etc_paasta_playground soa_config_playground: .paasta/bin/activate .tox/py38-linux
.tox/py38-linux/bin/python paasta_tools/contrib/create_paasta_playground.py

.PHONY: generate_deployments_for_service
generate_deployments_for_service: | soa_config_playground .tox/py37-linux
generate_deployments_for_service: | soa_config_playground .tox/py38-linux
export KUBECONFIG=./k8s_itests/kubeconfig;\
export PAASTA_SYSTEM_CONFIG_DIR=./etc_paasta_playground/;\
export PAASTA_TEST_CLUSTER=kind-${USER}-k8s-test;\
.tox/py37-linux/bin/python -m paasta_tools.cli.cli list -a -y ./soa_config_playground | shuf | xargs -n 1 --no-run-if-empty \
.tox/py37-linux/bin/python -m paasta_tools.generate_deployments_for_service -d ./soa_config_playground -v -s
.tox/py38-linux/bin/python -m paasta_tools.cli.cli list -a -y ./soa_config_playground | shuf | xargs -n 1 --no-run-if-empty \
.tox/py38-linux/bin/python -m paasta_tools.generate_deployments_for_service -d ./soa_config_playground -v -s

.PHONY: playground-api
playground-api: .tox/py37-linux | soa_config_playground
playground-api: .tox/py38-linux | soa_config_playground
.paasta/bin/tox -e playground-api

.PHONY: setup-kubernetes-job
setup-kubernetes-job: k8s_fake_cluster generate_deployments_for_service
export KUBECONFIG=./k8s_itests/kubeconfig;\
export PAASTA_SYSTEM_CONFIG_DIR=./etc_paasta_playground/;\
export PAASTA_TEST_CLUSTER=kind-${USER}-k8s-test;\
.tox/py37-linux/bin/python -m paasta_tools.list_kubernetes_service_instances -d ./soa_config_playground --shuffle --group-lines 1 | xargs --no-run-if-empty .tox/py37-linux/bin/python -m paasta_tools.setup_kubernetes_job -d ./soa_config_playground -c kind-${USER}-k8s-test
.tox/py38-linux/bin/python -m paasta_tools.list_kubernetes_service_instances -d ./soa_config_playground --shuffle --group-lines 1 | xargs --no-run-if-empty .tox/py38-linux/bin/python -m paasta_tools.setup_kubernetes_job -d ./soa_config_playground -c kind-${USER}-k8s-test

.PHONY: paasta-secrets-sync
paasta-secrets-sync: setup-kubernetes-job .vault-token
export KUBECONFIG=./k8s_itests/kubeconfig;\
export PAASTA_SYSTEM_CONFIG_DIR=./etc_paasta_playground/;\
export PAASTA_TEST_CLUSTER=kind-${USER}-k8s-test;\
{ .tox/py37-linux/bin/python -m paasta_tools.list_kubernetes_service_instances -d ./soa_config_playground ; echo -n \ _shared; } | cut -f1 -d"." | uniq | shuf | xargs .tox/py37-linux/bin/python -m paasta_tools.kubernetes.bin.paasta_secrets_sync -v -d ./soa_config_playground -t ./.vault-token
{ .tox/py38-linux/bin/python -m paasta_tools.list_kubernetes_service_instances -d ./soa_config_playground ; echo -n \ _shared; } | cut -f1 -d"." | uniq | shuf | xargs .tox/py38-linux/bin/python -m paasta_tools.kubernetes.bin.paasta_secrets_sync -v -d ./soa_config_playground -t ./.vault-token

.vault-token:
export VAULT_ADDR=https://vault-devc.yelpcorp.com:8200 ;\
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.7, dh-virtualenv
Build-Depends: debhelper (>= 7), python3.8, dh-virtualenv
Standards-Version: 3.8.3

Package: paasta-tools
Architecture: any
Depends: python3.7, ${shlibs:Depends}, ${misc:Depends}
Depends: python3.8, ${shlibs:Depends}, ${misc:Depends}
Description: CLI tools for PaaSTA
Conflicts: service-deployment-tools
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ 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.7 \
--python=/usr/bin/python3.8 \
--preinstall no-manylinux1 \
--preinstall=-rrequirements-bootstrap.txt
cp yelp_package/gopath/paasta_go $(DH_VENV_DIR)/bin/paasta_go
2 changes: 1 addition & 1 deletion docs/source/paasta_development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Steps below outline running PaaSTA playground components with a debugger attache

.. sourcecode:: shell

(py37-linux) user@dev55-uswest1adevc:~/pg/paasta$ KUBECONFIG=./k8s_itests/kubeconfig kubectl get pods -n paasta
(py38-linux) user@dev55-uswest1adevc:~/pg/paasta$ KUBECONFIG=./k8s_itests/kubeconfig kubectl get pods -n paasta
NAME READY STATUS RESTARTS AGE
compute-infra-test-service-autoscaling-6fdf96b485-2fkd5 1/1 Running 0 25s
compute-infra-test-service-autoscaling-6fdf96b485-44lqp 1/1 Running 0 25s
Expand Down
2 changes: 1 addition & 1 deletion docs/source/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ To run a tests for a specific module:

Ensure the virtualenv created by tox is activated

``source .tox/py37/bin/activate``
``source .tox/py38/bin/activate``

And execute pytest

Expand Down
2 changes: 1 addition & 1 deletion k8s_itests/scripts/set-paasta-registry-credentials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CLUSTER=$1
for node in $(./kind get nodes --name "${CLUSTER}"); do
echo "Moving credentials to kind node: $node ..."
docker cp "${node}:/etc/containerd/config.toml" "./.tmp/${node}-containerd.toml"
../.tox/py37-linux/bin/python ./scripts/containerd_registry_setup.py "./.tmp/${node}-containerd.toml"
../.tox/py38-linux/bin/python ./scripts/containerd_registry_setup.py "./.tmp/${node}-containerd.toml"
docker cp "./.tmp/${node}-containerd.toml" "${node}:/etc/containerd/config.toml"
rm ./.tmp/${node}-containerd.toml
# restart kubelet and containerd to pick up the updated config
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.7
#!/usr/bin/env python3.8
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", "py37-linux,docs,mypy,tests"],
"args": ["-e", "py38-linux,docs,mypy,tests"],
},
{
"name": "paasta cli",
"cwd": "${workspaceFolder}",
"python": "${workspaceFolder}/.tox/py37-linux/bin/python",
"python": "${workspaceFolder}/.tox/py38-linux/bin/python",
"type": "python",
"request": "launch",
"module": "paasta_tools.cli.cli",
},
{
"name": "paasta rollback",
"cwd": "${workspaceFolder}",
"python": "${workspaceFolder}/.tox/py37-linux/bin/python",
"python": "${workspaceFolder}/.tox/py38-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/py37-linux/bin/python",
"python": "${workspaceFolder}/.tox/py38-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/py37-linux/bin/python",
"python": "${workspaceFolder}/.tox/py38-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/py37-linux/bin/python",
"python": "${workspaceFolder}/.tox/py38-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/py37-linux/bin/python",
"python": "${workspaceFolder}/.tox/py38-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/py37-linux/bin/python",
"python": "${workspaceFolder}/.tox/py38-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/py37-linux/bin/python",
"python": "${workspaceFolder}/.tox/py38-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/py37-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/py38-linux/bin/python paasta_tools/cli/cli.py status --clusters norcal-devc --service katamari_test_service
"name": "paasta API",
"cwd": "${workspaceFolder}",
"python": "${workspaceFolder}/.tox/py37-linux/bin/python",
"python": "${workspaceFolder}/.tox/py38-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/py37-linux/bin/python",
"python": "${workspaceFolder}/.tox/py38-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/py37-linux/bin/python",
"python": "${workspaceFolder}/.tox/py38-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/py37-linux/bin/python",
"python": "${workspaceFolder}/.tox/py38-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.7
#!/usr/bin/env python3.8
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.7
#!/usr/bin/env python3.8
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.7
#!/usr/bin/env python3.8
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/py37-linux/bin/python",
".tox/py37-linux/bin/python",
".tox/py38-linux/bin/python",
".tox/py38-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/py37-linux/bin/python",
".tox/py37-linux/bin/python",
".tox/py38-linux/bin/python",
".tox/py38-linux/bin/python",
"-m",
"paasta_tools.api.api",
*["-D", "-c", cluster, str(port)],
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.black]
line-length = 88
target_version = ['py37']
target_version = ['py38']
exclude = '''
(
/(
Expand Down
17 changes: 8 additions & 9 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
alabaster==0.7.10
appdirs==1.4.4
# aspy.yaml==0.3.0
astroid==2.4.2
asynctest==0.12.0
Babel==2.9.1
cfgv==2.0.1
coverage==6.5.0
distlib==0.3.4
exceptiongroup==1.1.2
filelock==3.0.12
flake8==3.5.0
freezegun==0.3.7
hypothesis==3.71.10
hypothesis==6.79.4
identify==2.4.12
imagesize==0.7.1
importlib-metadata==1.7.0
iniconfig==2.0.0
isort==4.2.5
lazy-object-proxy==1.4.3
mccabe==0.6.1
mock==2.0.0
more-itertools==9.0.0
nodeenv==1.1.4
packaging==20.9
path.py==8.1
pbr==3.1.1
pep8==1.5.7
pluggy==0.6.0
pluggy==1.2.0
pre-commit==2.17.0
pycodestyle==2.3.1
pyfakefs==4.1.0
pyflakes==1.6.0
Pygments==2.7.4
pylint==2.6.0
pyparsing==2.4.7
pytest==3.5.0
pytest-asyncio==0.8.0
pytest==7.4.0
pytest-asyncio==0.21.1
requirements-tools==1.1.2
snowballstemmer==1.2.0
sortedcontainers==2.4.0
Sphinx==2.2.0
sphinx-rtd-theme==1.0.0
sphinxcontrib-applehelp==1.0.1
Expand All @@ -45,8 +45,7 @@ sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.2
sphinxcontrib-serializinghtml==1.1.3
toml==0.9.4
typed-ast==1.4.3
tomli==2.0.1
virtualenv==20.4.3
wrapt==1.12.1
zake==0.2.2
zipp==0.5.2
Loading

0 comments on commit 57619bc

Please sign in to comment.