mirror of
https://github.com/JoelBender/modpypes
synced 2025-10-26 21:49:19 +08:00
extract the package metadata from the __init__.py file
This commit is contained in:
parent
64325da2f2
commit
6e69b01475
18
setup.py
18
setup.py
|
|
@ -2,6 +2,9 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
|
||||||
|
import os
|
||||||
|
import re
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from setuptools import setup
|
from setuptools import setup
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
@ -16,19 +19,24 @@ test_requirements = [
|
||||||
# TODO: put package test requirements here
|
# TODO: put package test requirements here
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# read in the __init__.py file, extract the metadata
|
||||||
|
init_py = open(os.path.join('modpypes', '__init__.py')).read()
|
||||||
|
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", init_py))
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='modpypes',
|
name='modpypes',
|
||||||
version='0.4',
|
version=metadata['version'],
|
||||||
description="Python library for MODBUS based on BACpypes",
|
description="Python library for MODBUS based on BACpypes",
|
||||||
long_description="See GitHub for more information",
|
long_description="See GitHub for more information",
|
||||||
author="Joel Bender",
|
author=metadata['author'],
|
||||||
author_email='joel@carrickbender.com',
|
author_email=metadata['email'],
|
||||||
url='https://github.com/JoelBender/modpypes',
|
url='https://github.com/JoelBender/modpypes',
|
||||||
packages=[
|
packages=[
|
||||||
'modpypes',
|
'modpypes',
|
||||||
],
|
],
|
||||||
package_dir={'modpypes':
|
package_dir={
|
||||||
'modpypes'},
|
'modpypes': 'modpypes',
|
||||||
|
},
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
install_requires=requirements,
|
install_requires=requirements,
|
||||||
license="MIT",
|
license="MIT",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user