-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathsetup.py
More file actions
62 lines (55 loc) · 1.74 KB
/
Copy pathsetup.py
File metadata and controls
62 lines (55 loc) · 1.74 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
"""Setup script for ``alignparse``."""
import re
import sys
from setuptools import setup
if not (sys.version_info[0] == 3 and sys.version_info[1] >= 8):
raise RuntimeError(
"alignparse requires Python >=3.8.\n"
f"You are using {sys.version_info[0]}.{sys.version_info[1]}."
)
# get metadata from package `__init__.py` file as here:
# https://packaging.python.org/guides/single-sourcing-package-version/
metadata = {}
init_file = "alignparse/__init__.py"
with open(init_file) as f:
init_text = f.read()
for dataname in ["version", "author", "email", "url"]:
matches = re.findall("__" + dataname + r'__\s+=\s+[\'"]([^\'"]+)[\'"]', init_text)
if len(matches) != 1:
raise ValueError(
f"found {len(matches)} matches for {dataname} " f"in {init_file}"
)
else:
metadata[dataname] = matches[0]
with open("README.rst") as f:
readme = f.read()
# main setup command
setup(
name="alignparse",
version=metadata["version"],
author=metadata["author"],
author_email=metadata["email"],
url=metadata["url"],
download_url="https://github.com/jbloomlab/alignparse/tarball/"
+ metadata["version"], # tagged version on GitHub
description="Align sequences and then parse features.",
long_description=readme,
license="GPLv3",
install_requires=[
"biopython>=1.73",
"dna_features_viewer>=1.0.0",
"matplotlib>=3.0.0",
"numpy>=1.17",
"packaging",
"pandas>=0.25.1",
"pathos>=0.2.4",
"plotnine>=0.6",
"pysam!=0.22.1",
"regex>=2.5.33",
"scipy>=1.2",
"pyyaml>=5.1.1",
],
platforms="Linux and Mac OS X.",
packages=["alignparse"],
package_dir={"alignparse": "alignparse"},
)