Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rethinkdb/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# This file incorporates work covered by the following copyright:
# Copyright 2010-2016 RethinkDB, all rights reserved.

VERSION = "2.4.0+source"
VERSION = "2.4.11+source"
24 changes: 9 additions & 15 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

import setuptools

from rethinkdb.version import VERSION

try:
import asyncio

Expand All @@ -32,26 +30,22 @@


RETHINKDB_VERSION_DESCRIBE = os.environ.get("RETHINKDB_VERSION_DESCRIBE")
VERSION_RE = r"^v(?P<version>\d+\.\d+)\.(?P<patch>\d+)?(\.(?P<post>\w+))?$"

if RETHINKDB_VERSION_DESCRIBE:
MATCH = re.match(VERSION_RE, RETHINKDB_VERSION_DESCRIBE)
VERSION_RE = r"(?P<major>[0-9]+)\.(?P<minor>[0-9]+)\.(?P<patch>[0-9]+)(?P<pre_release>:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?P<meta>:\+[0-9A-Za-z-]+)?"

if MATCH:
VERSION = MATCH.group("version")
with open("rethinkdb/version.py", "r") as f:
version_parts = re.search(VERSION_RE, f.read()).groups()
VERSION = ".".join(filter(lambda x: x is not None, version_parts))

if MATCH.group("patch"):
VERSION += "." + MATCH.group("patch")

if MATCH.group("post"):
VERSION += "." + MATCH.group("post")
if RETHINKDB_VERSION_DESCRIBE:
version_parts = re.match(VERSION_RE, RETHINKDB_VERSION_DESCRIBE)

with open("rethinkdb/version.py", "w") as f:
f.write('VERSION = {0}'.format(repr(VERSION)))
else:
if not version_parts:
raise RuntimeError("{!r} does not match version format {!r}".format(
RETHINKDB_VERSION_DESCRIBE, VERSION_RE))

VERSION = ".".join(filter(lambda x: x is not None, version_parts.groups()))


setuptools.setup(
name='rethinkdb',
Expand Down