2017-11-03 12:41:15 +01:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
2024-05-17 00:47:23 +02:00
|
|
|
import json
|
2017-11-03 12:34:47 +01:00
|
|
|
import os
|
2024-05-17 00:47:23 +02:00
|
|
|
|
2020-06-10 12:37:26 +02:00
|
|
|
from setuptools import setup, find_packages
|
2017-11-03 12:34:47 +01:00
|
|
|
|
2019-05-23 18:51:28 +02:00
|
|
|
|
|
|
|
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 12:34:47 +01:00
|
|
|
|
2017-11-03 15:06:29 +01:00
|
|
|
def pkg_files(dir):
|
|
|
|
paths = []
|
2024-05-17 00:47:23 +02:00
|
|
|
for p, _, files in os.walk(dir):
|
2017-11-03 15:06:29 +01:00
|
|
|
for file in files:
|
2024-05-17 00:47:23 +02:00
|
|
|
paths.append(os.path.join('..', p, file))
|
2017-11-03 15:06:29 +01:00
|
|
|
return paths
|
|
|
|
|
2019-05-23 18:51:28 +02:00
|
|
|
|
2024-05-17 00:47:23 +02:00
|
|
|
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+'):
|
|
|
|
repo_name = dep.split('/')[-1].split('.git')[0]
|
|
|
|
dep = f'{repo_name} @ {dep}'
|
|
|
|
|
|
|
|
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
|
|
|
|
2017-11-03 12:34:47 +01:00
|
|
|
setup(
|
2020-01-01 15:40:42 +01:00
|
|
|
name="platypush",
|
2024-05-26 00:44:20 +02:00
|
|
|
version="0.99.0",
|
2020-01-01 15:40:42 +01:00
|
|
|
author="Fabio Manganiello",
|
2023-07-22 23:02:44 +02:00
|
|
|
author_email="fabio@manganiello.tech",
|
2020-01-01 15:40:42 +01:00
|
|
|
description="Platypush service",
|
|
|
|
license="MIT",
|
2020-08-22 15:28:52 +02:00
|
|
|
python_requires='>= 3.6',
|
2021-09-16 17:53:40 +02:00
|
|
|
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,
|
2023-04-29 11:32:31 +02:00
|
|
|
package_data={
|
2023-04-29 23:48:06 +02:00
|
|
|
'platypush': [
|
|
|
|
'migrations/alembic.ini',
|
|
|
|
'migrations/alembic/*',
|
|
|
|
'migrations/alembic/**/*',
|
2023-09-28 01:25:01 +02:00
|
|
|
'install/**',
|
|
|
|
'install/scripts/*',
|
|
|
|
'install/scripts/**/*',
|
|
|
|
'install/requirements/*',
|
|
|
|
'install/docker/*',
|
2024-01-06 22:21:59 +01:00
|
|
|
'components.json.gz',
|
2023-04-29 23:48:06 +02:00
|
|
|
],
|
2023-04-29 11:32:31 +02:00
|
|
|
},
|
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',
|
2018-12-19 02:08:13 +01:00
|
|
|
'platydock=platypush.platydock:main',
|
2023-08-22 23:49:37 +02:00
|
|
|
'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=[
|
2017-11-03 12:34:47 +01:00
|
|
|
"Topic :: Utilities",
|
2017-11-03 23:09:19 +01:00
|
|
|
"License :: OSI Approved :: MIT License",
|
2020-08-22 15:28:52 +02:00
|
|
|
"Development Status :: 4 - Beta",
|
2017-11-03 12:34:47 +01:00
|
|
|
],
|
2020-01-01 15:40:42 +01:00
|
|
|
install_requires=[
|
2023-05-05 00:07:13 +02:00
|
|
|
'alembic',
|
|
|
|
'croniter',
|
2023-05-09 21:59:36 +02:00
|
|
|
'docutils',
|
2023-05-05 00:07:13 +02:00
|
|
|
'flask',
|
|
|
|
'frozendict',
|
|
|
|
'marshmallow',
|
|
|
|
'marshmallow_dataclass',
|
2023-08-15 11:12:21 +02:00
|
|
|
'psutil',
|
2023-05-05 00:07:13 +02:00
|
|
|
'python-dateutil',
|
|
|
|
'python-magic',
|
2017-11-09 05:04:48 +01:00
|
|
|
'pyyaml',
|
2018-06-14 12:37:09 +02:00
|
|
|
'redis',
|
2018-12-18 19:01:51 +01:00
|
|
|
'requests',
|
2023-05-05 00:07:13 +02:00
|
|
|
'rsa',
|
2023-04-24 22:52:17 +02:00
|
|
|
'sqlalchemy',
|
2023-05-07 19:38:40 +02:00
|
|
|
'tornado',
|
2020-01-20 11:47:10 +01:00
|
|
|
'websocket-client',
|
2023-05-07 19:38:40 +02:00
|
|
|
'websockets',
|
2020-06-21 13:09:41 +02:00
|
|
|
'wheel',
|
2020-08-14 02:16:46 +02:00
|
|
|
'zeroconf>=0.27.0',
|
2017-11-03 22:54:08 +01:00
|
|
|
],
|
2024-05-17 00:47:23 +02:00
|
|
|
extras_require=parse_manifests(),
|
2017-11-03 12:34:47 +01:00
|
|
|
)
|