-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsetup.py
More file actions
137 lines (120 loc) · 5.1 KB
/
setup.py
File metadata and controls
137 lines (120 loc) · 5.1 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
"""
Installation
------------
To install the `eth-portfolio` package, you should start with a fresh virtual environment.
Due to the use of :mod:`setuptools_scm` for versioning, it is recommended to clone the repository first
to ensure the version can be determined correctly.
The `setup.py` file automatically handles the installation of :mod:`setuptools_scm` and :mod:`cython`,
so you do not need to install them manually before running the setup process. Additionally,
the `requirements.txt` file is used to specify additional dependencies that are installed via
the `install_requires` parameter. Note that the last line of `requirements.txt` is intentionally excluded
from installation, so ensure that any necessary dependency is not placed on the last line.
Example:
.. code-block:: bash
git clone https://github.com/BobTheBuidler/eth-portfolio.git
cd eth-portfolio
pip install .
If you encounter issues with :mod:`PyYaml` and :mod:`Cython`, you can resolve them by installing specific versions:
Example:
.. code-block:: bash
pip install wheel
pip install --no-build-isolation "Cython<3" "pyyaml==5.4.1"
pip install .
See Also:
- :mod:`setuptools_scm`: For more information on versioning with setuptools_scm.
- :mod:`cython`: For more information on Cython.
- :mod:`requirements.txt`: For more information on managing dependencies.
"""
import logging
import sys
from pathlib import Path
from setuptools import Extension, find_packages, setup
SKIP_MYPYC = any(
cmd in sys.argv
for cmd in ("sdist", "egg_info", "--name", "--version", "--help", "--help-commands")
)
requirements = list(map(str.strip, Path("requirements.txt").read_text().split("\n")))[:-1]
ext_modules: list[Extension] = []
if not SKIP_MYPYC:
from mypyc.build import mypycify
ext_modules.extend(
mypycify(
[
"eth_portfolio/_loaders/_nonce.py",
"eth_portfolio/_loaders/balances.py",
"eth_portfolio/_loaders/utils.py",
# NOTE: disabled until https://github.com/mypyc/mypyc/issues/1112 is fixed
# "eth_portfolio/protocols/dsr.py",
# NOTE: disabled until https://github.com/mypyc/mypyc/issues/1113 is fixed
# "eth_portfolio/typing/balance/single.py",
"eth_portfolio/_argspec.py",
"eth_portfolio/_config.py",
"eth_portfolio/_shitcoins.py",
"eth_portfolio/_stableish.py",
# "eth_portfolio/_submodules.py",
"eth_portfolio/constants.py",
"eth_portfolio_scripts/docker",
# "eth_portfolio_scripts/victoria/__init__.py", # this one built fine with other files but wont alone
# "eth_portfolio_scripts/_portfolio.py",
# "eth_portfolio_scripts/_utils.py",
"eth_portfolio_scripts/balances.py",
"--strict",
"--pretty",
"--install-types",
"--disable-error-code=unused-ignore",
"--disable-error-code=import-not-found",
# temporary
"--disable-error-code=call-arg",
"--disable-error-code=untyped-decorator",
"--disable-error-code=type-arg",
"--disable-error-code=attr-defined",
"--disable-error-code=no-any-return",
"--disable-error-code=arg-type",
"--disable-error-code=no-untyped-call",
"--disable-error-code=no-untyped-def",
"--disable-error-code=override",
"--disable-error-code=var-annotated",
"--disable-error-code=return-value",
"--disable-error-code=assignment",
"--disable-error-code=union-attr",
"--disable-error-code=no-redef",
"--disable-error-code=valid-type",
"--disable-error-code=call-overload",
"--disable-error-code=dict-item",
"--disable-error-code=has-type",
"--disable-error-code=typeddict-item",
"--disable-error-code=index",
"--disable-error-code=misc",
],
group_name="eth_portfolio",
)
)
setup(
name="eth_portfolio",
python_requires=">=3.10,<3.14",
packages=find_packages(),
use_scm_version={
"root": ".",
"relative_to": __file__,
"local_scheme": "no-local-version",
"version_scheme": "python-simplified-semver",
},
description="eth-portfolio makes it easy to analyze your portfolio.",
author="BobTheBuidler",
author_email="bobthebuidlerdefi@gmail.com",
url="https://github.com/BobTheBuidler/eth-portfolio",
install_requires=requirements,
setup_requires=["setuptools_scm"],
package_data={
"eth_portfolio": ["py.typed"],
"eth_portfolio_scripts": ["py.typed"],
},
include_package_data=True,
ext_modules=ext_modules,
zip_safe=False,
entry_points={
"console_scripts": [
"eth-portfolio=eth_portfolio_scripts.main:main",
],
},
)