Skip to content

Commit

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

Standardize version number placement
  • Loading branch information
aht007 authored Nov 17, 2021
2 parents 5d4eeda + 04e60f3 commit 1feb4d2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion done/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .done import DoneXBlock

__version__ = '2.0.1'
__version__ = '2.0.4'
18 changes: 17 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,25 @@ def is_requirement(line):
return line and line.strip() and not line.startswith(('-r', '#', '-e', 'git+', '-c'))


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("done/__init__.py")


setup(
name='done-xblock',
version='2.0.4',
version=VERSION,
description='done XBlock', # TODO: write a better description.
classifiers=[
'Programming Language :: Python :: 2',
Expand Down

0 comments on commit 1feb4d2

Please sign in to comment.