Skip to content
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

[INTPROD-9211] Python 3.10 Update #108

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v2
48 changes: 34 additions & 14 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup python 3.8
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: '3.10'
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
Expand All @@ -26,28 +24,50 @@ jobs:
run: gem install license_finder
- name: Allow gevent Zope license
run: license_finder permitted_licenses add "Zope Public License"
- name: Setup python 3.8
uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: '3.10'
- name: Install apt dependencies
run: sudo apt-get update -y && sudo apt-get install -y python3-dev openssl libssl-dev gcc pkg-config libffi-dev libxml2-dev libxmlsec1-dev
- name: Install dependencies
run: pip install -r piptools_requirements3.txt && pip install -r requirements3.txt
run: pip install -r piptools_requirements.txt && pip install -r requirements.txt
- name: Run license finder
run: license_finder
test:
build-docs:
name: Build and publish docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install virtualenv
run: pip install virtualenv
- name: Build docs
run: make build_docs
- name: Remove docs folder, so github will ignore it
run: rm -rf docs
build--docker-image:
name: Build and publish docker image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup python 3.8
uses: actions/setup-python@v4
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@5
with:
name: lyft/omnibot
no_push: true
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: '3.10'
- name: Install apt dependencies
run: sudo apt-get update -y && sudo apt-get install -y python3-dev openssl libssl-dev gcc pkg-config libffi-dev libxml2-dev libxmlsec1-dev
- name: Install dependencies
run: pip install -r piptools_requirements3.txt && pip install -r requirements3.txt
run: pip install -r piptools_requirements.txt && pip install -r requirements.txt
- name: Run tests
run: make test
18 changes: 7 additions & 11 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ jobs:
name: Build and publish docs
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup python 3.8
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: '3.10'
- name: Install virtualenv
run: pip install virtualenv
- name: Build docs
Expand All @@ -33,12 +31,10 @@ jobs:
name: Build and publish python module to pypi
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup python 3.8
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: '3.10'
- name: Add wheel dependency
run: pip install wheel
- name: Generate dist
Expand All @@ -56,7 +52,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v3
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@2.8
uses: elgohr/Publish-Docker-Github-Action@5
with:
name: lyft/omnibot
username: ${{ secrets.DOCKER_USERNAME }}
Expand Down
8 changes: 5 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
exclude: '^docs/.*$'
default_language_version:
python: python3.8
python: python3.10
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
Expand All @@ -24,7 +24,7 @@ repos:
rev: v3.9.0
hooks:
- id: reorder-python-imports
args: [--py38-plus]
args: ['--py310-plus']
- repo: https://github.com/asottile/add-trailing-comma
rev: v2.4.0
hooks:
Expand All @@ -34,7 +34,7 @@ repos:
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py38-plus]
args: ['--py310-plus']
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v2.0.1
hooks:
Expand All @@ -43,6 +43,8 @@ repos:
rev: 23.1.0
hooks:
- id: black
args:
- --target-version=py310
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM ubuntu:bionic
LABEL maintainer="rlane@lyft.com"

COPY ./piptools_requirements3.txt /srv/omnibot/piptools_requirements3.txt
COPY ./requirements3.txt /srv/omnibot/requirements3.txt
COPY ./piptools_requirements.txt /srv/omnibot/piptools_requirements.txt
COPY ./requirements.txt /srv/omnibot/requirements.txt

WORKDIR /srv/omnibot

Expand All @@ -11,7 +11,7 @@ RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-dev python3-pip openssl libssl-dev gcc pkg-config libffi-dev libxml2-dev libxmlsec1-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN pip3 install -r piptools_requirements3.txt && \
pip3 install -r requirements3.txt
RUN pip3 install -r piptools_requirements.txt && \
pip3 install -r requirements.txt

COPY . /srv/omnibot
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# we use the pipefail option below, which is bash specific.
SHELL := /bin/bash

.PHONY: compile_deps # freeze requirements.in to requirements3.txt
.PHONY: compile_deps # freeze requirements.in to requirements.txt
compile_deps:
./pip-compile.sh

Expand Down
2 changes: 1 addition & 1 deletion config/license_finder.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
decisions_file: './config/license_finder_decisions.yml'
python_version: '3'
pip_requirements_path: './requirements3.txt'
pip_requirements_path: './requirements.txt'
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-r ../requirements3.txt
-r ../requirements.txt
GitPython==3.1.32
Jinja2==2.11.3
MarkupSafe==1.1.1
Expand Down
4 changes: 2 additions & 2 deletions docs/root/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Adding new dependencies to requirements
=======================================

We freeze python dependencies from direct dependencies (from ``requirements.in``),
to diamond dependencies (in ``requirements3.txt``). Doing so ensures a consistent installation
to diamond dependencies (in ``requirements.txt``). Doing so ensures a consistent installation
with well known versions in test environments, out to production environments.

If you need to add a dependency, or update the version of a dependency, you should modify
Expand All @@ -56,7 +56,7 @@ Approving licenses or dependencies

We run a `license scanner/approver <https://github.com/pivotal/LicenseFinder>`_ for third-party
dependencies used by omnibot. If you add or upgrade dependencies in ``requirements.in`` or
``requirements3.txt``, the license scanner tests may fail, outputing the failed requirement, and
``requirements.txt``, the license scanner tests may fail, outputing the failed requirement, and
its associated license. As long as the license is acceptable, a project owner will approve the
license for use.

Expand Down
4 changes: 2 additions & 2 deletions docs/root/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ Make a virtualenv and install pip requirements
virtualenv venv
source venv/bin/activate
pip install -U pip
pip install -r piptools_requirements3.txt
pip install -r requirements3.txt
pip install -r piptools_requirements.txt
pip install -r requirements.txt
deactivate
Run omnibot
Expand Down
4 changes: 2 additions & 2 deletions pip-compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ source_venv() {
SCRIPT_DIR=$(dirname "$0")

source_venv piptools_venv
pip install -r "${SCRIPT_DIR}"/piptools_requirements3.txt
pip install -r "${SCRIPT_DIR}"/piptools_requirements.txt
pip install pip-tools
pip-compile --output-file "${SCRIPT_DIR}"/requirements3.txt "${SCRIPT_DIR}"/requirements.in
pip-compile --output-file "${SCRIPT_DIR}"/requirements.txt "${SCRIPT_DIR}"/requirements.in
11 changes: 11 additions & 0 deletions piptools_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# cd ~/src/omnibot && run-piptools
#

pip==19.2
# via -r /code/piptools/bootstrap_ins/requirements.in
setuptools==59.6.0
# via -r /code/piptools/bootstrap_ins/requirements.in
6 changes: 0 additions & 6 deletions piptools_requirements3.txt

This file was deleted.

4 changes: 2 additions & 2 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# piptools: python3.8
# piptools: python3.10


# WSGI HTTP Server for UNIX
Expand Down Expand Up @@ -49,7 +49,7 @@ greenlet==1.1.0
# YAML parser and emitter for Python
# License: MIT
# Upstream url: http://pyyaml.org/wiki/PyYAML
PyYAML==5.4
PyYAML==6.0.1

# The AWS SDK for Python
# License: Apache2
Expand Down
118 changes: 118 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# cd ~/src/omnibot && run-piptools
#
attrs==23.2.0
# via pytest
blinker==1.4
# via -r requirements.in
boto3==1.4.5
# via -r requirements.in
botocore==1.5.95
# via
# boto3
# s3transfer
certifi==2024.2.2
# via requests
charset-normalizer==3.3.2
# via requests
click==7.1.2
# via flask
coverage==7.4.4
# via pytest-cov
docutils==0.20.1
# via botocore
flask==1.1.4
# via
# -r requirements.in
# flask-script
flask-script==2.0.5
# via -r requirements.in
gevent==23.7.0
# via -r requirements.in
greenlet==2.0.2
# via
# -r requirements.in
# gevent
gunicorn==19.10.0
# via -r requirements.in
idna==3.6
# via requests
iniconfig==2.0.0
# via pytest
itsdangerous==1.1.0
# via flask
jinja2==2.11.3.post1
# via flask
jmespath==0.10.0
# via
# boto3
# botocore
markupsafe==2.0.1
# via jinja2
packaging==24.0
# via pytest
pluggy==0.13.1
# via pytest
psutil==5.9.8
# via rainbow-saddle
py==1.11.0
# via pytest
pytest==6.2.4
# via
# -r requirements.in
# pytest-cov
# pytest-mock
pytest-cov==2.11.1
# via -r requirements.in
pytest-mock==3.6.1
# via -r requirements.in
python-dateutil==2.9.0.post0
# via botocore
python-json-logger==0.1.11
# via -r requirements.in
python-redis-lock==3.2.0
# via -r requirements.in
pyyaml==6.0.1
# via -r requirements.in
rainbow-saddle==0.4.0
# via -r requirements.in
redis==2.10.6
# via
# -r requirements.in
# python-redis-lock
requests==2.31.0
# via slackclient
s3transfer==0.1.13
# via boto3
six==1.16.0
# via
# python-dateutil
# slackclient
# websocket-client
slackclient==1.3.1
# via -r requirements.in
statsd==3.2.1
# via -r requirements.in
toml==0.10.2
# via pytest
urllib3==2.2.1
# via requests
websocket-client==0.54.0
# via slackclient
werkzeug==1.0.1
# via flask
zope-event==5.0
# via gevent
zope-interface==6.2
# via gevent

pip==19.2
# via -r piptools_requirements.txt
setuptools==59.6.0
# via
# -r piptools_requirements.txt
# zope-event
# zope-interface
Loading
Loading