-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
44 lines (35 loc) · 1.38 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
import json
import os
import pathlib
import setuptools
long_description = (pathlib.Path(__file__).parent / "README.md").read_text()
def get_requirements_from_pipfile_lock(pipfile_lock=None):
if pipfile_lock is None:
pipfile_lock = os.path.join(os.path.dirname(os.path.realpath(__file__)), "Pipfile.lock")
lock_data = json.load(open(pipfile_lock))
retval = []
for package_name, package_data in lock_data.get("default", {}).items():
if package_data.get("file"):
package_ref = f'{package_name} @ {package_data["file"]}'
else:
package_ref = f'{package_name}{package_data["version"]}'
retval.append(package_ref)
return retval
def generate_requirements_txt(pipfile_lock_requirements):
for requirement in pipfile_lock_requirements:
with open(os.path.join("requirements.txt"), "w") as file:
file.writelines(requirement)
requirements = get_requirements_from_pipfile_lock()
generate_requirements_txt(requirements)
setuptools.setup(
name="metatrader5EasyT",
version="0.1.11",
license="MIT",
author="Joao Paulo Euko",
url="https://github.com/Joaopeuko/metatrader5EasyT",
keywords=["metatrader5", "algotrading", "stock market"],
long_description=long_description,
long_description_content_type="text/markdown",
packages=setuptools.find_packages(),
install_requires=requirements,
)