|
22 | 22 | import codecs # To use a consistent encoding
|
23 | 23 | import setuptools
|
24 | 24 |
|
| 25 | + |
| 26 | +_pkg_root = "pwb_backtrader" |
| 27 | +_internal = setuptools.find_packages(where=_pkg_root) |
| 28 | +_public = ["backtrader"] + ["backtrader." + p for p in _internal] |
| 29 | + |
25 | 30 | here = os.path.abspath(os.path.dirname(__file__))
|
26 | 31 |
|
27 | 32 | # Get the long description from the relevant file
|
|
33 | 38 |
|
34 | 39 | # Get the version ... execfile is only on Py2 ... use exec + compile + open
|
35 | 40 | vname = "version.py"
|
36 |
| -with open(os.path.join(pname, vname)) as f: |
| 41 | +with open(os.path.join(pname, vname), encoding="utf-8") as f: |
37 | 42 | exec(compile(f.read(), vname, "exec"))
|
38 | 43 |
|
39 | 44 | # Generate links
|
|
91 | 96 | keywords=["trading", "development"],
|
92 | 97 | # You can just specify the packages manually here if your project is
|
93 | 98 | # simple. Or you can use find_packages().
|
94 |
| - packages=setuptools.find_packages() + ["backtrader"], |
95 |
| - package_dir={"backtrader": "backtrader", "pwb_backtrader": "pwb_backtrader"}, |
| 99 | + packages=["backtrader"] + _public, # every sub-package |
| 100 | + package_dir={"backtrader": _pkg_root}, |
| 101 | + include_package_data=True, # pick up data files |
| 102 | + install_requires=["tqdm"], |
| 103 | + extras_require={"plotting": ["matplotlib"]}, |
| 104 | + entry_points={"console_scripts": ["btrun=backtrader.btrun:btrun"]}, |
96 | 105 | # packages=['backtrader', '],
|
97 | 106 | # List run-time dependencies here.
|
98 | 107 | # These will be installed by pip when your
|
99 | 108 | # project is installed. For an analysis of "install_requires" vs pip's
|
100 | 109 | # requirements files see:
|
101 | 110 | # https://packaging.python.org/en/latest/requirements.html
|
102 |
| - install_requires=["tqdm"], |
103 | 111 | # List additional groups of dependencies here
|
104 | 112 | # (e.g. development dependencies).
|
105 | 113 | # You can install these using the following syntax, for example:
|
106 | 114 | # $ pip install -e .[dev,test]
|
107 |
| - extras_require={ |
108 |
| - "plotting": ["matplotlib"], |
109 |
| - }, |
110 | 115 | # If there are data files included in your packages that need to be
|
111 | 116 | # installed, specify them here. If using Python 2.6 or less, then these
|
112 | 117 | # have to be included in MANIFEST.in as well.
|
|
120 | 125 | # "scripts" keyword. Entry points provide cross-platform support and allow
|
121 | 126 | # pip to create the appropriate form of executable for the target platform.
|
122 | 127 | # entry_points={'console_scripts': ['sample=sample:main',],},
|
123 |
| - entry_points={"console_scripts": ["btrun=backtrader.btrun:btrun"]}, |
124 | 128 | scripts=["tools/bt-run.py"],
|
125 | 129 | )
|
0 commit comments