Skip to content

Commit

Permalink
Import version.py file from absolute path
Browse files Browse the repository at this point in the history
Needed this so the open('version.py') works regardless of where you import
plotters from.
  • Loading branch information
fbcotter committed Aug 9, 2017
1 parent 8dd557a commit e13c5db
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion plotters.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import numpy as np
import matplotlib.pyplot as plt
import os

__author__ = "Fergal Cotter"
exec(open("./version.py").read()) # Imports the __version__ variable
exec(open(os.path.join(os.path.dirname(__file__), 'version.py')).read())
__version_info__ = tuple([int(d) for d in __version__.split(".")]) # noqa


Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
from setuptools import setup
exec(open('./version.py').read()) # Imports the __version__ variable
# Imports the __version__ variable
exec(open(os.path.join(os.path.dirname(__file__), 'version.py')).read())


# Utility function to read the README file.
Expand Down
2 changes: 1 addition & 1 deletion version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.0.2"
__version__ = "0.0.1"

0 comments on commit e13c5db

Please sign in to comment.