Skip to content

Commit

Permalink
Use pip-compile to manage dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
eltos committed Oct 1, 2024
1 parent e296e80 commit 07b740c
Show file tree
Hide file tree
Showing 19 changed files with 1,306 additions and 48 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/dependencies.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Dependencies

on:
workflow_dispatch:
schedule:
- cron: '47 8 19 * *'

permissions:
pull-requests: write
# Note: DEPENDENCY_WORKFLOW_KEY is used, such that CI will be triggered on push

concurrency:
group: ${{ github.workflow }}

jobs:
update-dependencies:
runs-on: ubuntu-24.04
strategy:
matrix:
python-version: [ '3.9', '3.10', '3.11', '3.12' ]
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.DEPENDENCY_WORKFLOW_KEY }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install pip-tools==7.4.1
- name: Update dependencies
run: |
cd requirements
pip-compile --upgrade --no-annotate -o examples-requirements-py${{ matrix.python-version }}.txt --all-extras ../pyproject.toml examples.in
pip-compile --upgrade --no-annotate -o tests-requirements-py${{ matrix.python-version }}.txt examples-requirements-py${{ matrix.python-version }}.txt tests.in
- name: Open PR
uses: peter-evans/create-pull-request@v7.0.5
with:
commit-message: Dependency updates for Python ${{ matrix.python-version }}
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
branch: deps/py${{ matrix.python-version }}
delete-branch: true
title: Dependency updates for Python ${{ matrix.python-version }}
labels: |
dependencies
body: |
Dependency updates by pip-compile
update-dependencies-docs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
ssh-key: ${{ secrets.DEPENDENCY_WORKFLOW_KEY }}
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: pip install pip-tools==7.4.1
- name: Update dependencies
run: |
cd requirements
pip-compile --upgrade --no-annotate -o docs-requirements.txt examples-requirements-py3.12.txt docs.in
- name: Open PR
uses: peter-evans/create-pull-request@v7.0.5
with:
commit-message: Dependency updates for docs
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
branch: deps/docs
delete-branch: true
title: Dependency updates for docs
labels: |
dependencies
body: |
Dependency updates by pip-compile
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ jobs:
python-version: '3.12'
- name: Install dependencies
run: |
pip install -r requirements/docs-requirements.txt
pip install -e .
pip install -r docs/requirements.txt
- name: Sphinx build
run: |
sphinx-build docs _build/html
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,22 @@ jobs:
strategy:
matrix:
python-version: [ '3.9', '3.10', '3.11', '3.12' ]
dep-versions: [ '', '-numpy1' ]
dep-versions: [ '', 'numpy1' ]
exclude:
- python-version: '3.12'
dep-versions: '-numpy1'
dep-versions: 'numpy1'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -r requirements/tests-requirements-py${{ matrix.python-version }}.txt
if [[ -n "${{ matrix.dep-versions }}" ]]; then
pip install -r requirements/tests-requirements-var-${{ matrix.dep-versions }}.txt
fi
pip install -e .
pip install -r tests/requirements.txt
pip install -r tests/requirements${{ matrix.dep-versions }}.txt
- name: Pytest
run: |
cd tests
Expand All @@ -36,8 +38,8 @@ jobs:
python-version: '3.12'
- name: Install dependencies
run: |
pip install -r requirements/docs-requirements.txt
pip install -e .
pip install -r docs/requirements.txt
- name: Sphinx build
run: |
sphinx-build docs _build/html
Expand Down
20 changes: 0 additions & 20 deletions docs/requirements.txt

This file was deleted.

16 changes: 0 additions & 16 deletions examples/requirements.txt

This file was deleted.

