-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathsetup.py
More file actions
124 lines (113 loc) · 4.72 KB
/
Copy pathsetup.py
File metadata and controls
124 lines (113 loc) · 4.72 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
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import logging
import re
from setuptools import find_packages, setup
readme_dir = os.path.dirname(__file__)
readme_filename = os.path.join(readme_dir, "README.md")
try:
with open(readme_filename, "r") as f:
readme = f.read()
except:
logging.warning("Failed to load %s" % readme_filename)
readme = ""
def readme_for_pypi(text):
# PyPI's Markdown renderer (cmark-gfm) does not support GitHub's
# "> [!IMPORTANT]" alert syntax and would display the literal "[!IMPORTANT]"
# token. Convert each alert marker line to a bold label so the PyPI
# long_description renders as a clean blockquote. GitHub keeps the colored
# callout because README.md on disk is unchanged.
import re
labels = {
"NOTE": "Note",
"TIP": "Tip",
"IMPORTANT": "Important",
"WARNING": "Warning",
"CAUTION": "Caution",
}
return re.sub(
r"(?m)^(\s*>\s*)\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\][ \t]*$",
lambda m: "%s**%s**" % (m.group(1), labels[m.group(2)]),
text,
)
with open("mhcflurry/version.py", "r") as f:
version = re.search(
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', f.read(), re.MULTILINE
).group(1)
if __name__ == "__main__":
required_packages = [
"pandas>=2.0",
"appdirs",
"ahocorasick-rs",
"scikit-learn",
"mhcgnomes>=3.0.1",
"numpy>=1.22.4",
"pyyaml",
"tqdm",
"torch>=2.0.0",
]
setup(
name="mhcflurry",
version=version,
description="MHC Binding Predictor",
author="Tim O'Donnell and Alex Rubinsteyn",
author_email="timodonnell@gmail.com",
url="https://github.com/openvax/mhcflurry",
license="Apache-2.0",
entry_points={
"console_scripts": [
"mhcflurry = mhcflurry.cli.main:main",
"mhcflurry-downloads = mhcflurry.cli.downloads_command:run",
"mhcflurry-pseudosequences = mhcflurry.pseudosequences:main",
"mhcflurry-predict = mhcflurry.cli.predict_command:run",
"mhcflurry-predict-scan = mhcflurry.cli.predict_scan_command:run",
"mhcflurry-class1-train-allele-specific-models = "
"mhcflurry.cli.train_allele_specific_models_command:run",
"mhcflurry-class1-train-pan-allele-models = "
"mhcflurry.cli.train_pan_allele_models_command:run",
"mhcflurry-class1-train-processing-models = "
"mhcflurry.cli.train_processing_models_command:run",
"mhcflurry-class1-select-allele-specific-models = "
"mhcflurry.cli.select_allele_specific_models_command:run",
"mhcflurry-class1-select-pan-allele-models = "
"mhcflurry.cli.select_pan_allele_models_command:run",
"mhcflurry-class1-select-processing-models = "
"mhcflurry.cli.select_processing_models_command:run",
"mhcflurry-calibrate-percentile-ranks = "
"mhcflurry.cli.calibrate_percentile_ranks_command:run",
"mhcflurry-class1-train-presentation-models = "
"mhcflurry.cli.train_presentation_models_command:run",
"_mhcflurry-cluster-worker-entry-point = "
"mhcflurry.cluster_parallelism:worker_entry_point",
]
},
python_requires=">=3.10",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Bio-Informatics",
],
package_data={
"mhcflurry": ["downloads.yml"],
},
install_requires=required_packages,
long_description=readme_for_pypi(readme),
long_description_content_type="text/markdown",
packages=find_packages(include=["mhcflurry", "mhcflurry.*"]),
)