-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
49 lines (40 loc) · 1.54 KB
/
setup.py
File metadata and controls
49 lines (40 loc) · 1.54 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
import os
import sys
import setuptools
import pathlib
# create __init__ in each namespace and export everything
source = "." + os.sep + "eolymp"
pathlib.Path(source + os.sep + "__init__.py").touch()
for module in os.listdir(source):
module_path = source + os.sep + module
if not os.path.isdir(module_path):
continue
module_init = module_path + os.sep + "__init__.py"
print("creating", module_init, "file")
with open(module_init, "w", encoding="utf-8") as mi:
for file in os.listdir(module_path):
name = os.path.splitext(file)
ext = name[1] if len(name) > 1 else ''
if os.path.isdir(module_path + os.sep + file) or ext != '.py' or name[0] == '__init__':
continue
mi.write("from .{} import *\n".format(name[0]))
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="eolymp",
version=os.getenv("RELEASE_VERSION"),
author="Sergey Kolodyazhnyy",
author_email="sergey@eolymp.com",
description="Eolymp SDK for Python",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/eolymp/contracts",
packages=setuptools.find_packages(),
package_data={package: ["py.typed", "*.pyi", "**/*.pyi"] for package in setuptools.find_packages()},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.0',
)