Skip to content

Commit 546a7b1

Browse files
authored
Merge pull request #73 from diffpy/cookie
Cookie
2 parents 3256040 + 14b27e9 commit 546a7b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2173
-1041
lines changed

.coveragerc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[run]
2-
source =
3-
diffpy/snmf/
2+
source =
3+
src
44
[report]
55
omit =
66
*/python?.?/*

.flake8

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[flake8]
2+
exclude =
3+
.git,
4+
__pycache__,
5+
build,
6+
dist,
7+
doc/source/conf.py
8+
max-line-length = 115
9+
# Ignore some style 'errors' produced while formatting by 'black'
10+
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#labels-why-pycodestyle-warnings
11+
extend-ignore = E203

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
diffpy.snmf/_version.py export-subst

.github/workflows/docs.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Build Documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
release:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
defaults:
13+
run:
14+
shell: bash -l {0}
15+
steps:
16+
- uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
20+
- uses: conda-incubator/setup-miniconda@v2
21+
with:
22+
activate-environment: build
23+
environment-file: ./environment.yml
24+
python-version: 3
25+
auto-update-conda: true
26+
27+
- name: install requirements
28+
run: |
29+
conda config --set always_yes yes --set changeps1 no
30+
conda config --add channels conda-forge
31+
conda create -n build python=3.12
32+
conda activate build
33+
conda install --file requirements/build.txt
34+
conda install --file requirements/run.txt
35+
conda install --file requirements/test.txt
36+
conda install --file requirements/docs.txt
37+
python -m pip install . --no-deps
38+
39+
- name: build documents
40+
run: make -C doc html
41+
42+
- name: Run tests and upload coverage
43+
shell: bash -l {0}
44+
run: |
45+
conda activate build
46+
coverage run -m pytest -vv -s
47+
coverage report -m
48+
codecov
49+
50+
- name: Upload coverage to Codecov
51+
uses: codecov/codecov-action@v4
52+
env:
53+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
54+
55+
- name: Deploy
56+
uses: peaceiris/actions-gh-pages@v4
57+
with:
58+
github_token: ${{ secrets.GITHUB_TOKEN }}
59+
publish_dir: ./doc/build/html

.github/workflows/documentation.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- CI
78
pull_request:
89
workflow_dispatch:
910

@@ -19,9 +20,8 @@ jobs:
1920
uses: actions/checkout@v3
2021
with:
2122
repository: diffpy/diffpy.snmf
22-
# for bookkeeping have diffpy.snmf at the same level as everything else in the
23-
# directory tree
2423
path: .
24+
fetch-depth: 0 # avoid shallow clone with no tags
2525

2626
- name: initialize miniconda
2727
# this uses a marketplace action that sets up miniconda in a way that makes
@@ -50,10 +50,6 @@ jobs:
5050
shell: bash -l {0}
5151
run: |
5252
conda activate test
53-
coverage run run_tests.py
53+
coverage run -m pytest -vv -s
5454
coverage report -m
55-
56-
- name: Upload coverage reports to Codecov
57-
uses: codecov/codecov-action@v3
58-
# with:
59-
# token: ${{ secrets.CODECOV_TOKEN }}
55+
codecov

.github/workflows/pre-commit.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
workflow_dispatch:
7+
8+
jobs:
9+
pre-commit:
10+
# pull requests are a duplicate of a branch push if within the same repo.
11+
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
12+
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-python@v4
17+
- uses: pre-commit/[email protected]
18+
with:
19+
extra_args: --all-files

.isort.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[settings]
2+
line_length = 115
3+
multi_line_output = 3
4+
include_trailing_comma = True

.pre-commit-config.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
default_language_version:
2+
python: python3
3+
ci:
4+
autofix_commit_msg: |
5+
[pre-commit.ci] auto fixes from pre-commit hooks
6+
autofix_prs: true
7+
autoupdate_branch: 'pre-commit-autoupdate'
8+
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
9+
autoupdate_schedule: monthly
10+
skip: [no-commit-to-branch]
11+
submodules: false
12+
repos:
13+
- repo: https://github.com/pre-commit/pre-commit-hooks
14+
rev: v4.6.0
15+
hooks:
16+
- id: check-yaml
17+
- id: end-of-file-fixer
18+
- id: trailing-whitespace
19+
exclude: '\.(rst|txt)$'
20+
- repo: https://github.com/psf/black
21+
rev: 24.4.2
22+
hooks:
23+
- id: black
24+
- repo: https://github.com/pycqa/flake8
25+
rev: 7.0.0
26+
hooks:
27+
- id: flake8
28+
- repo: https://github.com/pycqa/isort
29+
rev: 5.13.2
30+
hooks:
31+
- id: isort
32+
args: ["--profile", "black"]
33+
- repo: https://github.com/kynan/nbstripout
34+
rev: 0.7.1
35+
hooks:
36+
- id: nbstripout
37+
- repo: https://github.com/pre-commit/pre-commit-hooks
38+
rev: v4.4.0
39+
hooks:
40+
- id: no-commit-to-branch
41+
name: Prevent Commit to Main Branch
42+
args: ["--branch", "main"]
43+
stages: [pre-commit]

AUTHORS.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
Authors
2-
====================
2+
=======
33

4-
Ran Gu, Adeolu Ajayi, Qiang Du, Simon J.L. Billinge
4+
Billinge Group and community contibutors.
55

66
Contributors
77
------------
8-
For a full list of contributors, visit
8+
9+
For a list of contributors, visit
910
https://github.com/diffpy/diffpy.snmf/graphs/contributors

0 commit comments

Comments
 (0)