From c2a71f8d18626833ac8c9165d7a5a5d5cb9e731f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Fritze?= Date: Fri, 15 Mar 2019 10:12:03 +0100 Subject: [PATCH] adds a compat package to additionally allow import from "evtk" --- evtk/__init__.py | 4 ++++ setup.py | 2 +- tests/dummy.py | 11 +++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 evtk/__init__.py diff --git a/evtk/__init__.py b/evtk/__init__.py new file mode 100644 index 0000000..7816d09 --- /dev/null +++ b/evtk/__init__.py @@ -0,0 +1,4 @@ +from pyevtk import * + +import warnings +warnings.warn('the "evtk" package is deprecated, use "pyevtk" instead', DeprecationWarning) \ No newline at end of file diff --git a/setup.py b/setup.py index d46a964..039155b 100644 --- a/setup.py +++ b/setup.py @@ -45,7 +45,7 @@ def readme(fname): maintainer='Adamos Kyriakou', maintainer_email='somada141@gmail.com', url='https://bitbucket.org/pauloh/pyevtk', - packages=['pyevtk'], + packages=['pyevtk', 'evtk'], package_dir={'pyevtk': 'pyevtk'}, package_data={'pyevtk': ['LICENSE.txt', 'examples/*.py']}, install_requires=[ diff --git a/tests/dummy.py b/tests/dummy.py index dc4db39..f4c730f 100644 --- a/tests/dummy.py +++ b/tests/dummy.py @@ -15,3 +15,14 @@ def test_examples(): examples = [os.path.join(root, f) for f in files if f.endswith('.py')] for ex in examples: runpy.run_path(ex) + + +def test_compat_lib(): + with pytest.warns(DeprecationWarning): + import evtk + import pyevtk + assert pyevtk.evtk is evtk.evtk + assert pyevtk.hl is evtk.hl + assert pyevtk.vtk is evtk.vtk + assert pyevtk.xml is evtk.xml +