From 22c08ce567f685505915251f71ad9e4e34ab9528 Mon Sep 17 00:00:00 2001 From: Colin Chung Date: Fri, 5 Apr 2024 11:29:59 -0700 Subject: [PATCH] update docs --- .github/workflows/pull_request.yml | 43 ++++++++++++++++++++++++------ .github/workflows/push.yml | 8 +++--- Dockerfile | 8 +++--- Makefile | 2 +- config/license_finder.yml | 2 +- docs/requirements.txt | 2 +- docs/root/contributing.rst | 4 +-- docs/root/installation.rst | 4 +-- pip-compile.sh | 4 +-- 9 files changed, 52 insertions(+), 25 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 894ed48..1ff50e6 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -5,10 +5,10 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Setup python 3.8 + - name: Setup python 3.10 uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.10 - name: Install pre-commit run: pip install pre-commit - name: Run pre-commit @@ -26,28 +26,55 @@ 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 + - name: Setup python 3.10 uses: actions/setup-python@v4 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 + build-docs: + name: Build and publish docs + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + - name: Setup python 3.10 + uses: actions/setup-python@v4 + 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: Publish to Registry + uses: elgohr/Publish-Docker-Github-Action@2.8 + with: + name: lyft/omnibot + no_push: true test: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Setup python 3.8 + - name: Setup python 3.10 uses: actions/setup-python@v4 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 diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 2f77013..368d71c 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -12,10 +12,10 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Setup python 3.8 + - name: Setup python 3.10 uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.10 - name: Install virtualenv run: pip install virtualenv - name: Build docs @@ -35,10 +35,10 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v3 - - name: Setup python 3.8 + - name: Setup python 3.10 uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.10 - name: Add wheel dependency run: pip install wheel - name: Generate dist diff --git a/Dockerfile b/Dockerfile index a43b655..14a09e0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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 diff --git a/Makefile b/Makefile index 2289714..9fcb2c0 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/config/license_finder.yml b/config/license_finder.yml index 02cdf13..d2796a0 100644 --- a/config/license_finder.yml +++ b/config/license_finder.yml @@ -1,4 +1,4 @@ --- decisions_file: './config/license_finder_decisions.yml' python_version: '3' -pip_requirements_path: './requirements3.txt' +pip_requirements_path: './requirements.txt' diff --git a/docs/requirements.txt b/docs/requirements.txt index e0b8d52..1ba2823 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,4 +1,4 @@ --r ../requirements3.txt +-r ../requirements.txt GitPython==3.1.32 Jinja2==2.11.3 MarkupSafe==1.1.1 diff --git a/docs/root/contributing.rst b/docs/root/contributing.rst index 47ea0f4..f80dd07 100644 --- a/docs/root/contributing.rst +++ b/docs/root/contributing.rst @@ -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 @@ -56,7 +56,7 @@ Approving licenses or dependencies We run a `license scanner/approver `_ 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. diff --git a/docs/root/installation.rst b/docs/root/installation.rst index fdde545..2044739 100644 --- a/docs/root/installation.rst +++ b/docs/root/installation.rst @@ -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 diff --git a/pip-compile.sh b/pip-compile.sh index df99f02..151fef7 100755 --- a/pip-compile.sh +++ b/pip-compile.sh @@ -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