-
Notifications
You must be signed in to change notification settings - Fork 10
Add CI and mybinder to Example Notebooks #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
34d4803
36ee83e
2845bf5
933ac2c
0d2b571
95223bd
9ef1226
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| name: openfe-notebooks | ||
| channels: | ||
| - jaimergp/label/unsupported-cudatoolkit-shim | ||
| - conda-forge | ||
| dependencies: | ||
| # setup | ||
| - openmm | ||
| - openmmforcefields | ||
| - openff-toolkit | ||
| # CI | ||
| - pytest | ||
| - pytest-xdist | ||
| - nbval |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| name: full_tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - master | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| - master | ||
| schedule: | ||
| # nightly tests, 2 am | ||
| - cron: "0 2 * * *" | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Worth adding a concurrency section? (i.e. something like this: https://github.com/MDAnalysis/mdanalysis/blob/5bf6359a821c085a1039ca414ce51ca2820722fb/.github/workflows/gh-ci.yaml#L12-L17)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes that is perfect and I will start adding that to other projects, thanks! |
||
| concurrency: | ||
| # Probably overly cautious group naming. | ||
| # Commits to develop/master will cancel each other, but PRs will only cancel | ||
| # commits within the same PR | ||
| group: "${{ github.ref }}-${{ github.head_ref }}" | ||
| cancel-in-progress: true | ||
|
|
||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash -l {0} | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-10.15, macos-11] | ||
| python-version: ["3.9",] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v2.4.0 | ||
|
|
||
| - uses: conda-incubator/setup-miniconda@v2.1.1 | ||
| with: | ||
| python-version: "${{ matrix.python-version }}" | ||
| environment-file: .binder/environment.yml | ||
| activate-environment: test | ||
| auto-activate-base: false | ||
| mamba-version: "*" | ||
| miniforge-version: latest | ||
| miniforge-variant: Mambaforge | ||
| use-mamba: true | ||
| channel-priority: true | ||
|
|
||
| - name: Additional info about the build | ||
| run: | | ||
| uname -a | ||
| df -h | ||
| ulimit -a | ||
|
|
||
| - name: Environment Information | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. spaces or no spaces between steps?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added spaces! |
||
| run: | | ||
| conda info | ||
| conda list | ||
|
|
||
| - name: Run example notebooks | ||
| run: | | ||
| python -m pytest -v setup/ --nbval-lax -n auto --dist loadscope | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #./.github/workflows/binder-badge.yaml | ||
| name: Binder Badge | ||
| on: | ||
| pull_request_target: | ||
| types: [opened] | ||
|
|
||
| jobs: | ||
| binder: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| pull-requests: write | ||
| steps: | ||
| - name: comment on PR with Binder link | ||
| uses: actions/github-script@v3 | ||
| with: | ||
| github-token: ${{secrets.GITHUB_TOKEN}} | ||
| script: | | ||
| var PR_HEAD_USERREPO = process.env.PR_HEAD_USERREPO; | ||
| var PR_HEAD_REF = process.env.PR_HEAD_REF; | ||
| github.issues.createComment({ | ||
| issue_number: context.issue.number, | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| body: `[](https://mybinder.org/v2/gh/${PR_HEAD_USERREPO}/${PR_HEAD_REF}) :point_left: Launch a binder notebook on branch _${PR_HEAD_USERREPO}/${PR_HEAD_REF}_` | ||
| }) | ||
| env: | ||
| PR_HEAD_REF: ${{ github.event.pull_request.head.ref }} | ||
| PR_HEAD_USERREPO: ${{ github.event.pull_request.head.repo.full_name }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: Build container image | ||
|
|
||
| on: [push] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
|
|
||
| - name: checkout files in repo | ||
| uses: actions/checkout@main | ||
|
|
||
| - name: update jupyter dependencies with repo2docker | ||
| uses: jupyterhub/repo2docker-action@master | ||
| with: # make sure username & password/token matches your registry | ||
| DOCKER_USERNAME: ${{ secrets.QUAY_USERNAME }} | ||
| DOCKER_PASSWORD: ${{ secrets.QUAY_PASSWORD }} | ||
| DOCKER_REGISTRY: "quay.io" | ||
| IMAGE_NAME: "mikemhenry/openfe-notebooks" | ||
| MYBINDERORG_CACHE: true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,230 @@ | ||
| # Files created by notebooks | ||
|
|
||
| *.gro | ||
| *.top | ||
|
|
||
| # Created by https://www.toptal.com/developers/gitignore/api/osx,python,jupyternotebooks,windows,linux | ||
| # Edit at https://www.toptal.com/developers/gitignore?templates=osx,python,jupyternotebooks,windows,linux | ||
|
|
||
| ### JupyterNotebooks ### | ||
| # gitignore template for Jupyter Notebooks | ||
| # website: http://jupyter.org/ | ||
|
|
||
| .ipynb_checkpoints | ||
| */.ipynb_checkpoints/* | ||
|
|
||
| # IPython | ||
| profile_default/ | ||
| ipython_config.py | ||
|
|
||
| # Remove previous ipynb_checkpoints | ||
| # git rm -r .ipynb_checkpoints/ | ||
|
|
||
| ### Linux ### | ||
| *~ | ||
|
|
||
| # temporary files which can be created if a process still has a handle open of a deleted file | ||
| .fuse_hidden* | ||
|
|
||
| # KDE directory preferences | ||
| .directory | ||
|
|
||
| # Linux trash folder which might appear on any partition or disk | ||
| .Trash-* | ||
|
|
||
| # .nfs files are created when an open file is removed but is still being accessed | ||
| .nfs* | ||
|
|
||
| ### OSX ### | ||
| # General | ||
| .DS_Store | ||
| .AppleDouble | ||
| .LSOverride | ||
|
|
||
| # Icon must end with two \r | ||
| Icon | ||
|
|
||
|
|
||
| # Thumbnails | ||
| ._* | ||
|
|
||
| # Files that might appear in the root of a volume | ||
| .DocumentRevisions-V100 | ||
| .fseventsd | ||
| .Spotlight-V100 | ||
| .TemporaryItems | ||
| .Trashes | ||
| .VolumeIcon.icns | ||
| .com.apple.timemachine.donotpresent | ||
|
|
||
| # Directories potentially created on remote AFP share | ||
| .AppleDB | ||
| .AppleDesktop | ||
| Network Trash Folder | ||
| Temporary Items | ||
| .apdisk | ||
|
|
||
| ### Python ### | ||
| # Byte-compiled / optimized / DLL files | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *$py.class | ||
|
|
||
| # C extensions | ||
| *.so | ||
|
|
||
| # Distribution / packaging | ||
| .Python | ||
| build/ | ||
| develop-eggs/ | ||
| dist/ | ||
| downloads/ | ||
| eggs/ | ||
| .eggs/ | ||
| lib/ | ||
| lib64/ | ||
| parts/ | ||
| sdist/ | ||
| var/ | ||
| wheels/ | ||
| share/python-wheels/ | ||
| *.egg-info/ | ||
| .installed.cfg | ||
| *.egg | ||
| MANIFEST | ||
|
|
||
| # PyInstaller | ||
| # Usually these files are written by a python script from a template | ||
| # before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
| *.manifest | ||
| *.spec | ||
|
|
||
| # Installer logs | ||
| pip-log.txt | ||
| pip-delete-this-directory.txt | ||
|
|
||
| # Unit test / coverage reports | ||
| htmlcov/ | ||
| .tox/ | ||
| .nox/ | ||
| .coverage | ||
| .coverage.* | ||
| .cache | ||
| nosetests.xml | ||
| coverage.xml | ||
| *.cover | ||
| *.py,cover | ||
| .hypothesis/ | ||
| .pytest_cache/ | ||
| cover/ | ||
|
|
||
| # Translations | ||
| *.mo | ||
| *.pot | ||
|
|
||
| # Django stuff: | ||
| *.log | ||
| local_settings.py | ||
| db.sqlite3 | ||
| db.sqlite3-journal | ||
|
|
||
| # Flask stuff: | ||
| instance/ | ||
| .webassets-cache | ||
|
|
||
| # Scrapy stuff: | ||
| .scrapy | ||
|
|
||
| # Sphinx documentation | ||
| docs/_build/ | ||
|
|
||
| # PyBuilder | ||
| .pybuilder/ | ||
| target/ | ||
|
|
||
| # Jupyter Notebook | ||
|
|
||
| # IPython | ||
|
|
||
| # pyenv | ||
| # For a library or package, you might want to ignore these files since the code is | ||
| # intended to run in multiple environments; otherwise, check them in: | ||
| # .python-version | ||
|
|
||
| # pipenv | ||
| # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. | ||
| # However, in case of collaboration, if having platform-specific dependencies or dependencies | ||
| # having no cross-platform support, pipenv may install dependencies that don't work, or not | ||
| # install all needed dependencies. | ||
| #Pipfile.lock | ||
|
|
||
| # PEP 582; used by e.g. github.com/David-OConnor/pyflow | ||
| __pypackages__/ | ||
|
|
||
| # Celery stuff | ||
| celerybeat-schedule | ||
| celerybeat.pid | ||
|
|
||
| # SageMath parsed files | ||
| *.sage.py | ||
|
|
||
| # Environments | ||
| .env | ||
| .venv | ||
| env/ | ||
| venv/ | ||
| ENV/ | ||
| env.bak/ | ||
| venv.bak/ | ||
|
|
||
| # Spyder project settings | ||
| .spyderproject | ||
| .spyproject | ||
|
|
||
| # Rope project settings | ||
| .ropeproject | ||
|
|
||
| # mkdocs documentation | ||
| /site | ||
|
|
||
| # mypy | ||
| .mypy_cache/ | ||
| .dmypy.json | ||
| dmypy.json | ||
|
|
||
| # Pyre type checker | ||
| .pyre/ | ||
|
|
||
| # pytype static type analyzer | ||
| .pytype/ | ||
|
|
||
| # Cython debug symbols | ||
| cython_debug/ | ||
|
|
||
| ### Windows ### | ||
| # Windows thumbnail cache files | ||
| Thumbs.db | ||
| Thumbs.db:encryptable | ||
| ehthumbs.db | ||
| ehthumbs_vista.db | ||
|
|
||
| # Dump file | ||
| *.stackdump | ||
|
|
||
| # Folder config file | ||
| [Dd]esktop.ini | ||
|
|
||
| # Recycle Bin used on file shares | ||
| $RECYCLE.BIN/ | ||
|
|
||
| # Windows Installer files | ||
| *.cab | ||
| *.msi | ||
| *.msix | ||
| *.msm | ||
| *.msp | ||
|
|
||
| # Windows shortcuts | ||
| *.lnk | ||
|
|
||
| # End of https://www.toptal.com/developers/gitignore/api/osx,python,jupyternotebooks,windows,linux |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # See https://pre-commit.com for more information | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if I'm coming too late with the unpopular opinion here 🙃 I'm not super fond of using autoformatters.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I really like them (
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We'll settle this argument elsewhere :) |
||
| # See https://pre-commit.com/hooks.html for more hooks | ||
| ci: | ||
| autoupdate_schedule: quarterly | ||
|
|
||
| files: (^notebooks) | ||
| repos: | ||
| - repo: https://github.com/psf/black | ||
| rev: 21.12b0 | ||
| hooks: | ||
| - id: black | ||
| - repo: https://github.com/psf/black | ||
| rev: 21.12b0 | ||
| hooks: | ||
| - id: black-jupyter | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| [](https://github.com/mikemhenry/openfe-notebooks/actions/workflows/CI.yml) | ||
| [](https://results.pre-commit.ci/latest/github/mikemhenry/openfe-notebooks/main) | ||
| [](https://mybinder.org/v2/gh/mikemhenry/openfe-notebooks/HEAD) | ||
|
|
||
| # OpenFE Notebooks | ||
|
|
||
| Collection of notebooks for the Open FreeEnergy project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea how @richardjgowers managed to create a repo with
masterby default 🤣There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha this was off the github setup, I thought they'd transitioned to main but apparently not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want me to change the branch name from master to main?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah no reason not to.