-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce CI, + other improvements (#43)
* #DC start * #DC update travis.yml * #DC update travis * #DC add dep * #DC update * #DC update * #DC add test * #IM updates * #DC update travis * #DC update setup * #DC update setup.py * #BF add numpy * #DC update * #DC reduce number of python version * #update setup.py * #DC update setup.py * #DC add numpy to req_dev * #DC update tox * #Dc update * #DC typo * #DC update tox * #DC update * flake8 * #IM update setup.cfg * #DC change flake8 * #DC expand ignore list * #DC ignore more flake8 rules * #DC update Readme * Add Codacy badge * #DC update Readme * #DC add codacy * #DC update travis * #DC update Readme * #DC update * #DC update readme * Refactor CI (#5) * Remove pytest cache from version control. * Replace travisCI with github actions. * Use setup.cfg as central configuration replacing requirements and setup.py * Adjust tox.ini to new setup.cfg. * Fix syntax error in gh yaml. * Add badge and rename workflow name * Ignore github actions if [skip ci] is contained in commit message * Fix incorrect badge path in README [skip-ci] * Remove obsolete version module. * Move test data into subfolder and refactor conftest module. * Add init module to test dir to allow coverage in local dev with pytest. * Replace os.path with pathlib.Path. Convert `dumb_res` to fixture. * #DC update various ... * #DC add codacy * #DC add contributing * #DC update * #DC update * #DC add codacy * #DC add environment variable * #DC add conflicting file * #DC update history * #DC update readme * #DC update Contributing.md * #DC formatting oft setup.cfg * #DC update links * #DC update Contributing * #DC remove requirements file * #DC BE -> AE * #DC comment out codacy * DC update Co-authored-by: The Codacy Badger <[email protected]> Co-authored-by: Franz Wöllert <[email protected]>
- Loading branch information
1 parent
de3cec1
commit 0cdbc75
Showing
68 changed files
with
1,511 additions
and
1,267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[run] | ||
source=hoggorm | ||
omit= | ||
[report] | ||
exclude_lines = | ||
pragma: no cover | ||
raise | ||
except | ||
register_parameter | ||
warn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: ci-build | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build: | ||
if: "! contains(toJSON(github.event.commits.*.message), '[skip-ci]')" | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
python-version: [3.6, 3.7, 3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Tox and any other packages | ||
run: pip install tox | ||
- name: Run Tox | ||
run: tox -e py | ||
env: | ||
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Contributing to hoggorm | ||
|
||
If you are interested in contributing to hoggorm, your contributions will fall into three categories: | ||
|
||
1. You want to implement a new feature: | ||
.... | ||
2. You want to fix a bug: | ||
- Feel free to send a Pull Request any time you encounter a bug. Please provide a clear and concise description of what the bug was. If you are unsure about if this is a bug at all or how to fix, post about it in an issue. | ||
|
||
3. Improvement of documentation: | ||
|
||
Once you finish implementing a feature or bug-fix, please send a Pull Request to https://github.com/olivertomic/hoggorm | ||
|
||
## Developing hoggorm | ||
|
||
To develop hoggorm on your machine, here are some tips: | ||
|
||
1. Create and activate an environment for hoggorm | ||
|
||
``` | ||
conda create -n envdevhoggorm python=3.6 | ||
conda activate envdevhoggorm | ||
``` | ||
|
||
2. Clone a copy of hoggorm from source: | ||
|
||
``` | ||
git clone https://github.com/olivertomic/hoggorm.git | ||
``` | ||
|
||
4. Install hoggorm in `dev` and `test` mode: | ||
|
||
``` | ||
cd hoggorm | ||
pip install -e .[dev,test] | ||
``` | ||
|
||
5. Ensure that you have a working hoggorm installation by running the entire test suite with | ||
|
||
``` | ||
python setup.py test | ||
``` | ||
|
||
|
||
## Unit Testing | ||
|
||
hoggorm's testing is located under `test/`. | ||
Run the entire test suite with | ||
|
||
``` | ||
python setup.py test | ||
``` | ||
## Additional Comments | ||
* American English is used | ||
* We use Semantic Versioning (https://semver.org/) | ||
|
||
|
||
## Continuous Integration | ||
|
||
hoggorm uses [GitHub Action](https://github.com/andife/hoggorm/actions?query=workflow%3Aci-build) in combination with [CodeCov](https://codecov.io/github/andife/hoggorm?branch=hogCI) for continuous integration. | ||
|
||
Everytime you send a Pull Request, your commit will be built and checked against the hoggorm guidelines: | ||
|
||
1. Ensure that your code is formatted correctly by testing against the styleguides of [`flake8`](https://github.com/PyCQA/flake8) and [`pycodestyle`](https://github.com/PyCQA/pycodestyle): | ||
|
||
``` | ||
pycodestyle hoggorm test examples | ||
flake8 hoggorm test examples | ||
``` | ||
|
||
If you do not want to format your code manually, we recommend to use [`yapf`](https://github.com/google/yapf). | ||
|
||
|
||
``` | ||
python setup.py test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
======= | ||
History | ||
======= | ||
|
||
|
||
0.14.X (2020-10-XX) | ||
------------------- | ||
TODO... | ||
* rework of README.rst (add colab and binder integration) | ||
* fix pytest | ||
* Move test data into subfolder and refactor conftest module | ||
* reduce spelling errors | ||
* Introduce CONTRIBUTING | ||
* Start use of "CII Best Practices" | ||
* New project structure based on cookiecutter | ||
* Introduce Continous Integration | ||
* Use github actions for CI | ||
* Integration of flake8 | ||
* Integration of codecov | ||
* Integration of codacy | ||
|
||
|
||
0.13.3 (2019-07-11) | ||
------------------- | ||
|
||
Last reviewer requested change before publication of hoggorm package in Journal of Open Source Software: | ||
|
||
* Updated usage example in readthedocs documentation in file quickstart.rst. | ||
|
||
|
||
0.13.2 (2019-07-06) | ||
------------------- | ||
|
||
* New and updated examples (Jupyter notebooks and executable scripts) for PCA, PLS1, PLS2 , PCR, SMI, RV and RV2 | ||
* Updated documentation for ReadTheDocs | ||
* Updated tests | ||
* Updated license | ||
* Updated paper.md and paper.bib for publication of paper with Journal of Open Source Software (JOSS) | ||
|
||
|
||
0.12 (2019-01-21) | ||
----------------- | ||
|
||
* Git release matching PIP release from July 2018. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
.PHONY: clean clean-test clean-pyc clean-build docs help | ||
.DEFAULT_GOAL := help | ||
|
||
define BROWSER_PYSCRIPT | ||
import os, webbrowser, sys | ||
|
||
from urllib.request import pathname2url | ||
|
||
webbrowser.open("file://" + pathname2url(os.path.abspath(sys.argv[1]))) | ||
endef | ||
export BROWSER_PYSCRIPT | ||
|
||
define PRINT_HELP_PYSCRIPT | ||
import re, sys | ||
|
||
for line in sys.stdin: | ||
match = re.match(r'^([a-zA-Z_-]+):.*?## (.*)$$', line) | ||
if match: | ||
target, help = match.groups() | ||
print("%-20s %s" % (target, help)) | ||
endef | ||
export PRINT_HELP_PYSCRIPT | ||
|
||
BROWSER := python -c "$$BROWSER_PYSCRIPT" | ||
|
||
help: | ||
@python -c "$$PRINT_HELP_PYSCRIPT" < $(MAKEFILE_LIST) | ||
|
||
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts | ||
|
||
clean-build: ## remove build artifacts | ||
rm -fr build/ | ||
rm -fr dist/ | ||
rm -fr .eggs/ | ||
find . -name '*.egg-info' -exec rm -fr {} + | ||
find . -name '*.egg' -exec rm -f {} + | ||
|
||
clean-pyc: ## remove Python file artifacts | ||
find . -name '*.pyc' -exec rm -f {} + | ||
find . -name '*.pyo' -exec rm -f {} + | ||
find . -name '*~' -exec rm -f {} + | ||
find . -name '__pycache__' -exec rm -fr {} + | ||
|
||
clean-test: ## remove test and coverage artifacts | ||
rm -fr .tox/ | ||
rm -f .coverage | ||
rm -fr htmlcov/ | ||
rm -fr .pytest_cache | ||
|
||
lint: ## check style with flake8 | ||
flake8 hoggorm tests | ||
|
||
test: ## run tests quickly with the default Python | ||
pytest | ||
|
||
test-all: ## run tests on every Python version with tox | ||
tox | ||
|
||
coverage: ## check code coverage quickly with the default Python | ||
coverage run --source hoggorm -m pytest | ||
coverage report -m | ||
coverage html | ||
$(BROWSER) htmlcov/index.html | ||
|
||
docs: ## generate Sphinx HTML documentation, including API docs | ||
rm -f docs/hoggorm.rst | ||
rm -f docs/modules.rst | ||
sphinx-apidoc -o docs/ hoggorm | ||
$(MAKE) -C docs clean | ||
$(MAKE) -C docs html | ||
$(BROWSER) docs/_build/html/index.html | ||
|
||
servedocs: docs ## compile the docs watching for changes | ||
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D . | ||
|
||
release: dist ## package and upload a release | ||
twine upload dist/* | ||
|
||
dist: clean ## builds source and wheel package | ||
python setup.py sdist | ||
python setup.py bdist_wheel | ||
ls -l dist | ||
|
||
install: clean ## install the package to the active Python's site-packages | ||
python setup.py install |
Oops, something went wrong.