-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #51 from legend-exp/dev
Update packaging tools
- Loading branch information
Showing
24 changed files
with
334 additions
and
281 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,42 +2,47 @@ name: distribute | |
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
push: | ||
tags: "v*" | ||
branches: | ||
- main | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
FORCE_COLOR: 3 | ||
|
||
jobs: | ||
dist: | ||
name: Distribution build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build SDist and wheel | ||
run: pipx run build | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
path: dist/* | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check metadata | ||
run: pipx run twine check dist/* | ||
- uses: hynek/build-and-inspect-python-package@v2 | ||
|
||
publish: | ||
needs: [dist] | ||
name: Publish to PyPI | ||
environment: pypi | ||
permissions: | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
|
||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact | ||
path: dist | ||
|
||
- uses: pypa/[email protected] | ||
with: | ||
password: ${{ secrets.pypi_password }} | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: Packages | ||
path: dist | ||
|
||
- uses: pypa/gh-action-pypi-publish@release/v1 | ||
if: github.event_name == 'release' && github.event.action == 'published' |
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 |
---|---|---|
@@ -1,108 +1,88 @@ | ||
ci: | ||
autoupdate_commit_msg: "chore: update pre-commit hooks" | ||
autoupdate_schedule: "monthly" | ||
autoupdate_schedule: "quarterly" | ||
autofix_commit_msg: "style: pre-commit fixes" | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: "v4.5.0" | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-case-conflict | ||
- id: check-executables-have-shebangs | ||
- id: check-merge-conflict | ||
- id: check-symlinks | ||
- id: check-yaml | ||
- id: check-json | ||
- id: check-toml | ||
- id: check-docstring-first | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: forbid-new-submodules | ||
- id: mixed-line-ending | ||
- id: requirements-txt-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/adamchainz/blacken-docs | ||
rev: "1.16.0" | ||
hooks: | ||
- id: blacken-docs | ||
additional_dependencies: [black==23.*] | ||
|
||
- repo: https://github.com/asottile/setup-cfg-fmt | ||
rev: "v2.5.0" | ||
hooks: | ||
- id: setup-cfg-fmt | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: "v4.5.0" | ||
hooks: | ||
- id: check-added-large-files | ||
- id: check-case-conflict | ||
- id: check-merge-conflict | ||
- id: check-symlinks | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: end-of-file-fixer | ||
- id: forbid-new-submodules | ||
- id: mixed-line-ending | ||
- id: name-tests-test | ||
args: ["--pytest-test-first"] | ||
- id: requirements-txt-fixer | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/PyCQA/isort | ||
rev: "5.13.2" | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/pre-commit/pygrep-hooks | ||
rev: "v1.10.0" | ||
hooks: | ||
- id: rst-backticks | ||
- id: rst-directive-colons | ||
- id: rst-inline-touching-normal | ||
|
||
- repo: https://github.com/asottile/pyupgrade | ||
rev: "v3.15.0" | ||
hooks: | ||
- id: pyupgrade | ||
args: ["--py36-plus"] | ||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: "v4.0.0-alpha.8" | ||
hooks: | ||
- id: prettier | ||
types_or: [yaml, markdown, json] | ||
args: [--prose-wrap=always] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: "24.1.1" | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: "v0.2.1" | ||
hooks: | ||
- id: ruff | ||
args: ["--fix", "--show-fixes"] | ||
- id: ruff-format | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: "v1.8.0" | ||
hooks: | ||
- id: mypy | ||
files: src | ||
stages: [manual] | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: "v1.8.0" | ||
hooks: | ||
- id: mypy | ||
files: src|tests | ||
stages: [manual] | ||
additional_dependencies: | ||
- pytest | ||
|
||
- repo: https://github.com/hadialqattan/pycln | ||
rev: "v2.4.0" | ||
hooks: | ||
- id: pycln | ||
args: ["--all"] | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: "v2.2.6" | ||
hooks: | ||
- id: codespell | ||
|
||
- repo: https://github.com/PyCQA/flake8 | ||
rev: "7.0.0" | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: [ | ||
flake8-bugbear, | ||
flake8-print, | ||
flake8-docstrings, | ||
pep8-naming | ||
] | ||
args: ["--docstring-convention", "numpy"] # or google, change me | ||
- repo: https://github.com/shellcheck-py/shellcheck-py | ||
rev: "v0.9.0.6" | ||
hooks: | ||
- id: shellcheck | ||
|
||
- repo: https://github.com/kynan/nbstripout | ||
rev: "0.7.1" | ||
hooks: | ||
- id: nbstripout | ||
args: ["--strip-empty-cells", | ||
"--extra-keys", "metadata.kernelspec metadata.language_info"] | ||
- repo: local | ||
hooks: | ||
- id: disallow-caps | ||
name: Disallow improper capitalization | ||
language: pygrep | ||
entry: PyBind|Numpy|Cmake|CCache|Github|PyTest | ||
exclude: .pre-commit-config.yaml | ||
|
||
- repo: https://github.com/mgedmin/check-manifest | ||
rev: "0.49" | ||
hooks: | ||
- id: check-manifest | ||
stages: [manual] | ||
- repo: https://github.com/abravalheri/validate-pyproject | ||
rev: v0.16 | ||
hooks: | ||
- id: validate-pyproject | ||
|
||
- repo: https://github.com/codespell-project/codespell | ||
rev: "v2.2.6" | ||
hooks: | ||
- id: codespell | ||
args: ["-L", "nd,unparseable,compiletime,tre"] | ||
|
||
- repo: https://github.com/shellcheck-py/shellcheck-py | ||
rev: "v0.9.0.6" | ||
hooks: | ||
- id: shellcheck | ||
|
||
- repo: https://github.com/pre-commit/pygrep-hooks | ||
rev: "v1.10.0" | ||
hooks: | ||
- id: python-no-log-warn | ||
- id: rst-backticks | ||
- id: rst-directive-colons | ||
- id: rst-inline-touching-normal | ||
|
||
- repo: https://github.com/pre-commit/mirrors-prettier | ||
rev: "v4.0.0-alpha.8" | ||
hooks: | ||
- id: prettier | ||
types_or: [json] | ||
- repo: https://github.com/python-jsonschema/check-jsonschema | ||
rev: 0.28.0 | ||
hooks: | ||
- id: check-dependabot | ||
- id: check-github-workflows | ||
- id: check-readthedocs |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ coverage: | |
patch: false | ||
|
||
github_checks: | ||
annotations: false | ||
annotations: false | ||
|
||
ignore: | ||
- tests | ||
|
Oops, something went wrong.