diff --git a/.gitignore b/.gitignore index a6b2a53..f06e69b 100644 --- a/.gitignore +++ b/.gitignore @@ -108,8 +108,5 @@ spellcheck.txt # Test data vtkplotlib/data/test-data.json -# version file -vtkplotlib/__version__.py - # PyCharm project .idea/ diff --git a/setup.py b/setup.py index 1a17aad..0e1f3dc 100644 --- a/setup.py +++ b/setup.py @@ -6,26 +6,18 @@ """ from setuptools import setup, find_packages -from distutils.command.build import build import sys from os import path +import runpy HERE = path.split(__file__)[0] with open(path.join(HERE, "README.md"), "r") as fh: long_description = fh.read() -with open(path.join(HERE, "version"), "r") as fh: - version = fh.read().strip().lstrip("v") - - -class Build(build): - - def run(self): - with open(path.join(HERE, "vtkplotlib", "__version__.py"), "w") as fh: - fh.write("# -*- coding: utf-8 -*-\n__version__ = \"{}\"\n" - .format(version)) # yapf: disable - build.run(self) +version = runpy.run_path( + path.join(HERE, "vtkplotlib", "__version__.py"), +)["__version__"] setup(name='vtkplotlib', version=version, @@ -52,7 +44,6 @@ def run(self): "PyQt5" if sys.version_info.major >= 3 else "python_qt5", "numpy-stl", "namegenerator", "PILLOW"], }, - cmdclass={"build": Build}, entry_points={ "pyinstaller40": ["hook-dirs = vtkplotlib.data:_get_hooks_dir"] }, diff --git a/version b/version deleted file mode 100644 index 347f583..0000000 --- a/version +++ /dev/null @@ -1 +0,0 @@ -1.4.1 diff --git a/vtkplotlib/__version__.py b/vtkplotlib/__version__.py new file mode 100644 index 0000000..0086b1c --- /dev/null +++ b/vtkplotlib/__version__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +__version__ = "1.4.1"