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

Add CI based on tox (github workflows and templates based on oemof.solph) #78

Merged
merged 49 commits into from
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
59d9ba5
Add .github workflows and templates based on oemof.solph
joroeder Jul 9, 2021
7c87252
Remove black and use flake8
joroeder Jul 9, 2021
105e626
Update gitignore
joroeder Jul 9, 2021
16b45d9
Fix broken link to oemof contribution
joroeder Jul 9, 2021
3c11b41
Add option dev to extra_requires
joroeder Jul 9, 2021
47710ea
Add sphinx to docs/requirements.txt
joroeder Jul 9, 2021
9f540c9
Update gitignore
joroeder Jul 9, 2021
5bfe6e6
Add tox.ini and MANIFEST
joroeder Jul 9, 2021
929ca49
Update manifest (examples)
joroeder Jul 9, 2021
f81640c
Remove unused .flake8 .pylint .travis files
joroeder Jul 9, 2021
a1372e4
Adapt setup.cfg according to oemof.solph, uncomment isort in tox.ini
joroeder Jul 9, 2021
640953b
Uncomment exports within repo
joroeder Jul 9, 2021
d342334
Fix flake 8 issues
joroeder Jul 9, 2021
37f8b30
Fix test path
joroeder Jul 9, 2021
4386ae0
Exclude examples from flake8
joroeder Jul 9, 2021
5190f1e
Add tests-option to setup.py and tell tox.ini to use
joroeder Jul 9, 2021
b889fb2
Fix bullet warning (docs check)
joroeder Jul 12, 2021
2b5ce39
Fix dupblicated warning docs
joroeder Jul 12, 2021
c63afb2
Fix intentation warning from docs check
joroeder Jul 12, 2021
0f1d797
Comment unused MANIFEST lines
joroeder Jul 12, 2021
b42d712
Fix units (length_m > length, diameter_mm > diameter)
joroeder Jul 12, 2021
5fd6168
Fix doctest of thermalnetwork
joroeder Jul 12, 2021
e784690
Change coverage failure to 25
joroeder Jul 12, 2021
8849a43
Remove redundant extra=tests from tox.ini
joroeder Jul 13, 2021
2512bda
Add note to readthedocs that tox is used
joroeder Jul 13, 2021
e561b76
Activate isort
joroeder Jul 13, 2021
46c61ee
Sort imports dhnx/
joroeder Jul 13, 2021
dc1d968
Fix isort in tests
joroeder Jul 13, 2021
43d0104
Replace oemof.solph by dhnx
joroeder Jul 13, 2021
85b3ae5
Undo exclude examples from flake8
joroeder Jul 13, 2021
c6564ae
Uncomment unused import
joroeder Jul 13, 2021
06d3892
Fix WARNING: Pygments lexer name 'txt' is not known
joroeder Jul 13, 2021
1770402
Add -e . for readthedocs API build
joroeder Jul 22, 2021
2a61b27
Remove obsolet? sphinx requirement
joroeder Jul 22, 2021
f565ccd
Add readthedocs.yml and add rtd-theme to docs requirements again
joroeder Jul 22, 2021
acb5530
Add missing blank line
joroeder Jul 22, 2021
18634c9
Remove unused readthedocs.yml
joroeder Jul 22, 2021
2fe2744
Change maxdepth to 2 of api
joroeder Jul 22, 2021
71a701a
Make imports more explicit
joroeder Jul 28, 2021
5843ae2
Update gitignore exlude examples output
joroeder Jul 28, 2021
a17556b
Make imports explicit
joroeder Jul 28, 2021
cf499fe
Uncomment export of example again
joroeder Jul 28, 2021
cd843fa
Update gitignore, exclude example output
joroeder Jul 28, 2021
93ca8c4
Make import explicit
joroeder Jul 28, 2021
c577048
Update gitignore, exlude examples output
joroeder Jul 28, 2021
a922b55
Simplify extras_require and tox test
joroeder Jul 28, 2021
6dbcc47
Remove cartopy from tests requirements
joroeder Jul 28, 2021
93713b1
Add coveragrc
joroeder Jul 28, 2021
a6eaa31
Include coverage in manifest
joroeder Jul 28, 2021
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
16 changes: 16 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[paths]
source = dhnx

