-
Notifications
You must be signed in to change notification settings - Fork 1
skpkg: setup CI after migrating tests, src, requirements, and .github folder #20
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
9ab18c2
2ca745d
ff68e62
fbbbd6a
3af03da
b08062a
ba7f3de
744e0a3
62a0774
b1ac8e0
d7373d7
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,14 @@ | ||
| coverage: | ||
| status: | ||
| project: # more options at https://docs.codecov.com/docs/commit-status | ||
| default: | ||
| target: auto # use the coverage from the base commit, fail if coverage is lower | ||
| threshold: 0% # allow the coverage to drop by | ||
|
|
||
| comment: | ||
| layout: " diff, flags, files" | ||
| behavior: default | ||
| require_changes: false | ||
| require_base: false # [true :: must have a base report to post] | ||
| require_head: false # [true :: must have a head report to post] | ||
| hide_project_coverage: false # [true :: only show coverage on the git diff aka patch coverage] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| ;; Please include filenames and explanations for each ignored line. | ||
| ;; See https://docs.openverse.org/meta/codespell.html for docs. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| ;; Please include explanations for each ignored word (lowercase). | ||
| ;; See https://docs.openverse.org/meta/codespell.html for docs. | ||
|
|
||
| ;; abbreviation for "materials" often used in a journal title | ||
| mater | ||
|
|
||
| ;; Frobenius norm used in np.linalg.norm | ||
| fro |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # As of now, flake8 does not natively support configuration via pyproject.toml | ||
| # https://github.com/microsoft/vscode-flake8/issues/135 | ||
| [flake8] | ||
| exclude = | ||
| .git, | ||
| __pycache__, | ||
| build, | ||
| dist, | ||
| docs/source/conf.py | ||
| max-line-length = 79 | ||
| # Ignore some style 'errors' produced while formatting by 'black' | ||
| # https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#labels-why-pycodestyle-warnings | ||
| extend-ignore = E203 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| --- | ||
| name: Bug Report or Feature Request | ||
| about: Report a bug or suggest a new feature! | ||
| title: "" | ||
| labels: "" | ||
| assignees: "" | ||
| --- | ||
|
|
||
| ### Problem | ||
|
|
||
| <!-- | ||
| For a bug report, please copy and paste any error messages from the application or command-line here. | ||
| For a feature request, please state how the new functionality could benefit the community. | ||
| --> | ||
|
|
||
| ### Proposed solution |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| --- | ||
| name: Release | ||
| about: Checklist and communication channel for PyPI and GitHub release | ||
| title: "Ready for <version-number> PyPI/GitHub release" | ||
| labels: "release" | ||
| assignees: "" | ||
| --- | ||
|
|
||
| ### PyPI/GitHub rc-release preparation checklist: | ||
|
|
||
| - [ ] All PRs/issues attached to the release are merged. | ||
| - [ ] All the badges on the README are passing. | ||
| - [ ] License information is verified as correct. If you are unsure, please comment below. | ||
| - [ ] Locally rendered documentation contains all appropriate pages, including API references (check no modules are | ||
| missing), tutorials, and other human-written text is up-to-date with any changes in the code. | ||
| - [ ] Installation instructions in the README, documentation, and the website are updated. | ||
| - [ ] Successfully run any tutorial examples or do functional testing with the latest Python version. | ||
| - [ ] Grammar and writing quality are checked (no typos). | ||
| - [ ] Install `pip install build twine`, run `python -m build` and `twine check dist/*` to ensure that the package can be built and is correctly formatted for PyPI release. | ||
|
|
||
| Please tag the maintainer (e.g., @username) in the comment here when you are ready for the PyPI/GitHub release. Include any additional comments necessary, such as version information and details about the pre-release here: | ||
|
|
||
| ### PyPI/GitHub full-release preparation checklist: | ||
|
|
||
| - [ ] Create a new conda environment and install the rc from PyPI (`pip install <package-name>==??`) | ||
| - [ ] License information on PyPI is correct. | ||
| - [ ] Docs are deployed successfully to `https://<github-username-or-orgname>/<package-name>`. | ||
| - [ ] Successfully run all tests, tutorial examples or do functional testing. | ||
|
|
||
| Please let the maintainer know that all checks are done and the package is ready for full release. | ||
|
|
||
| ### conda-forge release preparation checklist: | ||
|
|
||
| <!-- After the maintainer releases the PyPI package, please check the following when creating a PR for conda-forge release.--> | ||
|
|
||
| - [ ] Ensure that the full release has appeared on PyPI successfully. | ||
| - [ ] New package dependencies listed in `conda.txt` and `tests.txt` are added to `meta.yaml` in the feedstock. | ||
| - [ ] Close any open issues on the feedstock. Reach out to the maintainer if you have questions. | ||
| - [ ] Tag the maintainer for conda-forge release. | ||
|
|
||
| ### Post-release checklist | ||
|
|
||
| <!-- Before closing this issue, please complete the following: --> | ||
|
|
||
| - [ ] Run tutorial examples and conduct functional testing using the installation guide in the README. Attach screenshots/results as comments. | ||
| - [ ] Documentation (README, tutorials, API references, and websites) is deployed without broken links or missing figures. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| ### What problem does this PR address? | ||
|
|
||
| <!-- Provide a brief overview and link to the issue. Attach outputs, including screenshots (before/after), if helpful for the reviewer. --> | ||
|
|
||
| ### What should the reviewer(s) do? | ||
|
|
||
| <!-- Merge the code, provide feedback, initiate a discussion, etc. --> | ||
|
|
||
| <!-- | ||
| Use the following checklist items when applicable (select only what applies): | ||
| - [ ] This PR introduces a public-facing change (e.g., figures, CLI input/output, API). | ||
| - [ ] Documentation (e.g., tutorials, examples, README) has been updated. | ||
| - [ ] A tracking issue or plan to update documentation exists. | ||
| - [ ] This PR affects internal functionality only (no user-facing change). | ||
| --> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| name: Release (GitHub/PyPI) and Deploy Docs | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| push: | ||
| tags: | ||
| - "*" # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml | ||
|
|
||
| jobs: | ||
| build-release: | ||
| uses: scikit-package/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0 | ||
| with: | ||
| project: diffpy.srxplanargui | ||
| c_extension: false | ||
| maintainer_GITHUB_username: sbillinge | ||
| secrets: | ||
| PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
| PAT_TOKEN: ${{ secrets.PAT_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| name: Check for News | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| check-news-item: | ||
| uses: scikit-package/release-scripts/.github/workflows/_check-news-item.yml@v0 | ||
| with: | ||
| project: diffpy.srxplanargui |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| name: CI | ||
|
Collaborator
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. Same for this file |
||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| release: | ||
| types: | ||
| - prereleased | ||
| - published | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| matrix-coverage: | ||
| uses: scikit-package/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0 | ||
| with: | ||
| project: diffpy.srxplanargui | ||
| c_extension: false | ||
| headless: false | ||
| secrets: | ||
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| name: Deploy Documentation on Release | ||
|
Collaborator
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. Same for this |
||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| docs: | ||
| uses: scikit-package/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0 | ||
| with: | ||
| project: diffpy.srxplanargui | ||
| c_extension: false | ||
| headless: false | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| name: Tests on PR | ||
|
|
||
| on: | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| tests-on-pr: | ||
| uses: scikit-package/release-scripts/.github/workflows/_tests-on-pr-no-codecov.yml@v0 | ||
| with: | ||
| project: diffpy.srxplanargui | ||
| c_extension: false | ||
| headless: false | ||
| run: | | ||
| conda install pre-commit | ||
| pre-commit run --all-files |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,44 +1,93 @@ | ||
| # Byte-compiled / optimized / DLL files | ||
| __pycache__/ | ||
| *.py[cod] | ||
| *$py.class | ||
|
|
||
| # C extensions | ||
| *.so | ||
|
|
||
| # Packages | ||
| *.egg | ||
| *.egg-info | ||
| dist | ||
| build | ||
| eggs | ||
| parts | ||
| bin | ||
| var | ||
| sdist | ||
| temp | ||
| develop-eggs | ||
| # Distribution / packaging | ||
| .Python | ||
| env/ | ||
| build/ | ||
| _build/ | ||
| develop-eggs/ | ||
| dist/ | ||
| downloads/ | ||
| eggs/ | ||
| .eggs/ | ||
| lib/ | ||
| lib64/ | ||
| parts/ | ||
| sdist/ | ||
| var/ | ||
| venv/ | ||
| *.egg-info/ | ||
| .installed.cfg | ||
| lib | ||
| lib64 | ||
| tags | ||
| *.egg | ||
| bin/ | ||
| temp/ | ||
| tags/ | ||
| errors.err | ||
|
|
||
| # 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 | ||
| MANIFEST | ||
|
|
||
| # Unit test / coverage reports | ||
| htmlcov/ | ||
| .tox/ | ||
| .coverage | ||
| .tox | ||
| .coverage.* | ||
| .cache | ||
| nosetests.xml | ||
| coverage.xml | ||
| *,cover | ||
| .hypothesis/ | ||
|
|
||
| # Translations | ||
| *.mo | ||
| *.pot | ||
|
|
||
| # Mr Developer | ||
| .mr.developer.cfg | ||
| .project | ||
| .pydevproject | ||
| .settings | ||
|
|
||
| # version information | ||
| setup.cfg | ||
| /dpx/srxplanargui/version.cfg | ||
| # Django stuff: | ||
| *.log | ||
|
|
||
| # Sphinx documentation | ||
| docs/build/ | ||
| docs/source/generated/ | ||
|
|
||
| # pytest | ||
| .pytest_cache/ | ||
|
|
||
| # PyBuilder | ||
| target/ | ||
|
|
||
| # Editor files | ||
| # mac | ||
| .DS_Store | ||
| *~ | ||
|
|
||
| # vim | ||
| *.swp | ||
| *.swo | ||
|
|
||
| # pycharm | ||
| .idea/ | ||
|
|
||
| # VSCode | ||
| .vscode/ | ||
|
|
||
| # Ipython Notebook | ||
| .ipynb_checkpoints |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| [settings] | ||
| # Keep import statement below line_length character limit | ||
| line_length = 79 | ||
| multi_line_output = 3 | ||
| include_trailing_comma = True | ||
| profile=black | ||
| skip=src/diffpy/srxplanargui/live.py,src/diffpy/srxplanargui/selectfiles.py,src/diffpy/srxplanargui/imageplot.py | ||
|
Collaborator
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. Does this mean that you need the skip to avoid the auto fix conflicts?
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 have retest this on a clean branch and found that now we do not need to skip these files. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| default_language_version: | ||
| python: python3 | ||
| ci: | ||
| autofix_commit_msg: | | ||
| [pre-commit.ci] auto fixes from pre-commit hooks | ||
| autofix_prs: true | ||
| autoupdate_branch: "pre-commit-autoupdate" | ||
| autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate" | ||
| autoupdate_schedule: monthly | ||
| skip: [no-commit-to-branch] | ||
| submodules: false | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v4.6.0 | ||
| hooks: | ||
| - id: check-yaml | ||
| - id: end-of-file-fixer | ||
| - id: trailing-whitespace | ||
| - id: check-case-conflict | ||
| - id: check-merge-conflict | ||
| - id: check-toml | ||
| - id: check-added-large-files | ||
| - repo: https://github.com/psf/black | ||
| rev: 24.4.2 | ||
| hooks: | ||
| - id: black | ||
| - repo: https://github.com/pycqa/flake8 | ||
| rev: 7.0.0 | ||
| hooks: | ||
| - id: flake8 | ||
| - repo: https://github.com/pycqa/isort | ||
| rev: 5.13.2 | ||
| hooks: | ||
| - id: isort | ||
| args: ["--profile", "black"] | ||
| - repo: https://github.com/kynan/nbstripout | ||
| rev: 0.7.1 | ||
| hooks: | ||
| - id: nbstripout | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v4.4.0 | ||
| hooks: | ||
| - id: no-commit-to-branch | ||
| name: Prevent Commit to Main Branch | ||
| args: ["--branch", "main"] | ||
| stages: [pre-commit] | ||
| - repo: https://github.com/codespell-project/codespell | ||
| rev: v2.3.0 | ||
| hooks: | ||
| - id: codespell | ||
| additional_dependencies: | ||
| - tomli | ||
| # prettier - multi formatter for .json, .yml, and .md files | ||
| - repo: https://github.com/pre-commit/mirrors-prettier | ||
| rev: f12edd9c7be1c20cfa42420fd0e6df71e42b51ea # frozen: v4.0.0-alpha.8 | ||
| hooks: | ||
| - id: prettier | ||
| additional_dependencies: | ||
| - "prettier@^3.2.4" | ||
| # docformatter - PEP 257 compliant docstring formatter | ||
| - repo: https://github.com/s-weigand/docformatter | ||
| rev: 5757c5190d95e5449f102ace83df92e7d3b06c6c | ||
| hooks: | ||
| - id: docformatter | ||
| additional_dependencies: [tomli] | ||
| args: [--in-place, --config, ./pyproject.toml] |
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.
This file will change because I don't think we're releasing this package to PyPI, etc. I suggest we work on this in another PR.