Skip to content

Commit

Permalink
Merge pull request #207 from edx/aht/BOM-STANDARDIZE-VERSION-NUMBER-P…
Browse files Browse the repository at this point in the history
…LACEMENT

Standardize version number placement
  • Loading branch information
aht007 authored Nov 17, 2021
2 parents 133d3e9 + 72f0649 commit 421db63
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lti_consumer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
"""
from .lti_xblock import LtiConsumerXBlock
from .apps import LTIConsumerApp

__version__ = '3.1.0'
19 changes: 18 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,26 @@ def is_requirement(line):
with open('README.rst') as _f:
long_description = _f.read()


def get_version(file_path):
"""
Extract the version string from the file at the given relative path fragments.
"""
filename = os.path.join(os.path.dirname(__file__), file_path)
with open(filename, encoding='utf-8') as opened_file:
version_file = opened_file.read()
version_match = re.search(r"(?m)^__version__ = ['\"]([^'\"]+)['\"]", version_file)
if version_match:
return version_match.group(1)
raise RuntimeError('Unable to find version string.')


VERSION = get_version("lti_consumer/__init__.py")


setup(
name='lti-consumer-xblock',
version='3.1.0',
version=VERSION,
author='Open edX project',
author_email='[email protected]',
description='This XBlock implements the consumer side of the LTI specification.',
Expand Down

0 comments on commit 421db63

Please sign in to comment.