-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
65 lines (59 loc) · 1.91 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
# -*- coding: utf-8 -*-
"""
dict-like interfaces for various databases
"""
import setuptools
import re
import sys
from subprocess import check_output as run
# We use semantic versioning http://semver.org/.
#
# Given a version number MAJOR.MINOR.PATCH, we increment the:
#
# MAJOR for incompatible API changes,
# MINOR for added functionality in a backwards-compatible manner
# PATCH for backwards-compatible bug fixes.
NAME = "persistentdicts"
RELEASE = "2.0.4"
# Get the version from git, otherwise fall back to RELEASE
try:
VERSION = re.sub("-(\\d+)-\\w+$", ".dev\\1", run(["git", "describe"]).decode().strip())
except subprocess.CalledProcessError:
VERSION = RELEASE
# Make sure we are not releasing something poorly tagged
if not VERSION.startswith(RELEASE):
sys.exit("The git tag does not match the release. Please fix.")
if "dev" not in VERSION:
# release
PACKAGE_NAME = NAME
DESCRIPTION = __doc__
GIT_REF = RELEASE
else:
# dev version
PACKAGE_NAME = NAME + "-dev"
DESCRIPTION = "development version of %s" % NAME
GIT_REF = "master"
setuptools.setup(
name=PACKAGE_NAME,
version=VERSION,
description=DESCRIPTION,
long_description=open("README.rst").read(),
author="Christophe-Marie Duquesne",
author_email="chmd@chmd.fr",
url="https://github.com/chmduquesne/%s" % NAME,
download_url="https://github.com/chmduquesne/%s/archive/%s.tar.gz" % (NAME, GIT_REF),
keywords=["database", "interface", "adapter"],
packages=["persistentdicts"],
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.4',
],
install_requires=[
"kyotocabinet >= 1.9",
"cassandra-driver >= 2.1.3"
]
)