Move version number into VERSION file

to avoid importing mem_edit in setup.py
This commit is contained in:
Jan Petykiewicz 2019-09-30 23:59:20 -07:00
parent 6321d4221c
commit 49a7c21ed2
4 changed files with 13 additions and 4 deletions

View File

@ -1,2 +1,3 @@
include README.md include README.md
include LICENSE.md include LICENSE.md
include mem_edit/VERSION

1
mem_edit/VERSION Normal file
View File

@ -0,0 +1 @@
0.2

View File

@ -12,12 +12,16 @@ To get started, try:
""" """
import platform import platform
import pathlib
from .utils import MemEditError from .utils import MemEditError
__author__ = 'Jan Petykiewicz' __author__ = 'Jan Petykiewicz'
version = '0.2'
with open(pathlib.Path(__file__).parent / 'VERSION', 'r') as f:
__version__ = f.read().strip()
version = __version__
system = platform.system() system = platform.system()

View File

@ -1,15 +1,15 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
from setuptools import setup, find_packages from setuptools import setup, find_packages
import mem_edit
with open('README.md', 'r') as f: with open('README.md', 'r') as f:
long_description = f.read() long_description = f.read()
with open('mem_edit/VERSION', 'r') as f:
version = f.read().strip()
setup(name='mem_edit', setup(name='mem_edit',
version=mem_edit.version, version=version,
description='Multi-platform library for memory editing', description='Multi-platform library for memory editing',
long_description=long_description, long_description=long_description,
long_description_content_type='text/markdown', long_description_content_type='text/markdown',
@ -50,6 +50,9 @@ setup(name='mem_edit',
'Topic :: Utilities', 'Topic :: Utilities',
], ],
packages=find_packages(), packages=find_packages(),
package_data={
'mem_edit': ['VERSION']
},
install_requires=[ install_requires=[
'typing', 'typing',
], ],