Skip to content

Commit

Permalink
Simplify vtkplotlib version handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
bwoodsend committed Jul 4, 2021
1 parent 113c898 commit 355d7cf
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 17 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,5 @@ spellcheck.txt
# Test data
vtkplotlib/data/test-data.json

# version file
vtkplotlib/__version__.py

# PyCharm project
.idea/
17 changes: 4 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"]
},
Expand Down
1 change: 0 additions & 1 deletion version

This file was deleted.

2 changes: 2 additions & 0 deletions vtkplotlib/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
__version__ = "1.4.1"

0 comments on commit 355d7cf

Please sign in to comment.