-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
109 lines (86 loc) · 3.18 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
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
# cspell: disable
import re
import pathlib
from setuptools import setup, find_packages
BANNER_PATH_PAT = r"\[\#repo-banner\]\:\s+(?P<path>.*)\s*\n"
BANNER_PATH_PAT = re.compile(BANNER_PATH_PAT)
CONTENT_PATH_PREFIX = r"https://raw.githubusercontent.com/sugatoray/genespeak/master/"
def update_banner_path(readme_path: str = "README.md") -> str:
"""Converts the relative path of the banner into a parmalink.
The banner is made avilable in the readme file as follows:
--------------------------------------------------------------
![genespeak-banner][#repo-banner]
[#repo-banner]: docs/assets/images/genespeak_banner_01.png
--------------------------------------------------------------
This function replaces the target line's <path> value ([#repo-banner]: <path>)
with CONTENT_PATH_PREFIX + <path>.
CONTENT_PATH_PREFIX = r"https://raw.githubusercontent.com/sugatoray/genespeak/master/"
"""
text = pathlib.Path("README.md").read_text()
res = BANNER_PATH_PAT.search(text)
replace_with = r"[#repo-banner]: " + CONTENT_PATH_PREFIX + res.groupdict().get("path") + "\n\n" # type: ignore
mod_text = BANNER_PATH_PAT.sub(replace_with, text)
return mod_text
base_packages = []
docs_packages = [
"mkdocs>=1.2.3",
"mkdocs-material==8.1.3",
"mkdocstrings>=0.17.0",
"mktestdocs==0.1.2",
"pygments>=2.10",
"pymdown-extensions>=9.0",
]
test_packages = [
"interrogate>=1.5.0",
"flake8>=4.0.1",
"pytest>=6.2.5",
"black>=21.12b0",
"isort>=5.10.1",
"pre-commit>=2.16.0",
"pre-commit-hooks>=4.0.0" "flake8-print>=4.0.0",
"flake8-black>=0.2.3",
]
build_packages = [
"twine",
"setuptools",
"build",
"pkginfo>=1.8.2",
]
all_packages = base_packages
dev_packages = all_packages + docs_packages + test_packages + build_packages
README: str = update_banner_path(readme_path="README.md")
setup(
name="genespeak",
version="0.0.10.dev2",
author="Sugato Ray",
author_email="[email protected]",
python_requires=">=3.7",
keywords="genespeak encoding decoding text-to-dna dna-to-text",
packages=find_packages(
include=["genespeak"], exclude=["notebooks", "docs", "test*"]
),
description="A library to encode text as DNA and decode DNA to text.",
long_description=README,
long_description_content_type="text/markdown",
url="https://github.com/sugatoray/genespeak/",
project_urls={
"Documentation": "https://sugatoray.github.io/genespeak/",
"Source Code": "https://github.com/sugatoray/genespeak/",
"Issue Tracker": "https://github.com/sugatoray/genespeak/issues",
},
install_requires=base_packages,
extras_require={"dev": dev_packages},
tests_require=test_packages,
test_suite="tests",
license_files=("LICENSE",),
classifiers=[
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"License :: OSI Approved :: MIT License",
"Topic :: Scientific/Engineering",
],
)