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 redcap/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
__author__ = 'Scott Burns <scott.s.burns@gmail.com>'
__license__ = 'MIT'
__copyright__ = '2014, Vanderbilt University'
__version__ = '1.0.2'

"""
This module exposes the REDCap API through the Project class. Instantiate the
Expand All @@ -18,4 +19,3 @@ class with the URL to your REDCap system along with an API key, probably

from .project import Project
from .request import RCRequest, RCAPIError, RedcapError
from .version import VERSION as __version__
8 changes: 0 additions & 8 deletions redcap/version.py

This file was deleted.

27 changes: 18 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,30 @@
__license__ = 'MIT'
__copyright__ = '2014, Vanderbilt University'

import codecs
import os
import re

# Taken from vulture setup.py: https://github.com/jendrikseipp/vulture/blob/master/setup.py
def read(*parts):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, *parts), "r") as f:
return f.read()

def find_version(*file_parts):
version_file = read(*file_parts)
version_match = re.search(
r"^__version__ = ['\"]([^'\"]*)['\"]$", version_file, re.M
)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")

try:
from setuptools import setup
except ImportError:
from distutils.core import setup


def get_version():
base = os.path.dirname(__file__)
with open(os.path.join(base, 'redcap/version.py')) as f:
VERSION = None
exec(f.read())
return VERSION

required = [
'requests>=1.0.0',
'semantic-version>=2.3.1'
Expand All @@ -37,7 +46,7 @@ def get_version():
description="""PyCap: Python interface to REDCap""",
license='MIT',
url='http://sburns.github.com/PyCap',
version=get_version(),
version=find_version("redcap", "__init__.py"),
download_url='http://sburns.github.com/PyCap',
long_description=long_desc,
packages=['redcap'],
Expand Down