Skip to content

Commit a030f16

Browse files
authored
Merge pull request #245 from clamsproject/244-fix-fixed-path
fixing metadata generation is relying on a fixed path of code
2 parents 5ed5876 + 4964ce1 commit a030f16

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,8 @@ distclean:
9797
@rm -rf dist $(artifact) build/bdist*
9898
clean: distclean
9999
@rm -rf VERSION VERSION.dev $(testcaches) $(buildcaches) $(generatedcode)
100+
@rm -rf docs
101+
@rm -rf .*cache
102+
@rm -rf .hypothesis tests/.hypothesis
100103
cleandocs:
101104
@git checkout -- docs && git clean -fx docs

clams/develop/templates/app/metadata.py.template

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ The purpose of this file is to define the metadata of the app with minimal impor
33

44
DO NOT CHANGE the name of the file
55
"""
6+
import pathlib
67

78
from mmif import DocumentTypes, AnnotationTypes
89

@@ -36,7 +37,7 @@ def appmetadata() -> AppMetadata:
3637
# (but, when the app doesn't implementaion any additional algorithms/model/architecture, but simply use API's of existing, for exmaple, OCR software, it is a wrapper)
3738
# if the analyzer is a python app, and it's specified in the requirements.txt
3839
# this trick can also be useful (replace ANALYZER_NAME with the pypi dist name)
39-
analyzer_version=[l.strip().rsplit('==')[-1] for l in open('requirements.txt').readlines() if re.match(r'^ANALYZER_NAME==', l)][0],
40+
analyzer_version=[l.strip().rsplit('==')[-1] for l in open(pathlib.Path(__file__).parent / 'requirements.txt').readlines() if re.match(r'^ANALYZER_NAME==', l)][0],
4041
analyzer_license="", # short name for a software license
4142
)
4243
# and then add I/O specifications: an app must have at least one input and one output

0 commit comments

Comments
 (0)