platypush/setup.py

130 lines
3.1 KiB
Python
Raw Normal View History

2017-11-03 12:41:15 +01:00
#!/usr/bin/env python
import json
import os
2020-06-10 12:37:26 +02:00
from setuptools import setup, find_packages
def path(fname=''):
return os.path.abspath(os.path.join(os.path.dirname(__file__), fname))
def readfile(fname):
with open(path(fname)) as f:
return f.read()
2017-11-03 15:06:29 +01:00
def pkg_files(dir):
paths = []
for p, _, files in os.walk(dir):
2017-11-03 15:06:29 +01:00
for file in files:
paths.append(os.path.join('..', p, file))
2017-11-03 15:06:29 +01:00
return paths
def scan_manifests():
for root, _, files in os.walk('platypush'):
for file in files:
if file == 'manifest.json':
yield os.path.join(root, file)
def parse_deps(deps):
ret = []
for dep in deps:
if dep.startswith('git+'):
continue # Don't include git dependencies in the setup.py, or Twine will complain
ret.append(dep)
return ret
def parse_manifest(manifest_file):
with open(manifest_file) as f:
manifest = json.load(f).get('manifest')
if not manifest:
return None, None
name = '.'.join(manifest['package'].split('.')[2:])
return name, parse_deps(manifest.get('install', {}).get('pip', []))
def parse_manifests():
ret = {}
for manifest_file in scan_manifests():
name, deps = parse_manifest(manifest_file)
if deps:
ret[name] = deps
return ret
2017-12-11 20:30:57 +01:00
plugins = pkg_files('platypush/plugins')
backend = pkg_files('platypush/backend')
2017-11-03 15:06:29 +01:00
setup(
2020-01-01 15:40:42 +01:00
name="platypush",
2024-07-16 15:34:13 +02:00
version="1.1.3",
2020-01-01 15:40:42 +01:00
author="Fabio Manganiello",
author_email="fabio@manganiello.tech",
2020-01-01 15:40:42 +01:00
description="Platypush service",
license="MIT",
python_requires='>= 3.6',
keywords="home-automation automation iot mqtt websockets redis dashboard notifications",
2021-02-05 23:18:18 +01:00
url="https://platypush.tech",
2023-05-03 21:45:02 +02:00
packages=find_packages(exclude=['tests']),
2020-01-01 15:40:42 +01:00
include_package_data=True,
package_data={
'platypush': [
'migrations/alembic.ini',
'migrations/alembic/*',
'migrations/alembic/**/*',
'install/**',
'install/scripts/*',
'install/scripts/**/*',
'install/requirements/*',
'install/docker/*',
'components.json.gz',
],
},
2020-01-01 15:40:42 +01:00
entry_points={
2017-11-03 22:54:08 +01:00
'console_scripts': [
2018-01-04 16:11:54 +01:00
'platypush=platypush:main',
'platydock=platypush.platydock:main',
'platyvenv=platypush.platyvenv:main',
2017-11-03 22:54:08 +01:00
],
},
2020-01-01 15:40:42 +01:00
long_description=readfile('README.md'),
long_description_content_type='text/markdown',
classifiers=[
"Topic :: Utilities",
2017-11-03 23:09:19 +01:00
"License :: OSI Approved :: MIT License",
"Development Status :: 4 - Beta",
],
2020-01-01 15:40:42 +01:00
install_requires=[
'alembic',
'croniter',
'docutils',
'flask',
'frozendict',
'marshmallow',
'marshmallow_dataclass',
'psutil',
'python-dateutil',
'python-magic',
'pyyaml',
'redis',
'requests',
'rsa',
'sqlalchemy',
'tornado',
'websocket-client',
'websockets',
2020-06-21 13:09:41 +02:00
'wheel',
'zeroconf>=0.27.0',
2017-11-03 22:54:08 +01:00
],
extras_require=parse_manifests(),
)