Skip to content
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

Cookie #179

Merged
merged 27 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0dfef99
Merge pull request #122 from sbillinge/tests
sbillinge Jul 23, 2024
fd347e6
copy .github directory
cadenmyers13 Jul 24, 2024
8cdd4c7
nest inside .github
cadenmyers13 Jul 24, 2024
a42f581
update for pdfgui
cadenmyers13 Jul 25, 2024
d8e81a6
Merge pull request #129 from cadenmyers13/workflows
sbillinge Jul 25, 2024
6484176
test tests (#131)
sbillinge Jul 26, 2024
db8ce87
copyright fixes (#134)
cadenmyers13 Jul 26, 2024
fa1ac1c
Flake8v1 (#137)
cadenmyers13 Jul 31, 2024
c9ecd94
Flake8v2 (#138)
cadenmyers13 Jul 31, 2024
3d0643e
Flake8v4 (#140)
cadenmyers13 Jul 31, 2024
686390a
pre-commit errors in comments (#141)
sbillinge Jul 31, 2024
33091d1
wx12 and bonlengthdialog (#142)
sbillinge Jul 31, 2024
ffda1a2
news (#143)
sbillinge Jul 31, 2024
4b3f53f
cookiecutter: untracked files (#149)
cadenmyers13 Aug 2, 2024
d65d1ee
Files in doc directory (#157)
cadenmyers13 Aug 8, 2024
897f683
files (#158)
cadenmyers13 Aug 8, 2024
0652110
Replace Caden's PR (#160)
Tieqiong Aug 15, 2024
6d0d9e7
try workflow for testing (#161)
Tieqiong Aug 17, 2024
5a200f4
remove unused files (#166)
Tieqiong Aug 19, 2024
f78b4b9
update requirements/run.txt (#165)
Tieqiong Aug 20, 2024
ef29c6a
remove dependency tests (#169)
Tieqiong Aug 20, 2024
fccca8a
fix deprecation warning when test (#170)
Tieqiong Aug 20, 2024
9cfafba
rst file changes (#171)
Tieqiong Aug 20, 2024
1ae626d
remove epydoc (#173)
Tieqiong Aug 20, 2024
9696402
build doc (#174)
Tieqiong Aug 20, 2024
53a3720
Apply the new workflow (#168)
Tieqiong Aug 20, 2024
71fc558
Merge branch 'main' into cookie
sbillinge Aug 20, 2024
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
36 changes: 34 additions & 2 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,34 @@
fixes:
- ".*/site-packages/::src/"
# codecov can find this file anywhere in the repo, so we don't need to clutter
# the root folder.
#comment: false

codecov:
notify:
require_ci_to_pass: no

coverage:
status:
patch:
default:
target: '70'
if_no_uploads: error
if_not_found: success
if_ci_failed: failure
project:
default: false
library:
target: auto
if_no_uploads: error
if_not_found: success
if_ci_failed: error
paths: '!*/tests/.*'

tests:
target: 97.9%
paths: '*/tests/.*'
if_not_found: success

flags:
tests:
paths:
- tests/
31 changes: 11 additions & 20 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
# Configuration of the coverage.py tool for reporting test coverage.

[report]
# RE patterns for lines to be excluded from consideration.
exclude_lines =
## Have to re-enable the standard pragma
pragma: no cover
## Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError
^[ ]*assert False

## Don't complain if non-runnable code isn't run:
^[ ]*@unittest.skip\b
^[ ]{4}unittest.main()
if __name__ == .__main__.:


[run]
source =
diffpy.pdfgui
[report]
omit =
## exclude debug.py from codecov report
*/tests/debug.py
*/python?.?/*
*/site-packages/nose/*
# ignore _version.py and versioneer.py
.*version.*
*_version.py

exclude_lines =
if __name__ == '__main__':
8 changes: 1 addition & 7 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/conda-recipe/ export-ignore
/devutils export-ignore
.gitarchive.cfg export-subst
*.bat text eol=crlf
diffpy.pdfgui/_version.py export-subst
62 changes: 62 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Gather coverage report and upload to codecov

on:
push:
branches:
- main
release:
types:
- prereleased
- published
workflow_dispatch:

defaults:
run:
shell: bash -l {0}

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- name: Check out diffpy.pdfgui
uses: actions/checkout@v4

- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
auto-update-conda: true
environment-file: environment.yml
auto-activate-base: false

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

- name: Install diffpy.pdfgui and requirements
run: |
conda install --file requirements/run.txt
conda install --file requirements/test.txt
python -m pip install -r requirements/pip.txt
python -m pip install . --no-deps

- name: Install Xvfb
run: sudo apt-get install -y xvfb

- name: Start Xvfb
run: |
export DISPLAY=:99
Xvfb :99 -screen 0 1024x768x16 &

- name: Validate diffpy.pdfgui
run: |
export DISPLAY=:99
coverage run -m pytest -vv -s
coverage report -m
codecov

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build and Deploy Documentation

on:
release:
types:
- published
workflow_dispatch:

defaults:
run:
shell: bash -l {0}

jobs:
docs:
runs-on: ubuntu-latest
steps:
- name: Check out diffpy.pdfgui
uses: actions/checkout@v4

- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: build
auto-update-conda: true
environment-file: environment.yml
auto-activate-base: false

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

- name: Install diffpy.pdfgui and build requirements
run: |
conda install --file requirements/build.txt
conda install --file requirements/run.txt
conda install --file requirements/docs.txt
python -m pip install -r requirements/pip.txt
python -m pip install . --no-deps

- name: build documents
run: make -C doc html

- name: Deploy
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./doc/build/html
52 changes: 52 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Test

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

defaults:
run:
shell: bash -l {0}

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Check out diffpy.pdfgui
uses: actions/checkout@v4

- name: Initialize miniconda
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test
auto-update-conda: true
environment-file: environment.yml
auto-activate-base: false

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

- name: Install diffpy.pdfgui and requirements
run: |
conda install --file requirements/run.txt
conda install --file requirements/test.txt
python -m pip install -r requirements/pip.txt
python -m pip install . --no-deps

- name: Install Xvfb
run: sudo apt-get install -y xvfb

- name: Start Xvfb
run: |
export DISPLAY=:99
Xvfb :99 -screen 0 1024x768x16 &

- name: Validate diffpy.pdfgui
run: |
export DISPLAY=:99
python -m pytest
89 changes: 72 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,44 +1,99 @@
# 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/
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
.idea

# 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

# 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

# version information
setup.cfg
/src/diffpy/*/version.cfg

# Rever
rever/
4 changes: 4 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[settings]
line_length = 115
multi_line_output = 3
include_trailing_comma = True
Loading