-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
116 lines (101 loc) · 4.17 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
110
111
112
113
114
115
116
# Copyright 2024 by Peter Cock, The James Hutton Institute.
# All rights reserved.
# This file is part of the THAPBI Phytophthora ITS1 Classifier Tool (PICT),
# and is released under the "MIT License Agreement". Please see the LICENSE
# file that should have been included as part of this package.
"""setuptools based setup script for the Qiime2 plugin for THAPBI PICT.
We assume you have installed thapbi-pict, either with pip:
pip install thapbi-pict
Or with conda which will also handle the non-Python dependencies:
conda install thapbi-pict
Then install the Qiime2 plugin. This uses setuptools which is now the standard
python mechanism for installing packages (and is used internally by the tool pip).
Try:
pip install .
Once installed, you should be able to use the plugin via the ``qiime2``
command (the Qiime2 command line interface, q2cli).
"""
from __future__ import print_function # noqa: UP010
from __future__ import with_statement # noqa: UP010
import sys
try:
# from setuptools import find_packages
from setuptools import setup
except ImportError:
sys.exit(
"We need the Python library setuptools to be installed. "
"Try running: python -m ensurepip"
)
# Make sure we have the right Python version.
# Later versions of THAPBI PICT need something much newer!
if sys.version_info[:2] < (3, 7): # noqa: UP036
sys.exit(
"Early THAPBI PICT required Python 3.7 or later. "
"Python %d.%d detected.\n" % sys.version_info[:2]
)
# We define the version number in thapbi_pict/__init__.py
# Here we can't use "import thapbi_pict" then "thapbi_pict.__version__"
# as that would tell us the version already installed (if any).
__version__ = "Undefined"
with open("q2_thapbi_pict/__init__.py") as handle:
for line in handle:
if line.startswith("__version__ = "):
exec(line.strip())
break
# Load our rsStructuredText file README.rst as the long description.
#
# Without declaring an encoding, decoding a problematic character in the file
# may fail on Python 3 depending on the user's locale. By explicitly checking
# it is ASCII (could use latin1 or UTF8 if needed later), if any invalid
# character does appear in our README, this will fail for everyone.
with open("README.rst", "rb") as handle:
readme_rst = handle.read().decode("ascii")
setup(
name="q2_thapbi_pict",
version=__version__,
author="Peter Cock",
author_email="[email protected]",
url="https://github.com/peterjc/q2-thapbi-pict", # For now at least
download_url="https://github.com/peterjc/q2-thapbi-pict",
description="Qiime2 plugin for THAPBI PICT.",
project_urls={
"Documentation": "https://thapbi-pict.readthedocs.io/", # Main package
"Source": "https://github.com/peterjc/q2-thapbi-pict/",
"Tracker": "https://github.com/peterjc/q2-thapbi-pict/issues",
},
long_description=readme_rst,
long_description_content_type="text/x-rst",
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Science/Research",
"License :: Freely Distributable",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Bio-Informatics",
],
python_requires=">=3.7",
entry_points={
"qiime2.plugins": ["q2-thapbi-pict=q2_thapbi_pict.plugin_setup:plugin"]
},
packages=["q2_thapbi_pict"],
package_data={
"q2_thapbi_pict": ["citations.bib"],
},
include_package_data=True,
install_requires=[
# Tested on thapbi_pict 1.0.12 under Python 3.8 from
# conda installed qiime2 version 2024.2 or 2023.5
"thapbi_pict >=1.0.12,<1.1", # Upper bound a precaution
# Qiime packages not on PyPI but via qiime2 conda channel...
# Need at least 2023.5 for Collections data type
"q2-types >=2023.5",
"q2cli >=2023.5",
"biom-format >=2.1.12",
],
)