Skip to content

Update dependencies with pip-tools #210

Update dependencies with pip-tools

Update dependencies with pip-tools #210

Workflow file for this run

# Action to run pip-compile weekly and create a Pull Request with the changes.
# Although GitHub says that pip-compile is supported by dependabot, we couldn't make it work together.
# That's why this action exists.
# If we ever find the proper configuration for dependabot+pip-compile,
# we can delete this action.
name: Update dependencies with pip-tools
on:
schedule:
# Run weekly on day 0 at 00:00 UTC
- cron: "0 0 * * 0"
workflow_dispatch:
permissions:
contents: read
jobs:
update-dependencies:
permissions:
contents: write # to create branch (peter-evans/create-pull-request)
pull-requests: write # to create a PR (peter-evans/create-pull-request)
name: Update dependencies
runs-on: ubuntu-latest
if: github.repository_owner == 'readthedocs' # do not run this job on forks
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Update submodules
run: git submodule update --init
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.12"
- name: Install "pg_config" requirement
run: sudo apt-get install libpq-dev
- name: Install piptools and invoke
# Install pip-tools from Git and pip>=26 to get the "--uploaded-prior-to" flag.
# pip<26.2 because pip 26.2 made "allow_editables" a required argument and pip-tools breaks:
# https://github.com/jazzband/pip-tools/issues/2437
run: python -m pip install --upgrade "pip>=26,<26.2" "pip-tools @ git+https://github.com/jazzband/pip-tools" invoke
- name: Update dependencies from requirements/*.txt
run: invoke requirements.update
- name: Create Pull Request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
add-paths: |
requirements/*.txt
title: |
Dependencies: all packages updated via pip-tools
body: |
Dependencies: all packages updated via pip-tools
commit-message: |
Dependencies: all packages updated via pip-tools
delete-branch: true
branch: dependencies/pip-tools
branch-suffix: short-commit-hash