-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathsetup.py
More file actions
23 lines (18 loc) · 758 Bytes
/
setup.py
File metadata and controls
23 lines (18 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# -*- coding: utf-8 -*-
from __future__ import annotations
from setuptools import setup
from setuptools_scm import ScmVersion
from setuptools_scm.version import get_no_local_node
def current_version(version: ScmVersion) -> str:
from setuptools_scm.version import guess_next_version
delim = '.'
if version.branch in ("master", "main"):
delim = '.'
if version.branch in ("dev", "devel"):
delim = '-dev'
if version.branch in ("fix", "hotfix"):
delim = '-post'
return version.format_next_version(guess_next_version,
"{tag}"+ delim +"{distance}")
setup(use_scm_version={"version_scheme": current_version,
"local_scheme": get_no_local_node})