Add __version__ to python package.

And bump version to 1.6
This commit is contained in:
ColinDuquesnoy 2014-02-20 13:31:58 +01:00
parent 28c1071f09
commit 5872544115
2 changed files with 14 additions and 1 deletions

View File

@ -31,6 +31,9 @@ with the correct rc file.
import os
__version__ = "1.6"
def load_stylesheet(pyside=True):
"""
Loads the stylesheet. Takes care of importing the rc module.

View File

@ -28,9 +28,19 @@ QDarkStyle is a darks stylesheet for python qt applications
"""
from setuptools import setup, find_packages
def read_version():
"""
Reads the version without self importing
"""
with open("qdarkstyle/__init__.py") as f:
lines = f.read().splitlines()
for l in lines:
if "__version__" in l:
return l.split("=")[1].strip().replace('"', "")
setup(
name='QDarkStyle',
version='1.5',
version=read_version(),
packages=find_packages(),
package_data={'qdarkstyle': ["*.qss", "*.qrc", "rc/*.png"]},
url='https://github.com/ColinDuquesnoy/QDarkStyleSheet',