[run]
branch = true
source =
dhnx
tests
parallel = true
omit = *custom*
*test*

[report]
show_missing = true
precision = 2
omit = *migrations*
6 changes: 0 additions & 6 deletions .flake8

This file was deleted.

31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS, Debian, Ubunut, Windows10]
- Python version [e.g. 3.8]

**Additional context**
Add any other context about the problem here.
10 changes: 10 additions & 0 deletions .github/ISSUE_TEMPLATE/general-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
name: General issue
about: General purpose
title: ''
labels: ''
assignees: ''

---


13 changes: 13 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
* Describe your pull request as transparent as possible
* What functionality does it implement?
* Where is it located?
* How does the API look?
...

* Related issues?

* Share your knowledge: Insights/Remarks

* Other comments and questions

* [] For new features: Remember the documentation!
39 changes: 39 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Falke8

on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev

jobs:
run-linters:
name: Run linters
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.9

- name: Install Python dependencies
run: pip install flake8

- name: Run linters
uses: samuelmeuli/lint-action@v1
with:
github_token: ${{ secrets.github_token }}
# Enable linters
flake8: true
# Mark the following line true if you want linters to attempt to autocorrect your code
auto_fix: false
git_name: "Greene Lab Linter"
git_email: "csgreene@upenn.edu"
37 changes: 37 additions & 0 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: packaging

on:
# Make sure packaging process is not broken
push:
branches: [master, dev]
pull_request:
# Make a package for release
release:
types: [published]

jobs:
build:

runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.9]

steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools setuptools_scm twine wheel
- name: Create packages
run: python setup.py sdist bdist_wheel
- name: Run twine check
run: twine check dist/*
- uses: actions/upload-artifact@v2
with:
name: tox-gh-actions-dist
path: dist
54 changes: 54 additions & 0 deletions .github/workflows/tox_checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# NB: this name is used in the status badge
name: tox checks

on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev
workflow_dispatch:
schedule:
- cron: "0 5 * * 6" # 5:00 UTC every Saturday

jobs:
lint:
name: ${{ matrix.toxenv }}
runs-on: ubuntu-latest

strategy:
matrix:
toxenv:
- clean
- check
- docs

steps:
- name: Git clone
uses: actions/checkout@v2

- name: Set up Python ${{ env.default_python || '3.9' }}
uses: actions/setup-python@v2
with:
python-version: "${{ env.default_python || '3.9' }}"

- name: Pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.toxenv }}-${{ hashFiles('tox.ini', 'setup.py') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.toxenv }}-
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U setuptools wheel
python -m pip install -U tox

- name: Run ${{ matrix.toxenv }}
run: python -m tox -e ${{ matrix.toxenv }}
45 changes: 45 additions & 0 deletions .github/workflows/tox_pytests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: tox pytests

on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev
workflow_dispatch:
schedule:
- cron: "0 5 * * 6" # 5:00 UTC every Saturday

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]

steps:
- uses: actions/checkout@v1
- name: Install xmllint
run: sudo apt install coinor-cbc
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions coverage coveralls
- name: Test with tox
run: tox

- name: Check test coverage
run: coverage report -m --fail-under=${{ matrix.vcs == 'bzr' && 24 || 25 }}

- name: Report to coveralls
run: coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
19 changes: 16 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@
results/
_build
jupyter_notebooks
*/import_export_plot/data_csv_output/
*/import_osmnx/data/
cache/
dist/

# Unit test / coverage reports
.coverage
.tox
.coverage.*
.pytest_cache/
nosetests.xml
coverage.xml
htmlcov

# examples
examples/import_export_plot/data_csv_output/*
examples/import_osmnx/osm_network/*
examples/simulation/tree_results/*
*/cache/*
Loading