Debian Codegraph @

setup.py

raw symbols SCIP
1 #!/usr/bin/env python3
2
3 # python setup.py sdist --format=zip,gztar
4
5 import os
6 import sys
7 import platform
8 import importlib.util
9 import argparse
10 import subprocess
11
12 from setuptools import setup, find_packages
13 from setuptools.command.install import install
14
15 MIN_PYTHON_VERSION = "3.10.0"
16 _min_python_version_tuple = tuple(map(int, (MIN_PYTHON_VERSION.split("."))))
17
18
19 if sys.version_info[:3] < _min_python_version_tuple:
20 sys.exit("Error: Electrum requires Python version >= %s..." % MIN_PYTHON_VERSION)
21
22 with open('contrib/requirements/requirements.txt') as f:
23 requirements = f.read().splitlines()
24
25 with open('contrib/requirements/requirements-hw.txt') as f:
26 requirements_hw = f.read().splitlines()
27
28 # load version.py; needlessly complicated alternative to "imp.load_source":
29 version_spec = importlib.util.spec_from_file_location('version', 'electrum/version.py')
30 version_module = version = importlib.util.module_from_spec(version_spec)
31 version_spec.loader.exec_module(version_module)
32
33 data_files = []
34
35 if platform.system() in ['Linux', 'FreeBSD', 'DragonFly']:
36 # note: we can't use absolute paths here. see #7787
37 data_files += [
38 (os.path.join('share', 'applications'), ['electrum.desktop']),
39 (os.path.join('share', 'pixmaps'), ['electrum/gui/icons/electrum.png']),
40 (os.path.join('share', 'icons/hicolor/128x128/apps'), ['electrum/gui/icons/electrum.png']),
41 ]
42
43 extras_require = {
44 'hardware': requirements_hw,
45 'gui': ['pyqt6'],
46 'crypto': ['cryptography>=2.6'],
47 'tests': ['pycryptodomex>=3.7', 'cryptography>=2.6', 'pyaes>=0.1a1'],
48 'qml_gui': ['pyqt6~=6.10.2', 'pyqt6-qt6~=6.10.2'], # should be same-ish version as Android build uses?
49 }
50 # 'full' extra that tries to grab everything an enduser would need (except for libsecp256k1...)
51 extras_require['full'] = [pkg for sublist in
52 (extras_require['hardware'], extras_require['gui'], extras_require['crypto'])
53 for pkg in sublist]
54 # legacy. keep 'fast' extra working
55 extras_require['fast'] = extras_require['crypto']
56
57
58 setup(
59 name="Electrum",
60 version=version.ELECTRUM_VERSION,
61 python_requires='>={}'.format(MIN_PYTHON_VERSION),
62 install_requires=requirements,
63 extras_require=extras_require,
64 packages=(['electrum',]
65 + [('electrum.'+pkg) for pkg in
66 find_packages('electrum', exclude=["tests"])]),
67 package_dir={
68 'electrum': 'electrum'
69 },
70 # Note: MANIFEST.in lists what gets included in the tar.gz, and the
71 # package_data kwarg lists what gets put in site-packages when pip installing the tar.gz.
72 # By specifying include_package_data=True, MANIFEST.in becomes responsible for both.
73 include_package_data=True,
74 scripts=['electrum/electrum'],
75 data_files=data_files,
76 description="Lightweight Bitcoin Wallet",
77 author="Thomas Voegtlin",
78 author_email="[email protected]",
79 license="MIT Licence",
80 url="https://electrum.org",
81 long_description="""Lightweight Bitcoin Wallet""",
82 )