-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MAINT: limit dependencies in Binder environment (#8)
* DX: automatically update pip constraints and pre-commit * DX: git-ignore temporary Conda requirements files * DX: remove new metadata for `nbstripout` * DX: remove VSCode extension for JSON sorting * ENH: define separate requirements for Binder * MAINT: pin requirements with `pip` constraint files * MAINT: remove Jupyter Lab dependencies from Binder environment `jupyterlab-code-formatter` apparently does not work in Binder. * MAINT: update Python version in Jupyter kernels * MAINT: use `black`'s default line width 88 --------- Co-authored-by: GitHub <[email protected]>
- Loading branch information
Showing
23 changed files
with
349 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: Requirements | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- epic/* | ||
- "[0-9]+.[0-9]+.x" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
pip-constraints: | ||
if: >- | ||
github.event_name == 'workflow_dispatch' || | ||
github.event.pull_request.head.repo.full_name == github.repository | ||
name: Update pip constraints | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.8" | ||
- run: pip install pip-tools | ||
- run: pip-compile --no-annotate --strip-extras --upgrade binder/requirements.in | ||
- run: pip-compile --no-annotate --strip-extras --upgrade requirements.in | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
path: | | ||
binder/requirements.txt | ||
requirements.txt | ||
pre-commit: | ||
name: pre-commit autoupdate | ||
if: >- | ||
github.event_name == 'workflow_dispatch' || | ||
github.event.pull_request.head.repo.full_name == github.repository | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ComPWA/update-pre-commit@main | ||
|
||
push: | ||
name: Push changes | ||
runs-on: ubuntu-22.04 | ||
needs: | ||
- pip-constraints | ||
- pre-commit | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.PAT }} | ||
- uses: actions/download-artifact@v3 | ||
- run: ls -A | ||
- name: Move artifacts to correct location | ||
run: | | ||
if [[ -d artifact ]]; then | ||
cd artifact | ||
ls -A | ||
for path in .pre-commit-config.yaml requirements.txt binder/requirements.txt; do | ||
[[ -f $path ]] && mv -f $path ../$path | ||
done | ||
fi | ||
- run: git status -s | ||
- name: Commit and push changes | ||
if: github.event_name == 'pull_request' | ||
run: | | ||
git remote set-url origin https://x-access-token:${{ secrets.PAT }}@github.com/${{ github.repository }} | ||
git config --global user.name "GitHub" | ||
git config --global user.email "[email protected]" | ||
git checkout -b ${{ github.head_ref }} | ||
if [[ $(git status -s) ]]; then | ||
git add -A | ||
git commit -m "MAINT: update pip constraints and pre-commit" | ||
git config pull.rebase true | ||
git pull origin ${{ github.head_ref }} | ||
git push origin HEAD:${{ github.head_ref }} | ||
fi | ||
- name: Create Pull Request | ||
if: >- | ||
github.event_name == 'workflow_dispatch' | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
commit-message: "MAINT: update pip constraints and pre-commit" | ||
committer: GitHub <[email protected]> | ||
author: GitHub <[email protected]> | ||
title: "MAINT: update pip constraints and pre-commit" | ||
labels: | | ||
🔨 Maintenance | ||
branch-suffix: timestamp | ||
delete-branch: true | ||
token: ${{ secrets.PAT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
*.csv | ||
.ipynb_checkpoints/ | ||
.tox/ | ||
condaenv.*.requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.