2020-07-04 09:42:23 +00:00
|
|
|
import os
|
|
|
|
import re
|
|
|
|
from setuptools import setup, find_packages
|
|
|
|
|
|
|
|
regexp = re.compile(r".*__version__ = [\'\"](.*?)[\'\"]", re.S)
|
|
|
|
|
2020-07-04 10:42:30 +00:00
|
|
|
init_file = os.path.join(os.path.dirname(__file__), "horusdemodlib", "__init__.py")
|
2020-07-04 09:42:23 +00:00
|
|
|
with open(init_file, "r") as f:
|
|
|
|
module_content = f.read()
|
|
|
|
match = regexp.match(module_content)
|
|
|
|
if match:
|
|
|
|
version = match.group(1)
|
|
|
|
else:
|
|
|
|
raise RuntimeError(f"Cannot find __version__ in {init_file}")
|
|
|
|
|
|
|
|
|
|
|
|
with open("README.md", "r") as f:
|
|
|
|
readme = f.read()
|
|
|
|
|
|
|
|
|
|
|
|
with open("requirements.txt", "r") as f:
|
|
|
|
requirements = []
|
|
|
|
for line in f.read().split("\n"):
|
|
|
|
line = line.strip()
|
|
|
|
if line and not line.startswith("#"):
|
|
|
|
requirements.append(line)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
setup(
|
|
|
|
name="horusdemodlib",
|
|
|
|
description="Project Horus Telemetry Decoding Library",
|
|
|
|
long_description=readme,
|
|
|
|
version=version,
|
|
|
|
install_requires=requirements,
|
|
|
|
keywords=["horus modem telemetry radio"],
|
2020-07-04 10:42:30 +00:00
|
|
|
package_dir={"": "."},
|
|
|
|
packages=find_packages("."),
|
2020-07-04 09:42:23 +00:00
|
|
|
classifiers=[
|
|
|
|
"Intended Audience :: Developers",
|
|
|
|
"Programming Language :: Python :: 3.6",
|
|
|
|
"Programming Language :: Python :: 3.7",
|
|
|
|
]
|
|
|
|
)
|