Skip to content

Commit

Permalink
Pull trunk main
Browse files Browse the repository at this point in the history
  • Loading branch information
VicTrqt committed Sep 15, 2023
2 parents 7208438 + ecf80af commit ba420ba
Show file tree
Hide file tree
Showing 514 changed files with 36,811 additions and 5,933 deletions.
22 changes: 9 additions & 13 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ Include a summary of major changes in bullet points:
* List all new dependencies needed and justify why. While adding dependencies that bring
significantly useful functionality is perfectly fine, adding ones that add trivial
functionality, e.g., to use one single easily implementable function, is frowned upon.
Provide a justification why that dependency is needed. Especially frowned upon are
circular dependencies.
Justify why that dependency is needed. Especially frowned upon are circular dependencies.

## TODO (if any)

Expand All @@ -26,20 +25,17 @@ title.

Before a pull request can be merged, the following items must be checked:

- [ ] Code is in the [standard Python style](https://www.python.org/dev/peps/pep-0008/).
* [ ] Code is in the [standard Python style](https://www.python.org/dev/peps/pep-0008/).
The easiest way to handle this is to run the following in the **correct sequence** on
your local machine. Start with running [black](
https://black.readthedocs.io/en/stable/index.html) on your new code. This will
your local machine. Start with running [black](https://black.readthedocs.io/en/stable/index.html) on your new code. This will
automatically reformat your code to PEP8 conventions and removes most issues. Then run
[pycodestyle](https://pycodestyle.readthedocs.io/en/latest/), followed by [flake8](
http://flake8.pycqa.org/en/latest/).
- [ ] Docstrings have been added in the[Numpy docstring format](
https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html).
Run [pydocstyle](http://www.pydocstyle.org/en/2.1.1/index.html) on your code.
- [ ] Type annotations are **highly** encouraged. Run [mypy](http://mypy-lang.org/) to
[ruff](https://ruff.rs).
* [ ] Docstrings have been added in the [Numpy docstring format](https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html).
Run [ruff](https://beta.ruff.rs/docs/rules/#pydocstyle-d) on your code.
* [ ] Type annotations are **highly** encouraged. Run [mypy](http://mypy-lang.org) to
type check your code.
- [ ] Tests have been added for any new functionality or bug fixes.
- [ ] All linting and tests pass.
* [ ] Tests have been added for any new functionality or bug fixes.
* [ ] All linting and tests pass.

Note that the CI system will run all the above checks. But it will be much more
efficient if you already fix most errors prior to submitting the PR. It is highly
Expand Down
22 changes: 22 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
changelog:
exclude:
authors: [ dependabot, github-actions ]
categories:
- title: New Features 🎉
labels:
- feature
- title: Bug Fixes 🐛
labels:
- fix
- title: Enhancements 🛠
labels:
- enhancement
- title: Documentation 📖
labels:
- documentation
- title: House-Keeping 🧹
labels:
- house-keeping
- title: Other Changes
labels:
- "*"
12 changes: 7 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ jobs:
deploy-docs:

# only run if commit is a push to master and the testing finished
# if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && ( github.event.workflow_run.head_branch == 'main' || startsWith(github.event.workflow_run.head_branch, 'v') )
if: github.repository_owner == 'materialsproject' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && startsWith(github.event.workflow_run.head_branch, 'v0.')
if: ${{ github.repository_owner == 'materialsproject' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && startsWith(github.event.workflow_run.head_branch, 'v0.') }}
runs-on: ubuntu-latest

steps:
Expand All @@ -34,13 +33,13 @@ jobs:
pip install .[strict,docs]
- name: Build
run: jupyter-book build docs --path-output docs_build
run: sphinx-build docs docs_build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
publish_dir: ./docs_build/_build/html
publish_dir: ./docs_build/

deploy-pypi:

Expand Down Expand Up @@ -80,7 +79,10 @@ jobs:
ref: ${{ github.event.workflow_run.head_branch }}

- name: Write release info
run: awk 'BEGIN {p = 0} {a = 0 }; /^v\d*.\d*.\d*./ { p += 1; a = 1}; p + a == 1 { print } ' CHANGELOG.md | sed -e '1,1d' | sed -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}' > release_info.txt
run: |
awk 'BEGIN {p = 0} {a = 0 }; /^v\d*.\d*.\d*./ { p += 1; a = 1}; p + a == 1 { print } ' CHANGELOG.md | sed -e '1,1d' | sed -e '/./,$!d' -e :a -e '/^\n*$/{$d;N;ba' -e '}' > release_info.txt
echo "" >> release_info.txt
awk '/CONTRIBUTOR SECTION/{f=1; c=0} f' CHANGELOG.md >> release_info.txt
- name: Release
uses: actions/create-release@v1
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/deps.yml

This file was deleted.

55 changes: 55 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: build-docs

on:
workflow_dispatch:
push:
branches: [main]

# set GITHUB_TOKEN permissions to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

jobs:
build-docs:
if: github.repository_owner == 'materialsproject' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.workflow_run.head_branch }}

- name: Install pandoc
run: sudo apt-get install pandoc

- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: pip
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[strict,docs]
- name: Build
run: sphinx-build docs docs_build

- name: Upload build artifact
uses: actions/upload-pages-artifact@v2
with:
path: ./docs_build

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build-docs
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
38 changes: 0 additions & 38 deletions .github/workflows/docs_manual.yml

This file was deleted.

33 changes: 19 additions & 14 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,24 @@ name: testing

on:
push:

branches: [main]
tags: ['v*']
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: "3.8"
cache: pip
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[strict,tests,dev]
- name: Lint
run: pre-commit run --all-files --show-diff-on-failure
- uses: pre-commit/[email protected]

test:
services:
Expand All @@ -37,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ["3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v3
Expand All @@ -51,7 +45,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[strict,tests,docs]
pip install .[strict,tests]
- name: Test
env:
Expand All @@ -72,7 +66,7 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: "3.10"
cache: pip
cache-dependency-path: pyproject.toml

Expand All @@ -82,4 +76,15 @@ jobs:
pip install .[strict,docs]
- name: Build
run: jupyter-book build docs --path-output docs_build
run: sphinx-build docs docs_build

automerge:
needs: [lint, test, docs]
runs-on: ubuntu-latest

permissions:
pull-requests: write
contents: write

steps:
- uses: fastify/github-action-merge-dependabot@v3
10 changes: 8 additions & 2 deletions .github/workflows/update-precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ name: pre-commit-auto-update
on:
schedule:
- cron: '0 0 1,14,28 * *'
workflow_dispatch:

jobs:
auto-update:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

Expand All @@ -21,10 +23,14 @@ jobs:
- name: Run pre-commit autoupdate
run: pre-commit autoupdate

- name: Run pre-commit
run: pre-commit run --all || true

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
uses: peter-evans/create-pull-request@v5
with:
branch: update/pre-commit-autoupdate
token: ${{ secrets.GITHUB_TOKEN }}
branch: update/pre-commit-hooks
title: Auto-update pre-commit hooks
commit-message: Auto-update pre-commit hooks
body: Update versions of tools in pre-commit config to latest versions.
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,6 @@ docs/reference/atomate2.*
.vscode/

.DS_Store

# see https://github.com/materialsproject/atomate2/issues/345
*.doctrees*
Loading

0 comments on commit ba420ba

Please sign in to comment.