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

Unit testing for Python 2.7 with pandapower 2.1.0 fails #79

Closed
fneum opened this issue Jul 15, 2019 · 3 comments
Closed

Unit testing for Python 2.7 with pandapower 2.1.0 fails #79

fneum opened this issue Jul 15, 2019 · 3 comments

Comments

@fneum
Copy link
Member

fneum commented Jul 15, 2019

Tests for Python 2.7 fail in 7038b76 as it was the first CI run with the recent pandapower v2.1.0 (https://travis-ci.org/PyPSA/PyPSA/jobs/557399790).

While pandapower v2.0.0 already officially dropped Python 2.7 support, the unit tests of pypsa work with up to pandapower v2.0.1 (https://github.com/e2nIEE/pandapower/releases and discussion in e2nIEE/pandapower#224).

  1. A proposal would be to fix the version in environment_dev.yaml to pandapower==2.0.1 until the Python 2.7 countdown has run down (https://pythonclock.org/) on January 1, 2020. We make a final release tested for Python 2.7 then, and allow again to pull most recent pandapower.
  2. An alternative is to create Python version specific environment_dev.yaml files; e.g. environment_dev_python2.yaml and environment_dev_python3.yaml.
  3. Another option is to drop Python 2.7 support right now.

Other opinions/options?

@fneum fneum changed the title Unit testing for Python 2.7 with pandapower Unit testing for Python 2.7 with pandapower 2.1.0 Jul 15, 2019
@fneum fneum changed the title Unit testing for Python 2.7 with pandapower 2.1.0 Unit testing for Python 2.7 with pandapower 2.1.0 fails Jul 15, 2019
@FabianHofmann
Copy link
Collaborator

I guess option 1. is the cleanest one, but I would not wait until the clock ran down but rather drop the support soonly and announcing it in the README.md beforehand.

@coroa
Copy link
Member

coroa commented Jul 16, 2019

It's just a test for a deprecated python version.

Just add:

import six
from distutils.version import StrictVersion
pandapower_version = StrictVersion(pp.__version__)

import pytest

@pytest.mark.skipif(six.PY2 and pandapower_version >= '2.0.1',
                    reason="Pandapower 2.0.1 dropped support for Python 2.")
def test_pandapower_case():
   [...]

to test_pf_against_pandapower.py.

@fneum
Copy link
Member Author

fneum commented Jul 16, 2019

Thanks, this is obviously very neat!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants