-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathsetup.py
More file actions
78 lines (62 loc) · 2.66 KB
/
setup.py
File metadata and controls
78 lines (62 loc) · 2.66 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
# -*- coding: utf-8 -*-
"""
Setup.py for h3sed.
------------------------------------------------------------------------------
This file is part of h3sed - Heroes3 Savegame Editor.
Released under the MIT License.
@author Erki Suurjaak
@created 12.04.2020
@modified 11.06.2024
------------------------------------------------------------------------------
"""
import os
import re
import sys
import setuptools
ROOTPATH = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(ROOTPATH, "src"))
from h3sed import conf
PACKAGE = conf.Name.lower()
def readfile(path):
"""Returns contents of path, relative to current file."""
root = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(root, path)) as f: return f.read()
def get_description():
"""Returns package description from README."""
LINK_RGX = r"\[([^\]]+)\]\(([^\)]+)\)" # 1: content in [], 2: content in ()
linkify = lambda s: "#" + re.sub(r"[^\w -]", "", s).lower().replace(" ", "-")
# Unwrap local links like [Page link](#page-link) and [LICENSE.md](LICENSE.md)
repl = lambda m: m.group(1 if m.group(2) in (m.group(1), linkify(m.group(1))) else 0)
return re.sub(LINK_RGX, repl, readfile("README.md"))
setuptools.setup(
name = PACKAGE,
version = conf.Version,
description = conf.Title,
url = "https://github.com/suurjaak/h3sed",
author = "Erki Suurjaak",
author_email = "erki@lap.ee",
license = "MIT",
platforms = ["any"],
keywords = "homm homm3 heroes3 savegame",
install_requires = ["pyyaml", "step-template>=0.0.4", "wxPython>=4.0"],
entry_points = {"gui_scripts": ["{0} = {0}.main:run".format(PACKAGE)]},
package_dir = {"": "src"},
packages = [PACKAGE],
include_package_data = True, # Use MANIFEST.in for data files
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: End Users/Desktop",
"Operating System :: Microsoft :: Windows",
"Operating System :: Unix",
"Operating System :: MacOS",
"Topic :: Games/Entertainment",
"Topic :: Utilities",
"Topic :: Desktop Environment",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
],
long_description_content_type = "text/markdown",
long_description = get_description(),
)