This repository has been archived by the owner on Nov 18, 2024. It is now read-only.
forked from dandi/dandi-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·48 lines (40 loc) · 1.57 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
#!/usr/bin/env python
# emacs: -*- mode: python-mode; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See LICENSE file distributed along with the dandi-cli package for the
# copyright and license terms.
#
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
"""Build helper."""
import os.path
import sys
from setuptools import setup
if sys.version_info < (3,):
raise RuntimeError(
"dandi-cli's setup.py requires python 3 or later. "
"You are using %s" % sys.version
)
# This is needed for versioneer to be importable when building with PEP 517.
# See <https://github.com/warner/python-versioneer/issues/193> and links
# therein for more information.
sys.path.append(os.path.dirname(__file__))
try:
import versioneer
setup_kw = {
"version": versioneer.get_version(),
"cmdclass": versioneer.get_cmdclass(),
}
except ImportError:
# see https://github.com/warner/python-versioneer/issues/192
print("WARNING: failed to import versioneer, falling back to no version for now")
setup_kw = {}
# Give setuptools a hint to complain if it's too old a version
# 30.3.0 allows us to put most metadata in setup.cfg
# Should match pyproject.toml
SETUP_REQUIRES = ["setuptools >= 30.3.0"]
# This enables setuptools to install wheel on-the-fly
SETUP_REQUIRES += ["wheel"] if "bdist_wheel" in sys.argv else []
if __name__ == "__main__":
setup(name="dandi", setup_requires=SETUP_REQUIRES, **setup_kw)