Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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]

# SCons compiles copies of the sources in build/coverage-<arch>/, map them back to src/
fixes:
- "build/coverage-x86_64/::src/"
2 changes: 2 additions & 0 deletions .codespell/ignore_lines.txt
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.
8 changes: 8 additions & 0 deletions .codespell/ignore_words.txt
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
13 changes: 13 additions & 0 deletions .flake8
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
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis* export-ignore
/conda-recipe/ export-ignore
/doc export-ignore
gitarchive.cfg export-subst
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_feature.md
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
47 changes: 47 additions & 0 deletions .github/ISSUE_TEMPLATE/release_checklist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
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, tutorials, and other human-written text is up-to-date with any changes in the code.
- [ ] All API references are included. To check this, run `conda install scikit-package` and then `package build api-doc`. Review any edits made by rerendering the docs locally.
- [ ] 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.
- [ ] Dispatch matrix testing to test the release on all Python versions and systems. If you do not have permission to run this workflow, tag the maintainer and say `@maintainer, please dispatch matrix testing workflow`.

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.
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/pull_request_template.md
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).
-->
18 changes: 18 additions & 0 deletions .github/workflows/build-and-publish-docs-on-dispatch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Build and Publish Docs on Dispatch

on:
workflow_dispatch:

jobs:
get-python-version:
uses: scikit-package/release-scripts/.github/workflows/_get-python-version-latest.yml@v0
with:
python_version: 0

docs:
uses: scikit-package/release-scripts/.github/workflows/_release-docs.yml@v0
with:
project: libdiffpy
c_extension: true
headless: false
python_version: ${{ fromJSON(needs.get-python-version.outputs.latest_python_version) }}
12 changes: 12 additions & 0 deletions .github/workflows/check-news-item.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Check for News

on:
pull_request_target:
branches:
- main # GitHub does not evaluate expressions in trigger filters; edit this value if your base branch is not main

jobs:
check-news-item:
uses: scikit-package/release-scripts/.github/workflows/_check-news-item.yml@v0
with:
project: libdiffpy
21 changes: 21 additions & 0 deletions .github/workflows/matrix-and-codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Matrix and Codecov

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: libdiffpy
c_extension: true
headless: false
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/release-github-on-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build Wheel and Release

# Trigger on tag push or manual dispatch.
# Tag and release privilege are verified inside the reusable workflow.
on:
workflow_dispatch:
push:
tags:
- "*"

jobs:
check-tag-privilege:
uses: scikit-package/release-scripts/.github/workflows/_check-tag-privilege.yml@v0
with:
maintainer_github_username: sbillinge

check-pat-token-validity:
uses: scikit-package/release-scripts/.github/workflows/_check-pat-token-validity.yml@v0
secrets:
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}

release-github:
needs: [check-tag-privilege, check-pat-token-validity]
uses: scikit-package/release-scripts/.github/workflows/_release-github.yml@v0
secrets:
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
70 changes: 70 additions & 0 deletions .github/workflows/tests-on-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Tests on PR

on:
pull_request:
workflow_dispatch:

jobs:
tests-on-pr:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

steps:
- name: Check out libdiffpy
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
channels: conda-forge
conda-remove-defaults: "true"
auto-update-conda: true
auto-activate-base: false

- name: Conda config
run: >-
conda config --set always_yes yes
--set changeps1 no

- name: Install requirements
run: >-
conda install
--file requirements/build.txt
--file requirements/conda.txt
--file requirements/tests.txt

- name: Configure SCons for the conda environment
run: |
cat > sconscript.local <<'EOF'
Import('env')
import os
prefix = os.environ['CONDA_PREFIX']
env.Replace(CXX=os.path.join(prefix, 'bin', 'c++'))
env.Prepend(CCFLAGS=['-isystem' + os.path.join(prefix, 'include')])
env.Append(LIBPATH=os.path.join(prefix, 'lib'))
env.Append(LINKFLAGS='-Wl,-rpath,' + os.path.join(prefix, 'lib'))
EOF

- name: Build and run C++ tests with coverage
run: |
"$CONDA_PREFIX/bin/c++" --version
scons build=coverage test

- name: Generate coverage report
run: >-
gcovr --gcov-executable "$CONDA_PREFIX/bin/gcov"
--root . --filter 'build/coverage-.*/diffpy/'
--xml coverage.xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
files: coverage.xml
verbose: true
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
Loading
Loading