Anonymous avatar Anonymous committed cb006c0

Moved calculation of version number to the sphinx config.

Comments (0)

Files changed (3)

 # |version| and |release|, also used in various other places throughout the
 # built documents.
 #
-# The short X.Y version.
-version = hornet.release.major_version
 # The full version, including alpha/beta/rc tags.
 release = hornet.release.version
 
+def get_major_version(release):
+    return '.'.join(release.split('.')[0:2])
+    
+# The short X.Y version.
+version = get_major_version(release)
+
+
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
 #language = None

src/hornet/release.py

 .. moduleauthor:: John Paulett <john.paulett -at- vanderbilt.edu>
 """
 
-major_version = '0.4'
-revision = '2a1'
-if revision is not None:
-    version = '%s.%s' % (major_version, revision) 
-
+version = '0.4.2a1'
 name = 'hornet'
 proper_name = 'HORNET'
 description = 'Healthcare Organization Relational Network Extraction Toolkit'

tests/test_release.py

 import hornet.release as release
 
 def test_attributes():
-    assert hasattr(release, 'name')
-    assert hasattr(release, 'proper_name')
-    assert hasattr(release, 'description')
-    assert hasattr(release, 'long_description')
-    assert hasattr(release, 'author')
-    assert hasattr(release, 'author_email')
-    assert hasattr(release, 'copyright')
-    assert hasattr(release, 'url')
-    assert hasattr(release, 'download_url')
-    assert hasattr(release, 'license')
-        
+    has_value('name')
+    has_value('proper_name')
+    has_value('description')
+    has_value('long_description')
+    has_value('author')
+    has_value('author_email')
+    has_value('copyright')
+    has_value('url')
+    has_value('download_url')
+    has_value('license')
+    has_value('version')
+    
+def has_value(attr):
+    assert hasattr(release, attr)
+    assert getattr(release, attr) is not None
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.