-
Notifications
You must be signed in to change notification settings - Fork 8
U/robj/py312 upgrade #116
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
base: master
Are you sure you want to change the base?
U/robj/py312 upgrade #116
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,40 @@ | ||
| FROM ubuntu:jammy | ||
|
|
||
| ARG DEBIAN_FRONTEND=noninteractive | ||
| ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND} | ||
| ENV TZ=Etc/UTC | ||
|
|
||
| ARG PIP_INDEX_URL=https://pypi.yelpcorp.com/simple | ||
| ENV PIP_INDEX_URL=$PIP_INDEX_URL | ||
|
|
||
| RUN apt-get update && \ | ||
| apt-get install -y --no-install-recommends gnupg2 software-properties-common && \ | ||
| DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg2 software-properties-common && \ | ||
| add-apt-repository ppa:deadsnakes/ppa | ||
|
|
||
| RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install \ | ||
| build-essential \ | ||
| python3-kazoo \ | ||
| python3-pytest \ | ||
| python3-setuptools \ | ||
| socat \ | ||
| ruby ruby-dev ruby-bundler zlib1g-dev \ | ||
| libcurl4 \ | ||
| python3.7 \ | ||
| python3.7-dev \ | ||
| python3.7-distutils \ | ||
| python3-pip \ | ||
| libffi-dev \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if only we could ensure that public pypi had wheels for everything - when we could get rid of all the -dev packages :p |
||
| python3.11 \ | ||
| python3.11-dev \ | ||
| python3.11-venv \ | ||
| python3.12 \ | ||
| python3.12-dev \ | ||
| python3.12-venv \ | ||
| python3-zope.interface \ | ||
| git \ | ||
| libyaml-dev \ | ||
| libc6-dev \ | ||
| libstdc++6 \ | ||
| wget | ||
|
|
||
| RUN python3.11 -m ensurepip --upgrade | ||
|
|
||
| # Install nerve | ||
| ADD nerve_Gemfile Gemfile | ||
| RUN mkdir -p /opt/nerve | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,7 +41,7 @@ | |
| ] | ||
|
|
||
|
|
||
| @pytest.yield_fixture(scope='module') | ||
| @pytest.fixture(scope='module') | ||
| def setup(): | ||
| # Forward healthchecks to the services | ||
| socat_procs = [] | ||
|
|
@@ -140,7 +140,7 @@ def test_nerve_service_config(setup): | |
| ], | ||
| "host": MY_IP_ADDRESS, | ||
| "port": 1024, | ||
| "weight": CPUS, | ||
| "weight": 10, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if we're not using CPUS anymore, we probably wanna remove it at the top of the file |
||
| "zk_hosts": [ZOOKEEPER_CONNECT_STRING], | ||
| "zk_path": "/smartstack/global/service_three.main", | ||
| 'labels': { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,11 +3,14 @@ set -vx | |
| set -e | ||
|
|
||
| echo "installing hacheck" | ||
| GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git clone git@github.yelpcorp.com:packages/hacheck && cd /hacheck && python3.7 -m pip install . && cp /usr/local/bin/ha* /usr/bin/ | ||
| GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git clone --depth=1 git@github.yelpcorp.com:packages/hacheck /hacheck | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. heh, i guess we haven't been expecting folks to run these itests outside of yelp :p
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, not sure what else we can do now we've taken hacheck internal |
||
| cd /hacheck | ||
| python3.11 -m pip install . | ||
| cp /usr/local/bin/ha* /usr/bin/ | ||
|
|
||
| echo "installing paasta-tools (dependency of nerve-tools.)" | ||
| . /etc/lsb-release | ||
| PAASTA_VERSION=0.145.0 | ||
| PAASTA_VERSION=1.47.0 | ||
| PAASTA_DEB_NAME=paasta-tools_${PAASTA_VERSION}.${DISTRIB_CODENAME}1_amd64.deb | ||
| wget "https://github.com/Yelp/paasta/releases/download/v${PAASTA_VERSION}/${PAASTA_DEB_NAME}" | ||
|
|
||
|
|
@@ -25,4 +28,4 @@ echo "Testing that pyyaml uses optimized cyaml parsers if present" | |
| /opt/venvs/nerve-tools/bin/python -c 'import yaml; assert yaml.__with_libyaml__' | ||
|
|
||
| echo "Full integration test" | ||
| py.test-3 -vvv /itest.py | ||
| python3 -m pytest -vvv /itest.py | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,18 @@ | ||
| FROM ubuntu:jammy | ||
|
|
||
| ARG DEBIAN_FRONTEND=noninteractive | ||
| ENV DEBIAN_FRONTEND=${DEBIAN_FRONTEND} | ||
| ENV TZ=Etc/UTC | ||
|
|
||
| ARG PIP_INDEX_URL=https://pypi.yelpcorp.com/simple | ||
| ENV PIP_INDEX_URL=$PIP_INDEX_URL | ||
|
|
||
| # Need Python 3.7 for nerve-tools | ||
| # Need Python 3.12 for nerve-tools | ||
| RUN apt-get update && \ | ||
| apt-get install -y --no-install-recommends gnupg2 software-properties-common && \ | ||
| DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gnupg2 software-properties-common && \ | ||
| add-apt-repository ppa:deadsnakes/ppa | ||
|
|
||
| RUN apt-get update && apt-get -y install \ | ||
| RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install \ | ||
| build-essential \ | ||
| cargo \ | ||
| curl \ | ||
|
|
@@ -22,17 +26,17 @@ RUN apt-get update && apt-get -y install \ | |
| libyaml-dev \ | ||
| libzookeeper-mt-dev \ | ||
| protobuf-compiler \ | ||
| python3.7-dev \ | ||
| python3.7-distutils \ | ||
| python3.12 \ | ||
| python3.12-dev \ | ||
| python3.12-venv \ | ||
| rustc \ | ||
| wget | ||
|
|
||
| # Preferred method to install pip when not bundled with python - https://pip.pypa.io/en/stable/installing/ | ||
| RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py | ||
| RUN python3.7 get-pip.py | ||
| RUN pip install -U tox pip virtualenv setuptools | ||
| RUN python3.12 -m ensurepip --upgrade | ||
| ADD src/requirements-bootstrap.txt /tmp/requirements-bootstrap.txt | ||
| RUN python3.12 -m pip install -U -r /tmp/requirements-bootstrap.txt tox virtualenv | ||
|
|
||
| ADD location_types.json /nail/etc/services/ | ||
| ADD location_mapping.json /nail/etc/services/ | ||
| ADD dockerfiles/jammy/location_types.json /nail/etc/services/ | ||
| ADD dockerfiles/jammy/location_mapping.json /nail/etc/services/ | ||
|
Comment on lines
+39
to
+40
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this because of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah - just copied how we do it elsewhere |
||
|
|
||
| WORKDIR /work | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,9 @@ | ||
| version: '2.4' | ||
| services: | ||
| jammy: | ||
| build: ../../dockerfiles/jammy | ||
| command: bash -c "cp -R /code/* /work && cd /work/src && tox -e py37-linux && dpkg-buildpackage -d -uc -us && mv ../*.deb /dist" | ||
| build: | ||
| context: ../.. | ||
| dockerfile: ./dockerfiles/jammy/Dockerfile | ||
| command: bash -c "cp -R /code/* /work && cd /work/src && tox -e py312-linux && dpkg-buildpackage -d -uc -us && mv ../*.deb /dist" | ||
| volumes: | ||
| - ../..:/code:ro | ||
| - ../../dist:/dist |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 9 | ||
| 10 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,13 @@ | ||
| Source: nerve-tools | ||
| Section: admin | ||
| Priority: optional | ||
|
Comment on lines
+2
to
+3
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we just leave these out? i was a little confused as to whether this was correct since this is duplicated below (but then i realized that there's two different "sections" here) i don't think we have anything that really cares about these being set unless they're required by the debian/compat bump - which i also don't know much about what that implies/entails
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, excluding them will trigger a warning. |
||
| Maintainer: John Billings <billings@yelp.com> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. !8ball clean this up while we're here
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can do - I was just going to leave it for the sake of a smaller diff |
||
| Build-Depends: | ||
| dh-virtualenv, | ||
|
|
||
| Depends: python3.7, paasta-tools (>= 0.145.0~), ${shlibs:Depends} | ||
| Package: nerve-tools | ||
| Section: admin | ||
| Priority: optional | ||
| Architecture: any | ||
| Depends: python3.12, paasta-tools (>= 1.47.0~), ${shlibs:Depends} | ||
| Description: Nerve-related tools for use on Yelp machines. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,3 @@ | ||
| pip==21.0.1 | ||
| setuptools==54.1.2 | ||
| wheel==0.36.2 | ||
| pip==25.2 | ||
| setuptools==80.10.1 | ||
| wheel==0.46.2 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| coverage==4.5.4 | ||
| flake8==3.7.9 | ||
| mock==3.0.5 | ||
| pytest==5.2.1 | ||
| coverage==6.5.0 | ||
| flake8==7.3.0 | ||
| mypy==1.17.1 | ||
| pytest==7.4.3 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,6 @@ | ||
| argparse==1.2.1 | ||
| cryptography==35.0.0 | ||
| dulwich==0.17.3 | ||
| environment_tools==1.1.3 | ||
| kazoo==2.8.0 | ||
| ldap3==2.7 | ||
| mypy-extensions==0.4.3 | ||
| paasta-tools==0.105.0 | ||
| paasta-tools==1.47.0 | ||
| PyYAML==6.0.1 | ||
| requests==2.23.0 | ||
| service-configuration-lib==2.5.4 | ||
| setuptools==42.0.2 | ||
| requests==2.32.5 | ||
| service-configuration-lib==3.3.8 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,21 @@ | ||
| #!/usr/bin/env python | ||
| # -*- coding: utf-8 -*- | ||
|
|
||
| from pkg_resources import yield_lines | ||
| from setuptools import setup, find_packages | ||
| from pathlib import Path | ||
|
|
||
| from setuptools import find_packages | ||
| from setuptools import setup | ||
|
|
||
| def get_install_requires(): | ||
| with open('requirements.txt', 'r') as f: | ||
| minimal_reqs = list(yield_lines(f.read())) | ||
|
|
||
| return minimal_reqs | ||
| HERE = Path(__file__).parent | ||
|
|
||
|
|
||
| def get_install_requires(): | ||
| return [ | ||
| line.strip() | ||
| for line in (HERE / 'requirements.txt').read_text().splitlines() | ||
| if line.strip() and not line.startswith('#') | ||
| ] | ||
|
Comment on lines
+13
to
+18
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. heh, we haven't really been doing the right thing with install_requires here since the beginning - but that's for later us to fix (maybe) :p
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, I can break this out into a separate PR |
||
|
|
||
|
|
||
| setup( | ||
|
|
@@ -20,7 +26,6 @@ def get_install_requires(): | |
| author_email='compute-infra@yelp.com', | ||
| description='Nerve-related tools for use on Yelp machines', | ||
| packages=find_packages(exclude=['tests']), | ||
| setup_requires=['setuptools'], | ||
| include_package_data=True, | ||
| install_requires=get_install_requires(), | ||
| entry_points={ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| from nerve_tools import clean_nerve | ||
|
|
||
| import mock | ||
| from unittest import mock | ||
|
|
||
|
|
||
| def test_parse_args(): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imo, we can just hardcode this :p