Skip to content

Commit 0512015

Browse files
authored
Merge pull request #63 from Tieqiong/cookierelease
cookie release
2 parents 2462d39 + 4e3f684 commit 0512015

File tree

120 files changed

+15725
-13322
lines changed

Some content is hidden

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

120 files changed

+15725
-13322
lines changed

Diff for: .codecov.yml

+34-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,34 @@
1-
fixes:
2-
- ".*/site-packages/::src/"
1+
# codecov can find this file anywhere in the repo, so we don't need to clutter
2+
# the root folder.
3+
#comment: false
4+
5+
codecov:
6+
notify:
7+
require_ci_to_pass: no
8+
9+
coverage:
10+
status:
11+
patch:
12+
default:
13+
target: '70'
14+
if_no_uploads: error
15+
if_not_found: success
16+
if_ci_failed: failure
17+
project:
18+
default: false
19+
library:
20+
target: auto
21+
if_no_uploads: error
22+
if_not_found: success
23+
if_ci_failed: error
24+
paths: '!*/tests/.*'
25+
26+
tests:
27+
target: 97.9%
28+
paths: '*/tests/.*'
29+
if_not_found: success
30+
31+
flags:
32+
tests:
33+
paths:
34+
- tests/

Diff for: .coveragerc

+11-23
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
1-
# Configuration of the coverage.py tool for reporting test coverage.
2-
3-
[report]
4-
# RE patterns for lines to be excluded from consideration.
5-
exclude_lines =
6-
## Have to re-enable the standard pragma
7-
pragma: no cover
8-
## Don't complain if tests don't hit defensive assertion code:
9-
raise AssertionError
10-
raise NotImplementedError
11-
^[ ]*assert False
12-
13-
## Don't complain if non-runnable code isn't run:
14-
^[ ]*@unittest.skip\b
15-
^[ ]{4}unittest.main()
16-
if __name__ == .__main__.:
17-
18-
191
[run]
2+
source =
3+
diffpy.structure
4+
[report]
205
omit =
21-
## Exclude from codecov report:
22-
*/tests/debug.py
23-
*/apps/*.py
24-
# TODO remove in version 3.1
25-
*/applications/*.py
6+
*/python?.?/*
7+
*/site-packages/nose/*
8+
# ignore _version.py and versioneer.py
9+
.*version.*
10+
*_version.py
11+
12+
exclude_lines =
13+
if __name__ == '__main__':

Diff for: .flake8

+11
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

Diff for: .gitarchive.cfg

-5
This file was deleted.

Diff for: .gitattributes

+1-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
/.gitattributes export-ignore
2-
/.gitignore export-ignore
3-
/.travis.yml export-ignore
4-
/conda-recipe/ export-ignore
5-
/devutils export-ignore
6-
/doc export-ignore
7-
.gitarchive.cfg export-subst
8-
*.bat text eol=crlf
1+
diffpy.structure/_version.py export-subst

Diff for: .github/workflows/docs.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
auto-update-conda: true
24+
25+
- name: install requirements
26+
run: >-
27+
conda install -n build -c conda-forge
28+
--file requirements/build.txt
29+
--file requirements/run.txt
30+
--file requirements/docs.txt
31+
--quiet --yes
32+
33+
- name: install the package
34+
run: python -m pip install . --no-deps
35+
36+
- name: build documents
37+
run: make -C doc html
38+
39+
- name: Deploy
40+
uses: peaceiris/actions-gh-pages@v3
41+
with:
42+
github_token: ${{ secrets.GITHUB_TOKEN }}
43+
publish_dir: ./doc/build/html

Diff for: .github/workflows/main.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- CI
8+
pull_request:
9+
workflow_dispatch:
10+
11+
jobs:
12+
miniconda:
13+
name: Miniconda ${{ matrix.os }}
14+
runs-on: ${{ matrix.os }}
15+
strategy:
16+
matrix:
17+
os: ["ubuntu-latest"]
18+
steps:
19+
- name: check out diffpy.structure
20+
uses: actions/checkout@v3
21+
with:
22+
repository: diffpy/diffpy.structure
23+
path: .
24+
fetch-depth: 0 # avoid shallow clone with no tags
25+
26+
- name: initialize miniconda
27+
# this uses a marketplace action that sets up miniconda in a way that makes
28+
# it easier to use. I tried setting it up without this and it was a pain
29+
uses: conda-incubator/setup-miniconda@v2
30+
with:
31+
activate-environment: test
32+
# environment.yml file is needed by this action. Because I don't want
33+
# maintain this but rather maintain the requirements files it just has
34+
# basic things in it like conda and pip
35+
environment-file: ./environment.yml
36+
python-version: 3
37+
auto-activate-base: false
38+
39+
- name: install diffpy.structure requirements
40+
shell: bash -l {0}
41+
run: |
42+
conda config --set always_yes yes --set changeps1 no
43+
conda config --add channels conda-forge
44+
conda activate test
45+
conda install --file requirements/run.txt
46+
conda install --file requirements/test.txt
47+
pip install .
48+
- name: Validate diffpy.structure
49+
shell: bash -l {0}
50+
run: |
51+
conda activate test
52+
coverage run -m pytest -vv -s
53+
coverage report -m
54+
codecov

Diff for: .github/workflows/pre-commit.yml

+19
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

Diff for: .gitignore

+69-17
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,95 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
13
*.py[cod]
4+
*$py.class
25

36
# C extensions
47
*.so
58

6-
# Packages
7-
*.egg
8-
*.egg-info
9-
dist
10-
build
11-
eggs
12-
parts
13-
bin
14-
var
15-
sdist
16-
temp
17-
develop-eggs
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
venv/
24+
*.egg-info/
1825
.installed.cfg
19-
lib
20-
lib64
21-
tags
26+
*.egg
27+
bin/
28+
temp/
29+
tags/
2230
errors.err
2331

32+
# PyInstaller
33+
# Usually these files are written by a python script from a template
34+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
35+
*.manifest
36+
*.spec
37+
2438
# Installer logs
2539
pip-log.txt
40+
pip-delete-this-directory.txt
2641
MANIFEST
2742

2843
# Unit test / coverage reports
44+
htmlcov/
45+
.tox/
2946
.coverage
30-
.tox
47+
.coverage.*
48+
.cache
3149
nosetests.xml
50+
coverage.xml
51+
*,cover
52+
.hypothesis/
3253

3354
# Translations
3455
*.mo
56+
*.pot
3557

3658
# Mr Developer
3759
.mr.developer.cfg
3860
.project
3961
.pydevproject
40-
.settings
62+
63+
# Django stuff:
64+
*.log
65+
66+
# Sphinx documentation
67+
docs/build/
68+
docs/source/generated/
69+
70+
# pytest
71+
.pytest_cache/
72+
73+
# PyBuilder
74+
target/
75+
76+
# Editor files
77+
# mac
78+
.DS_Store
79+
*~
80+
81+
# vim
82+
*.swp
83+
*.swo
84+
85+
# pycharm
86+
.idea/
87+
88+
# VSCode
89+
.vscode/
90+
91+
# Ipython Notebook
92+
.ipynb_checkpoints
4193

4294
# version information
4395
setup.cfg

Diff for: .isort.cfg

+4
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

Diff for: .pre-commit-config.yaml

+43
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]

Diff for: .readthedocs.yml

-9
This file was deleted.

0 commit comments

Comments
 (0)