From a2cd2340264c4f0092d2f29d2e9ef693baff0139 Mon Sep 17 00:00:00 2001 From: Julia Sprenger Date: Mon, 23 May 2022 17:36:33 +0200 Subject: [PATCH 1/4] Enhance init and restructure version file handling --- VERSION => redcap_bridge/VERSION | 0 redcap_bridge/__init__.py | 7 +++++++ setup.py | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) rename VERSION => redcap_bridge/VERSION (100%) 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/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", From 084c3654621a5d3b2ea9cc8036898d81d8c1e298 Mon Sep 17 00:00:00 2001 From: Julia Sprenger Date: Mon, 23 May 2022 17:50:21 +0200 Subject: [PATCH 2/4] fix version file reference --- redcap_bridge/project_building.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redcap_bridge/project_building.py b/redcap_bridge/project_building.py index f10c78b3..3065a290 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: From 65dd5ffad0fe6bab0bf1974ceda89766e8398712 Mon Sep 17 00:00:00 2001 From: Julia Sprenger Date: Mon, 23 May 2022 17:50:38 +0200 Subject: [PATCH 3/4] add MANIFEST.in --- MANIFEST.in | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 MANIFEST.in 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/* From 58aa0cb790b137c782572964e793af6d01136dc4 Mon Sep 17 00:00:00 2001 From: Julia Sprenger Date: Tue, 24 May 2022 09:45:45 +0200 Subject: [PATCH 4/4] pep8 --- redcap_bridge/project_building.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/redcap_bridge/project_building.py b/redcap_bridge/project_building.py index 3065a290..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/ '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: