Permalink
Browse files

Revert "Version now comes from git-tag" (+2)

This reverts commit 0607976.

Revert "Add missing version.py"

This reverts commit e07179d.

Revert "setup.py: also include_package_data=True"

This reverts commit dadcdee.
  • Loading branch information...
1 parent dadcdee commit 90bf15a0ceead0442990eddc2db63d0f52a5211c @peritus committed Dec 26, 2011
Showing with 4 additions and 118 deletions.
  1. +0 −1 .gitignore
  2. +0 −2 MANIFEST.in
  3. +2 −5 setup.py
  4. +2 −4 src/HttpLibrary/__init__.py
  5. +0 −106 version.py
View
@@ -7,4 +7,3 @@ output.xml
parts/
report.html
src/robotframework_httplibrary.egg-info/
-src/HttpLibrary/RELEASE-VERSION
View
@@ -1,3 +1 @@
include README.rst
-include version.py
-include src/HttpLibrary/RELEASE-VERSION
View
@@ -7,14 +7,12 @@
Topic :: Software Development :: Testing
"""[1:-1]
-from version import get_git_version
-
from os.path import join, dirname
long_description=open(join(dirname(__file__), 'README.rst',)).read()
setup(
name = 'robotframework-httplibrary',
- version = get_git_version().lstrip('v'),
+ version = "0.2.1",
description = 'Robot Framework keywords for HTTP requests',
long_description = long_description,
author = 'Filip Noetzel',
@@ -27,6 +25,5 @@
classifiers = CLASSIFIERS.splitlines(),
package_dir = {'' : 'src'},
install_requires = ['robotframework', 'webtest', 'jsonpointer'],
- packages = ['HttpLibrary'],
- include_package_data = True,
+ packages = ['HttpLibrary']
)
@@ -3,7 +3,6 @@
from base64 import b64encode
from functools import wraps
from urlparse import urlparse
-from os.path import join, dirname
import livetest
import json
@@ -32,9 +31,6 @@ class HTTP:
Pointer, go to http://tools.ietf.org/html/draft-pbryan-zyp-json-pointer-00.
"""
- ROBOT_LIBRARY_SCOPE = 'TEST SUITE'
- ROBOT_LIBRARY_VERSION = open(join(dirname(__file__), 'RELEASE-VERSION')).read().strip()
-
class Context(object):
def __init__(self, http, host=None):
# daddy
@@ -104,6 +100,8 @@ def post_process_request(self, response):
elif next_request_should:
self._http.response_status_code_should_equal(next_request_should)
+ ROBOT_LIBRARY_SCOPE = 'TEST SUITE'
+
# internal
def __init__(self):
View
@@ -1,106 +0,0 @@
-# -*- coding: utf-8 -*-
-# Author: Douglas Creager <dcreager@dcreager.net>
-# This file is placed into the public domain.
-
-# Calculates the current version number. If possible, this is the
-# output of “git describe”, modified to conform to the versioning
-# scheme that setuptools uses. If “git describe” returns an error
-# (most likely because we're in an unpacked copy of a release tarball,
-# rather than in a git working copy), then we fall back on reading the
-# contents of the RELEASE-VERSION file.
-#
-# To use this script, simply import it your setup.py file, and use the
-# results of get_git_version() as your package version:
-#
-# from version import *
-#
-# setup(
-# version=get_git_version(),
-# .
-# .
-# .
-# )
-#
-# This will automatically update the RELEASE-VERSION file, if
-# necessary. Note that the RELEASE-VERSION file should *not* be
-# checked into git; please add it to your top-level .gitignore file.
-#
-# You'll probably want to distribute the RELEASE-VERSION file in your
-# sdist tarballs; to do this, just create a MANIFEST.in file that
-# contains the following line:
-#
-# include RELEASE-VERSION
-
-RELEASE_VERSION_PATH = 'src/HttpLibrary/RELEASE-VERSION'
-
-__all__ = ("get_git_version")
-
-from subprocess import Popen, PIPE
-
-
-def call_git_describe(abbrev=4):
- try:
- p = Popen(['git', 'describe', '--tags', '--abbrev=%d' % abbrev],
- stdout=PIPE, stderr=PIPE)
- p.stderr.close()
- line = p.stdout.readlines()[0]
- return str(line.strip())
-
- except:
- return None
-
-
-def read_release_version():
- try:
- f = open(RELEASE_VERSION_PATH, "r")
-
- try:
- version = f.readlines()[0]
- return version.strip()
-
- finally:
- f.close()
-
- except:
- return None
-
-
-def write_release_version(version):
- f = open(RELEASE_VERSION_PATH, "w")
- f.write("%s\n" % version)
- f.close()
-
-
-def get_git_version(abbrev=4):
- # Read in the version that's currently in RELEASE-VERSION.
-
- release_version = read_release_version()
-
- # First try to get the current version using “git describe”.
-
- version = call_git_describe(abbrev)
-
- # If that doesn't work, fall back on the value that's in
- # RELEASE-VERSION.
-
- if version is None:
- version = release_version
-
- # If we still don't have anything, that's an error.
-
- if version is None:
- raise ValueError("Cannot find the version number!")
-
- # If the current version is different from what's in the
- # RELEASE-VERSION file, update the file to be current.
-
- if version != release_version:
- write_release_version(version)
-
- # Finally, return the current version.
-
- return version
-
-
-if __name__ == "__main__":
- print(get_git_version())

0 comments on commit 90bf15a

Please sign in to comment.