Skip to content

Commit

Permalink
Adds support for proper versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
swinkels committed Jul 2, 2016
1 parent bbe2c81 commit 7fb962e
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGES.md
@@ -0,0 +1,7 @@
Changelog for git-cc
====================

1.0.0 (unreleased)
------------------

- Started versioning at 1.0.0
1 change: 1 addition & 0 deletions git_cc/__init__.py
@@ -0,0 +1 @@
__version__ = '1.0.0.dev0'
2 changes: 2 additions & 0 deletions setup.cfg
@@ -0,0 +1,2 @@
[zest.releaser]
python-file-with-version = git_cc/__init__.py
23 changes: 22 additions & 1 deletion setup.py
@@ -1,7 +1,28 @@
# -*- coding: utf-8 -*-

import os
import re

from setuptools import setup, find_packages

# The following approach to retrieve the version number is inspired by this
# comment:
#
# https://github.com/zestsoftware/zest.releaser/issues/37#issuecomment-14496733
#
# With this approach, development installs always show the right version number
# and do not require a reinstall (as the definition of the version number in
# this setup file would).

version = 'no version defined'
current_dir = os.path.dirname(__file__)
with open(os.path.join(current_dir, "git_cc", "__init__.py")) as f:
rx = re.compile("__version__ = '(.*)'")
for line in f:
m = rx.match(line)
if m:
version = m.group(1)

with open('README.md') as f:
readme = f.read()

Expand All @@ -10,7 +31,7 @@

setup(
name='git_cc',
# version=version,
version=version,
description='Provides a bridge between git and ClearCase',
long_description=readme,
author="Charles O'Farrel and others",
Expand Down

0 comments on commit 7fb962e

Please sign in to comment.