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

cookiecutter: modified files pt1 #153

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
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
51 changes: 26 additions & 25 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,31 +23,32 @@ jobs:
path: .
fetch-depth: 0 # avoid shallow clone with no tags

- name: Install Mamba
run: |
wget "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh" -O mambaforge.sh
bash mambaforge.sh -b -p $HOME/mambaforge
echo "$HOME/mambaforge/bin" >> $GITHUB_PATH
source $HOME/mambaforge/etc/profile.d/conda.sh
conda init bash
- name: initialize miniconda
# this uses a marketplace action that sets up miniconda in a way that makes
# it easier to use. I tried setting it up without this and it was a pain
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test
# environment.yml file is needed by this action. Because I don't want
# maintain this but rather maintain the requirements files it just has
# basic things in it like conda and pip
environment-file: ./environment.yml
python-version: 3
auto-activate-base: false

- name: Create conda environment
- name: install diffpy.pdfgui requirements
shell: bash -l {0}
run: |
source $HOME/mambaforge/etc/profile.d/conda.sh
conda create -n test_env python=3.12 xonsh regolith -c conda-forge -y
conda activate test_env
pip install case_insensitive_dict

- name: Install dependencies
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda activate test
conda install --file requirements/run.txt
conda install --file requirements/test.txt
pip install .
- name: Validate diffpy.pdfgui
shell: bash -l {0}
run: |
source $HOME/mambaforge/etc/profile.d/conda.sh
conda activate test_env
mamba install --file requirements/run.txt
mamba install --file requirements/test.txt
pip install -e .

- name: Use Xvfb Action
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we will need this xvfb action for the wx.

This PR is getting the tests to pass and will take some work, so put all the workflow work on a separate PR. I had it working before with the mamba stuff and we may need to do it that way, but let's try and get as far as we can with the cookiecutter version, then see if we can the xvfb action to work. WHen I was doing it before, it couldn't activate the conda environment for some reason. Let's work on this on a separate PR.

uses: GabrielBB/xvfb-action@v1
with:
run: |
bash -c "source $HOME/mambaforge/etc/profile.d/conda.sh && conda activate test_env && python -m run_tests.py"
conda activate test
coverage run -m pytest -vv -s
coverage report -m
codecov
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/
6 changes: 3 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=========================
Diffpy.pdfgui Change Log
=========================
=============
Release Notes
=============

.. current developments

Expand Down
33 changes: 12 additions & 21 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,23 +1,14 @@
recursive-include src *
recursive-exclude src *.py[co]
include AUTHORS.txt LICENSE*.txt README*
recursive-include doc *
prune doc/epydoc
prune doc/manual/images/originals
exclude doc/manual/images/*.pdf
recursive-exclude doc/manual Makefile *.py *.texinfo
recursive-exclude doc/manual *.aux *.cp *.cps *.err *.log *.toc *.vr *.vrs
recursive-include icons *.png *.ico
recursive-exclude icons *.m *.xcf
global-exclude .gitattributes .gitignore .gitarchive.cfg
global-exclude .DS_Store
include AUTHORS.rst
include LICENSE
include README.rst
include requirements.txt

# Avoid user content in setup.cfg to make distribution reproducible.
exclude setup.cfg
recursive-exclude * __pycache__
recursive-exclude * *.py[co]

# Exclude git-tracked files spuriously added by setuptools_scm
exclude .coveragerc
exclude .travis*
prune conda-recipe
prune devutils
#prune doc
recursive-include docs *.rst conf.py Makefile make.bat

include diffpy.pdfgui/version.py

# If including data files in the package, add them like:
# include path/to/data_file
Loading
Loading