174 changes: 174 additions & 0 deletions requirements/docs-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile --no-annotate --output-file=docs-requirements.txt docs.in examples-requirements-py3.12.txt
#
accessible-pygments==0.0.5
alabaster==1.0.0
anyio==4.6.0
apeye==1.4.1
apeye-core==1.1.5
appdirs==1.4.4
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
astroid==3.3.2
asttokens==2.4.1
async-lru==2.0.4
attrs==24.2.0
autodocsumm==0.2.13
babel==2.16.0
beautifulsoup4==4.12.3
bleach==6.1.0
cachecontrol[filecache]==0.14.0
certifi==2024.8.30
cffi==1.17.1
charset-normalizer==3.3.2
click==8.1.7
comm==0.2.2
contourpy==1.3.0
cssutils==2.11.1
cycler==0.12.1
cython==3.0.11
debugpy==1.8.6
decorator==5.1.1
defusedxml==0.7.1
dict2css==0.3.0.post1
docutils==0.21.2
domdf-python-tools==3.9.0
executing==2.1.0
fastjsonschema==2.20.0
filelock==3.16.1
flexcache==0.3
flexparser==0.3.1
fonttools==4.54.1
fqdn==1.5.1
greenlet==3.1.1
h11==0.14.0
html5lib==1.1
httpcore==1.0.5
httpx==0.27.2
idna==3.10
imagesize==1.4.1
importlib-metadata==8.5.0
ipykernel==6.29.5
ipython==8.18.1
isoduration==20.11.0
jedi==0.19.1
jinja2==3.1.4
json5==0.9.25
jsonpointer==3.0.0
jsonschema[format-nongpl]==4.23.0
jsonschema-specifications==2023.12.1
jupyter-cache==1.0.0
jupyter-client==8.6.3
jupyter-core==5.7.2
jupyter-events==0.10.0
jupyter-lsp==2.2.5
jupyter-server==2.14.2
jupyter-server-terminals==0.5.3
jupyterlab==4.2.5
jupyterlab-pygments==0.3.0
jupyterlab-server==2.27.3
kiwisolver==1.4.7
lark==1.2.2
markdown-it-py==3.0.0
markupsafe==2.1.5
matplotlib==3.9.2
matplotlib-inline==0.1.7
mdit-py-plugins==0.4.2
mdurl==0.1.2
mistune==3.0.2
more-itertools==10.5.0
msgpack==1.1.0
myst-nb==1.1.1
myst-parser==4.0.0
natsort==8.4.0
nbclient==0.10.0
nbconvert==7.16.4
nbformat==5.10.4
nest-asyncio==1.6.0
notebook-shim==0.2.4
numpy==2.0.2
overrides==7.7.0
packaging==24.1
pandas==2.2.2
pandocfilters==1.5.1
parso==0.8.4
pexpect==4.9.0
pillow==10.4.0
pint==0.24.3
platformdirs==4.3.6
pockets==0.9.1
prometheus-client==0.21.0
prompt-toolkit==3.0.48
psutil==6.0.0
ptyprocess==0.7.0
pure-eval==0.2.3
pycparser==2.22
pydata-sphinx-theme==0.15.4
pygments==2.18.0
pyparsing==3.1.4
python-dateutil==2.9.0.post0
python-json-logger==2.0.7
pytz==2024.2
pyyaml==6.0.2
pyzmq==26.2.0
referencing==0.35.1
requests==2.32.3
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.20.0
ruamel-yaml==0.18.6
ruamel-yaml-clib==0.2.8
scipy==1.13.1
send2trash==1.8.3
six==1.16.0
sniffio==1.3.1
snowballstemmer==2.2.0
soupsieve==2.6
sphinx==8.0.2
sphinx-autoapi==3.3.1
sphinx-autodoc-typehints==2.4.1
sphinx-codeautolink==0.15.2
sphinx-gallery==0.17.1
sphinx-jinja2-compat==0.3.0
sphinx-prompt==1.9.0
sphinx-tabs==3.4.5
sphinx-toolbox==3.8.0
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-napoleon==0.7
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
sqlalchemy==2.0.35
stack-data==0.6.3
tabulate==0.9.0
terminado==0.18.1
tinycss2==1.3.0
tornado==6.4.1
tqdm==4.66.5
traitlets==5.14.3
types-python-dateutil==2.9.0.20240906
typing-extensions==4.12.2
tzdata==2024.2
uri-template==1.3.0
urllib3==2.2.3
wcwidth==0.2.13
webcolors==24.8.0
webencodings==0.5.1
websocket-client==1.8.0
xcoll==0.5.1
xdeps==0.6.3
xfields==0.20.3
xobjects==0.4.4
xpart==0.18.6
xsuite==0.16.5
xtrack==0.66.1
zipp==3.20.2

# The following packages are considered to be unsafe in a requirements file:
# setuptools
12 changes: 12 additions & 0 deletions requirements/docs.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
myst-nb
pydata-sphinx-theme
sphinx
sphinx-autoapi
sphinx-autodoc-typehints
sphinx-codeautolink
sphinx-gallery
sphinx-jinja2-compat
sphinx-prompt
sphinx-tabs
sphinx-toolbox
sphinxcontrib-napoleon
Loading

0 comments on commit 07b740c

Please sign in to comment.