1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
#!/usr/bin/env python3
# SPDX-License-Identifier: CC0-1.0
# Setup script
#
# This file is part of Hydrilla
#
# Copyright (C) 2021 Wojtek Kosior
#
# This file is free software: you can redistribute it with or without
# modification under the terms of the CC0 1.0 Universal License as
# published by the Creative Commons Corporation.
#
# This file is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# CC0 1.0 Universal License for more details.
from setuptools import setup, find_packages
import sys
import pathlib
def files_find(package_path, subpath, rglob):
package_path = pathlib.Path(package_path)
for path in (package_path / subpath).rglob(rglob):
if not path.is_dir():
yield str(path.relative_to(package_path))
settings = {}
settings['version'] = '0.2'
settings['app_package_name'] = 'pydrilla'
settings['project_root'] = pathlib.Path(__file__).resolve().parent
packages_root = settings['project_root'] / 'src'
main_package_dir = packages_root / settings['app_package_name']
test_dir = packages_root / 'test'
settings['locales_dir'] = main_package_dir / 'locales'
settings['config_path'] = test_dir / 'development_config.json'
sys.path.insert(0, str(packages_root))
import test
import pydrilla_dev_helper
helper = pydrilla_dev_helper.Helper(**settings)
setup(
name=settings['app_package_name'],
version=settings['version'],
description='Hydrilla repository server (Python implementation)',
# long_description='...',
# long_description_content_type='text/plain',
url='https://hydrillabugs.koszko.org',
author='Wojtek Kosior',
author_email='koszko@koszko.org',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Environment :: Web Environment',
'Framework :: Flask',
'Topic :: Internet :: WWW/HTTP :: WSGI',
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
'Natural Language :: English',
'Programming Language :: Python :: 3 :: Only'
],
package_dir={'': 'src'},
packages=find_packages(where='src'),
zip_safe=False,
install_requires=['flask'],
extras_require={
'test': ['pytest'],
},
package_data={
'pydrilla': ['config.json', *helper.locale_files_relative(),
*files_find(main_package_dir, 'templates', '*.html')],
'test': [*files_find(packages_root / 'test', 'example_content', '*'),
'development_config.json']
},
cmdclass=helper.commands()
# project_urls={
# 'Bug Reports': 'https://',
# 'Funding': 'https://',
# 'Say Thanks!': 'http://',
# 'Source': 'https://',
# },
)
|