diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 00000000..7081e010 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,4 @@ +include redcap_bridge/VERSION +include README.md +include requirements.txt +global-include redcap_bridge/template_parts/* diff --git a/VERSION b/redcap_bridge/VERSION similarity index 100% rename from VERSION rename to redcap_bridge/VERSION diff --git a/redcap_bridge/__init__.py b/redcap_bridge/__init__.py index e69de29b..1e023da0 100644 --- a/redcap_bridge/__init__.py +++ b/redcap_bridge/__init__.py @@ -0,0 +1,7 @@ +import os.path +# Extract central version information +with open(os.path.join(os.path.dirname(__file__), "VERSION")) as version_file: + version = version_file.read().strip() + +__version__ = version +__licence__ = 'MIT' diff --git a/redcap_bridge/project_building.py b/redcap_bridge/project_building.py index f10c78b3..f611165f 100644 --- a/redcap_bridge/project_building.py +++ b/redcap_bridge/project_building.py @@ -72,7 +72,7 @@ def build_project(project_csv, output_file=None, include_provenance=True): # collect provenance infos diglabtools_hash, diglabtools_state = get_repo_state(redcap_bridge_dir.parent) - diglabtools_version = open(redcap_bridge_dir.parent / 'VERSION').read() + diglabtools_version = open(redcap_bridge_dir / 'VERSION').read() project_conf_repo_hash, project_conf_repo_state = get_repo_state(project_csv) if not diglabtools_state: diff --git a/setup.py b/setup.py index 5a6088a5..3569b981 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ import os # Extract central version information -with open(os.path.join(os.path.dirname(__file__), "VERSION")) as version_file: +with open(os.path.join(os.path.dirname(__file__), "redcap_bridge/VERSION")) as version_file: version = version_file.read().strip() with open('requirements.txt') as f: @@ -23,7 +23,7 @@ # If any package contains *.json or *.csv files, include them: "": ["*.json", '*.csv', '*.zip'], }, - data_files=[('.', ['VERSION', 'README.md', 'requirements.txt'])], + data_files=[('DigLabTools', ['redcap_bridge/VERSION', 'README.md', 'requirements.txt'])], author="Julia Sprenger, Jeremy Garcia", description="Tools to interact with the DigLab metadata collection standard", long_description_content_type="text/markdown",