Skip to content

Commit

Permalink
Merge pull request #317 from openego/features/automated_windows_testing
Browse files Browse the repository at this point in the history
Automated windows testing and changed edisgo requirement versions
  • Loading branch information
khelfen committed Sep 26, 2022
2 parents 2c3f59e + 7c0c02a commit 8086b7f
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 46 deletions.
90 changes: 67 additions & 23 deletions .github/workflows/tests-coverage.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,78 @@
# Tests with pytest the package and monitors the covarage and sends it to coveralls.io
# Coverage is only send to coveralls.io when no pytest tests fail
name: "Tests & coverage"
name: "Tests & Coverage"

on: [push]

# Cancel jobs on new push
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
name: "eDisGo-${{ matrix.name-suffix }} at Python ${{ matrix.python-version }} on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
python-version: [ '3.7', '3.8', '3.9' ]
include:
- name-suffix: "basic"
os: ubuntu-latest
python-version: 3.8
- name-suffix: "dev"
os: ubuntu-latest
python-version: 3.8
- name-suffix: "basic"
os: ubuntu-latest
python-version: 3.9
- name-suffix: "dev"
os: windows-latest
python-version: 3.8

steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip3 install --upgrade pip
pip3 install -e $GITHUB_WORKSPACE[full]
pip3 install coveralls
- name: Run coverage
run: |
coverage run --source=edisgo -m pytest --runslow -vv
- name: Run coveralls
run: |
coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install packages (Linux - Basic)
if: runner.os == 'Linux' && matrix.name-suffix == 'basic'
run: |
pip install --upgrade pip wheel setuptools
pip install -e "."
- name: Install packages (Linux - Dev)
if: runner.os == 'Linux' && matrix.name-suffix == 'dev'
run: |
pip install --upgrade pip wheel setuptools
pip install -e ".[dev]"
- name: Install packages (Windows)
if: runner.os == 'Windows'
uses: conda-incubator/setup-miniconda@v2
with:
miniconda-version: "latest"
activate-environment: edisgo_env
environment-file: eDisGo_env_dev.yml
python-version: ${{ matrix.python-version }}

- name: Run tests
if: ${{ !(runner.os == 'Linux' && matrix.python-version == 3.8 && matrix.name-suffix == 'dev') }}
run: |
python -m pip install pytest
python -m pytest --runslow -vv
- name: Run tests, coverage and send to coveralls
if: runner.os == 'Linux' && matrix.python-version == 3.8 && matrix.name-suffix == 'dev'
run: |
pip install coveralls
coverage run --source=edisgo -m pytest --runslow -vv
coveralls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_SERVICE_NAME: github
4 changes: 2 additions & 2 deletions eDisGo_env.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: eDisGo_env
name: eDisGo_env_dev
channels:
- conda-forge
- defaults
Expand All @@ -17,4 +17,4 @@ dependencies:
- conda-forge::contextily
- conda-forge::descartes
- pip:
- eDisGo[full]
- eDisGo
2 changes: 1 addition & 1 deletion eDisGo_env_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ dependencies:
- conda-forge::contextily
- conda-forge::descartes
- pip:
- -e .[full]
- -e .[dev]
26 changes: 6 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

from setuptools import find_packages, setup

if sys.version_info[:2] < (3, 7):
if sys.version_info[:2] < (3, 8):
error = (
"eDisGo requires Python 3.7 or later (%d.%d detected)." % sys.version_info[:2]
"eDisGo requires Python 3.8 or later (%d.%d detected)." % sys.version_info[:2]
)
sys.stderr.write(error + "\n")
sys.exit(1)
Expand Down Expand Up @@ -50,23 +50,16 @@ def read(fname):
"sklearn",
"pydot",
"pygeos",
]

geo_plot_requirements = [
"contextily",
"descartes",
"plotly",
"dash==2.6.0",
"werkzeug==2.2.0",
]
examples_requirements = [
"jupyter",
"jupyterlab",
"plotly",
"dash==2.6.0",
"jupyter_dash",
"werkzeug==2.2.0",
]

dev_requirements = [
"pytest",
"jupyter_contrib_nbextensions",
Expand All @@ -79,24 +72,17 @@ def read(fname):
"flake8",
"pylint",
]
full_requirements = list(
set(geo_plot_requirements + examples_requirements + dev_requirements)
)

extras = {
"geoplot": geo_plot_requirements,
"examples": examples_requirements,
"dev": dev_requirements,
"full": full_requirements,
}
extras = {"dev": dev_requirements}

setup(
name="eDisGo",
version="0.2.0dev",
packages=find_packages(),
url="https://github.com/openego/eDisGo",
license="GNU Affero General Public License v3.0",
author="birgits, AnyaHe, khelfen, gplssm, nesnoj, jaappedersen, Elias, boltbeard",
author="birgits, AnyaHe, khelfen, gplssm, nesnoj, jaappedersen, Elias, boltbeard, "
"mltja",
author_email="anya.heider@rl-institut.de",
description="A python package for distribution network analysis and optimization",
long_description=read("README.md"),
Expand Down

0 comments on commit 8086b7f

Please sign in to comment.