Skip to content

Commit 11a1e70

Browse files
committed
adds a compat package to additionally allow import from "evtk"
1 parent 5fee44a commit 11a1e70

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

evtk/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from pyevtk import *
2+
3+
import warnings
4+
warnings.warn('the "evtk" package is deprecated, use "pyevtk" instead', DeprecationWarning)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def readme(fname):
4545
maintainer='Adamos Kyriakou',
4646
maintainer_email='[email protected]',
4747
url='https://bitbucket.org/pauloh/pyevtk',
48-
packages=['pyevtk'],
48+
packages=['pyevtk', 'evtk'],
4949
package_dir={'pyevtk': 'pyevtk'},
5050
package_data={'pyevtk': ['LICENSE.txt', 'examples/*.py']},
5151
install_requires=[

tests/dummy.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,14 @@ def test_examples():
1515
examples = [os.path.join(root, f) for f in files if f.endswith('.py')]
1616
for ex in examples:
1717
runpy.run_path(ex)
18+
19+
20+
def test_compat_lib():
21+
with pytest.warns(DeprecationWarning):
22+
import evtk
23+
import pyevtk
24+
assert pyevtk.evtk is evtk.evtk
25+
assert pyevtk.hl is evtk.hl
26+
assert pyevtk.vtk is evtk.vtk
27+
assert pyevtk.xml is evtk.xml
28+

0 commit comments

Comments
 (0)