forked from facebookresearch/hiplot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
64 lines (50 loc) · 1.93 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
#!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import re
import os
import sys
from pathlib import Path
from typing import Dict, List
from setuptools import setup, find_packages
from setuptools.command.install import install
requirements: Dict[str, List[str]] = {}
for extra in ["dev", "main"]:
requirements[extra] = Path(f"requirements/{extra}.txt").read_text().splitlines()
# Find version number in __init__
init_str = Path("hiplot/__init__.py").read_text()
match = re.search(r"^__version__ = \"(?P<version>[\w\.]+?)\"$", init_str, re.MULTILINE)
assert match is not None, "Could not find version in hiplot/__init__.py"
version = match.group("version")
class VerifyVersionCommand(install):
"""Custom command to verify that the git tag matches our version"""
description = 'verify that the git tag matches our version'
def run(self):
tag = os.getenv('CIRCLE_TAG')
if tag != version:
info = "Git tag: {0} does not match the version of this app: {1}".format(
tag, version
)
sys.exit(info)
def readme() -> str:
return open("README.md").read()
setup(
name="hiplot",
version=version,
description="High dimensional Interactive Plotting tool",
long_description=readme(),
long_description_content_type="text/markdown",
url='https://github.com/facebookresearch/hiplot',
author="Facebook AI Research",
packages=find_packages(),
install_requires=requirements["main"],
extras_require={"dev": requirements["dev"]},
package_data={"hiplot": ["py.typed", "static/*", "static/*/*", "static/*/*/*", "templates/**"]},
include_package_data=True,
scripts=['scripts/hiplot', 'scripts/hiplot-render'],
python_requires='>=3.6',
cmdclass={
'verify': VerifyVersionCommand,
}
)