-
Notifications
You must be signed in to change notification settings - Fork 43
/
setup.py
36 lines (27 loc) · 1.13 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
# Unless explicitly stated otherwise all files in this repository are licensed
# under the 3-clause BSD style license (see LICENSE).
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019 Datadog, Inc.
import os
from setuptools import setup
version_template = """\
# Unless explicitly stated otherwise all files in this repository are licensed
# under the 3-clause BSD style license (see LICENSE).
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2020-Present Datadog, Inc.
__version__ = "{version}"
"""
# Allows the fetching of tags even from shallow clones
# https://github.com/pypa/setuptools_scm/pull/118#issuecomment-255381535
def parse_fetch_on_shallow(*args, **kwargs):
from setuptools_scm.git import parse, fetch_on_shallow
kwargs["pre_parse"] = fetch_on_shallow
return parse(*args, **kwargs)
setup(
use_scm_version={
"local_scheme": "dirty-tag",
"write_to": os.path.join("src", "datadog_api_client", "version.py"),
"write_to_template": version_template,
"parse": parse_fetch_on_shallow,
}
)