forked from karlicoss/promnesia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
107 lines (92 loc) · 3.53 KB
/
setup.py
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# see https://github.com/karlicoss/pymplate for up-to-date reference
from itertools import chain
from setuptools import setup, find_namespace_packages # type: ignore
def main() -> None:
pkgs = find_namespace_packages('src')
pkg = min(pkgs)
setup(
name=pkg,
use_scm_version={
'version_scheme': 'python-simplified-semver',
'local_scheme': 'dirty-tag',
},
# NOTE: there is some issue on circleci windows when running pip3 install --user -e . because of setuptools_scm?
# some CERTIFICATE_VERIFY_FAILED stuff. comment this temporary if you're debugging
setup_requires=['setuptools_scm'],
zip_safe=False,
packages=pkgs, # TODO ugh. that's weird. it worked as only ['promnesia'] when installing via PIP ... but not with dev install???
package_dir={'': 'src'},
package_data={pkg: ['py.typed']},
url='https://github.com/karlicoss/promnesia',
author='Dmitrii Gerasimov',
author_email='[email protected]',
description='Enhancement of your browsing history',
python_requires='>=3.6',
install_requires=[
'appdirs', # for portable user directories detection
'tzlocal',
'more_itertools',
'pytz',
'sqlalchemy', # DB api
'cachew>=0.8.0', # caching with type hints
'idna<3', # temporary, can remove after https://github.com/psf/requests/issues/5710 is resolved
*DEPS_INDEXER,
*DEPS_SERVER,
],
extras_require={
'testing': [
'pytest',
'pytest-xdist', # why??
'psutil',
'httpie', # nicer http requests (replace with curl?)
'selenium', # browser automations
'click', # confirmations for end2end test (might remove dependency)
],
'linting': [
'pytest',
'mypy',
'lxml', # for coverage reports
],
**{k[0]: v for k, v in DEPS_SOURCES.items()},
'all': list(chain.from_iterable(DEPS_SOURCES.values())),
},
entry_points={
'console_scripts': ['promnesia=promnesia.__main__:main'],
}
)
# todo might be nice to ensure they are installable in separation?
DEPS_INDEXER = [
'urlextract',
]
DEPS_SERVER = [
'hug',
]
DEPS_SOURCES = {
# TODO make cachew optional?
# althrough server uses it so not sure...
('optional', 'dependencies that bring some bells & whistles'): [
'logzero', # pretty colored logging
'python-magic', # better mimetype decetion
],
('HPI' , 'dependencies for [[https://github.com/karlicoss/HPI][HPI]]'): [
'HPI', # pypi version
# 'HPI @ git+https://github.com/karlicoss/hpi.git', # uncomment to test against github version (useful for one-off CI run)
# 'HPI @ git+file:///DUMMY/path/to/local/hpi@branch', # uncomment to test against version on the disc
# note: sometimes you need to use file://DUMMY?? wtf?..
],
('html' , 'dependencies for sources.html' ): [
'beautifulsoup4', # extracting links from the page
'lxml' , # bs4 backend
],
('markdown', 'dependencies for sources.markdown'): [
'mistletoe',
],
('org' , 'dependencies for sources.org' ): [
'orgparse>=0.2.0',
],
('telegram', 'dependencies for sources.telegram'): [
'dataset',
],
}
if __name__ == "__main__":
main()