2017-02-05 14:31:17 +03:00
|
|
|
#!/usr/bin/env python3
|
2011-11-16 13:53:18 +03:00
|
|
|
|
2011-11-29 10:32:56 +01:00
|
|
|
# python setup.py sdist --format=zip,gztar
|
2011-11-16 13:53:18 +03:00
|
|
|
|
2013-11-12 19:33:47 -08:00
|
|
|
import os
|
|
|
|
|
import sys
|
|
|
|
|
import platform
|
2018-09-28 02:47:36 +02:00
|
|
|
import importlib.util
|
2016-02-29 13:21:54 +01:00
|
|
|
import argparse
|
2018-08-30 16:16:14 +02:00
|
|
|
import subprocess
|
|
|
|
|
|
|
|
|
|
from setuptools import setup, find_packages
|
|
|
|
|
from setuptools.command.install import install
|
2013-11-12 19:33:47 -08:00
|
|
|
|
2025-01-10 13:16:04 +00:00
|
|
|
MIN_PYTHON_VERSION = "3.10.0"
|
2018-09-28 02:47:36 +02:00
|
|
|
_min_python_version_tuple = tuple(map(int, (MIN_PYTHON_VERSION.split("."))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if sys.version_info[:3] < _min_python_version_tuple:
|
2019-02-15 22:06:10 +01:00
|
|
|
sys.exit("Error: Electrum requires Python version >= %s..." % MIN_PYTHON_VERSION)
|
2018-09-28 02:47:36 +02:00
|
|
|
|
2018-02-11 16:27:01 +01:00
|
|
|
with open('contrib/requirements/requirements.txt') as f:
|
2017-12-17 15:22:10 -04:00
|
|
|
requirements = f.read().splitlines()
|
|
|
|
|
|
2018-02-11 16:27:01 +01:00
|
|
|
with open('contrib/requirements/requirements-hw.txt') as f:
|
2017-12-26 01:27:44 +01:00
|
|
|
requirements_hw = f.read().splitlines()
|
|
|
|
|
|
2018-09-28 02:47:36 +02:00
|
|
|
# load version.py; needlessly complicated alternative to "imp.load_source":
|
|
|
|
|
version_spec = importlib.util.spec_from_file_location('version', 'electrum/version.py')
|
|
|
|
|
version_module = version = importlib.util.module_from_spec(version_spec)
|
|
|
|
|
version_spec.loader.exec_module(version_module)
|
2014-11-22 14:03:21 +01:00
|
|
|
|
2018-03-07 15:15:54 -05:00
|
|
|
data_files = []
|
2015-10-18 12:43:20 +02:00
|
|
|
|
|
|
|
|
if platform.system() in ['Linux', 'FreeBSD', 'DragonFly']:
|
2022-05-06 16:32:06 +02:00
|
|
|
# note: we can't use absolute paths here. see #7787
|
2012-06-10 15:43:10 +02:00
|
|
|
data_files += [
|
2022-05-06 16:32:06 +02:00
|
|
|
(os.path.join('share', 'applications'), ['electrum.desktop']),
|
|
|
|
|
(os.path.join('share', 'pixmaps'), ['electrum/gui/icons/electrum.png']),
|
|
|
|
|
(os.path.join('share', 'icons/hicolor/128x128/apps'), ['electrum/gui/icons/electrum.png']),
|
2012-07-05 01:41:07 +02:00
|
|
|
]
|
2014-09-13 09:58:11 +02:00
|
|
|
|
2018-05-24 18:57:13 +02:00
|
|
|
extras_require = {
|
|
|
|
|
'hardware': requirements_hw,
|
2024-09-16 16:02:08 +00:00
|
|
|
'gui': ['pyqt6'],
|
2020-12-08 16:35:29 +01:00
|
|
|
'crypto': ['cryptography>=2.6'],
|
|
|
|
|
'tests': ['pycryptodomex>=3.7', 'cryptography>=2.6', 'pyaes>=0.1a1'],
|
2026-02-18 14:40:20 +01:00
|
|
|
'qml_gui': [
|
|
|
|
|
'pyqt6>=6.7.0,<6.8.0',
|
|
|
|
|
'pyqt6-qt6>=6.7.0,<6.8.0',
|
|
|
|
|
'pyqt6-sip==13.10.2',
|
|
|
|
|
],
|
2018-05-24 18:57:13 +02:00
|
|
|
}
|
2020-03-04 19:39:48 +01:00
|
|
|
# 'full' extra that tries to grab everything an enduser would need (except for libsecp256k1...)
|
2020-06-11 04:52:56 +02:00
|
|
|
extras_require['full'] = [pkg for sublist in
|
|
|
|
|
(extras_require['hardware'], extras_require['gui'], extras_require['crypto'])
|
|
|
|
|
for pkg in sublist]
|
2020-03-04 19:39:48 +01:00
|
|
|
# legacy. keep 'fast' extra working
|
|
|
|
|
extras_require['fast'] = extras_require['crypto']
|
2018-08-30 16:16:14 +02:00
|
|
|
|
|
|
|
|
|
2013-11-12 19:33:47 -08:00
|
|
|
setup(
|
2025-11-24 08:35:40 +01:00
|
|
|
name="Pallectrum",
|
2013-11-12 19:33:47 -08:00
|
|
|
version=version.ELECTRUM_VERSION,
|
2018-09-28 02:47:36 +02:00
|
|
|
python_requires='>={}'.format(MIN_PYTHON_VERSION),
|
2017-12-17 15:22:10 -04:00
|
|
|
install_requires=requirements,
|
2018-05-24 18:57:13 +02:00
|
|
|
extras_require=extras_require,
|
2022-05-04 19:27:05 +02:00
|
|
|
packages=(['electrum',]
|
|
|
|
|
+ [('electrum.'+pkg) for pkg in
|
2023-08-30 13:11:33 +00:00
|
|
|
find_packages('electrum', exclude=["tests"])]),
|
2013-11-12 19:33:47 -08:00
|
|
|
package_dir={
|
2018-07-11 17:38:47 +02:00
|
|
|
'electrum': 'electrum'
|
2013-11-12 19:33:47 -08:00
|
|
|
},
|
2021-03-27 03:44:00 +01:00
|
|
|
# Note: MANIFEST.in lists what gets included in the tar.gz, and the
|
|
|
|
|
# package_data kwarg lists what gets put in site-packages when pip installing the tar.gz.
|
|
|
|
|
# By specifying include_package_data=True, MANIFEST.in becomes responsible for both.
|
|
|
|
|
include_package_data=True,
|
2018-07-11 17:38:47 +02:00
|
|
|
scripts=['electrum/electrum'],
|
2013-11-12 19:33:47 -08:00
|
|
|
data_files=data_files,
|
2025-11-24 08:35:40 +01:00
|
|
|
description="Lightweight Palladium Wallet",
|
|
|
|
|
author="Pallectrum Project",
|
|
|
|
|
author_email="",
|
2016-02-23 11:36:42 +01:00
|
|
|
license="MIT Licence",
|
2025-11-24 08:35:40 +01:00
|
|
|
url="https://github.com/palladium-coin/pallectrum",
|
|
|
|
|
long_description="""Lightweight Palladium Wallet""",
|
2012-05-10 14:38:49 +02:00
|
|
|
)
|