Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Update pinned requirements #5

Update pinned requirements

Update pinned requirements #5

name: Update pinned requirements
on:
schedule:
- cron: 0 12 * * 1
workflow_dispatch:
jobs:
update-requirements:
name: Regenerate requirements
runs-on: ubuntu-latest
if: github.repository == 'PlasmaPy/PlasmaPy'
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install tox and its extensions
run: python -m pip install --upgrade tox tox-uv nox uv
# Temporarily use requirements files generated both by tox and nox
# during the switchover from tox to nox.
- name: Rebuild requirements with tox
run: tox -e requirements
- name: Rebuild requirements with nox
run: nox -s requirements
# When a PR is created by a GitHub Action, normally the checks will
# not be run. While the simplest workaround would have been to open
# and close the PR, an alternative is to authenticate with GitHub
# App generated tokens (as done below). The instructions for how to
# do this are in the documentation for the create-pull-request
# action.
- uses: tibdex/github-app-token@v2
id: generate_token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
token: ${{ steps.generate_token.outputs.token }}
commit-message: Regenerate requirements
title: Update pinned requirements
body: |
This pull request (PR) regenerates the pinned requirements files used in continuous integration (CI) tests and by integrated development environments (IDEs), including [requirements.txt](https://github.com/PlasmaPy/PlasmaPy/blob/main/requirements.txt) and the files in the[requirements/](https://github.com/PlasmaPy/PlasmaPy/blob/main/requirements) directory. To update requirements locally, run "tox -e requirements", with the environment defined in [tox.ini](https://github.com/PlasmaPy/PlasmaPy/blob/main/tox.ini). The resolution of requirements is done by [uv](https://github.com/astral-sh/uv).
The purpose of periodically regenerating requirements files is to reduce the probability that tests will spontaneously start failing in other PRs due to a breaking change in a dependency. If all tests pass, please merge this PR. If any checks fail due to changes in the packages that we depend on, please use this PR to perform the fixes that are necessary to get the checks to pass again.
In some cases, it may be necessary to put a *temporary* upper limit on the allowed versions of a dependency as defined in [pyproject.toml](https://github.com/PlasmaPy/PlasmaPy/blob/main/pyproject.toml). If this is necessary, please [create an issue](https://github.com/PlasmaPy/PlasmaPy/issues/new?title=Remove+upper+limit+on+version+of) that this upper limit should be removed.
labels: No changelog entry needed, dependencies
delete-branch: true
base: main