-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathsetup.py
More file actions
130 lines (118 loc) · 3.96 KB
/
setup.py
File metadata and controls
130 lines (118 loc) · 3.96 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
"""Packaging configuration for domonic."""
import os
import re
from setuptools import find_packages, setup
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
def read(filename: str) -> str:
"""Returns the contents of a file.
Args:
filename (str): The name of the file to read.
Returns:
str: content of the file
"""
with open(os.path.join(BASE_DIR, filename), encoding="utf-8") as file:
return file.read()
def get_version() -> str:
"""Read the package version without importing domonic during setup."""
version_file = read(os.path.join("domonic", "__init__.py"))
match = re.search(r'^__version__\s*=\s*"([^"]+)"', version_file, re.MULTILINE)
if not match:
raise RuntimeError("Unable to find package version.")
return match.group(1)
def get_requirements(filename: str = "requirements.txt"):
"""returns a list of all requirements"""
requirements = read(filename)
return list(
filter(
None,
[req.strip() for req in requirements.split() if not req.startswith("#")],
)
)
setup(
name="domonic",
version=get_version(),
author="byteface",
author_email="byteface@gmail.com",
license="MIT",
url="https://github.com/byteface/domonic",
project_urls={
"Documentation": "https://domonic.readthedocs.io/",
"Source": "https://github.com/byteface/domonic",
"Tracker": "https://github.com/byteface/domonic/issues",
"Examples": "https://github.com/byteface/domonic/tree/master/examples",
"Releases": "https://github.com/byteface/domonic/releases",
},
description="A Python DOM far beyond minidom, with HTML, SVG, events, web APIs, and a JavaScript-like runtime.",
long_description=read("README.md"),
long_description_content_type="text/markdown",
keywords=[
"html",
"generate",
"templating",
"dom",
"vdom",
"terminal",
"json",
"web",
"template",
"javascript",
"DOM",
"GUI",
"render",
"website",
"apps",
"html5",
"framework",
"SVG",
"x3d",
"events",
"geom",
"whatwg",
"web api",
"custom elements",
"shadow dom",
"css selectors",
"html parser",
"animation",
"dom manipulation",
],
python_requires=">=3.10",
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: JavaScript",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"Intended Audience :: Other Audience",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Topic :: Internet",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Multimedia :: Graphics :: Presentation",
"Topic :: Software Development",
"Topic :: Software Development :: Code Generators",
"Topic :: Software Development :: User Interfaces",
"Topic :: Terminals",
"Topic :: Utilities",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Text Processing :: Markup :: HTML",
"Topic :: Text Processing :: Markup :: XML",
],
install_requires=get_requirements(),
packages=find_packages(exclude=("tests", "tests.*")),
include_package_data=True,
license_files=("LICENSE.txt",),
entry_points={
"console_scripts": [
"domonic = domonic.__main__:run",
],
},
)