Skip to content

Commit

Permalink
Merge pull request #245 from clamsproject/244-fix-fixed-path
Browse files Browse the repository at this point in the history
fixing metadata generation is relying on a fixed path of code
  • Loading branch information
keighrim authored Jan 15, 2025
2 parents 5ed5876 + 4964ce1 commit a030f16
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,8 @@ distclean:
@rm -rf dist $(artifact) build/bdist*
clean: distclean
@rm -rf VERSION VERSION.dev $(testcaches) $(buildcaches) $(generatedcode)
@rm -rf docs
@rm -rf .*cache
@rm -rf .hypothesis tests/.hypothesis
cleandocs:
@git checkout -- docs && git clean -fx docs
3 changes: 2 additions & 1 deletion clams/develop/templates/app/metadata.py.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ The purpose of this file is to define the metadata of the app with minimal impor

DO NOT CHANGE the name of the file
"""
import pathlib

from mmif import DocumentTypes, AnnotationTypes

Expand Down Expand Up @@ -36,7 +37,7 @@ def appmetadata() -> AppMetadata:
# (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)
# if the analyzer is a python app, and it's specified in the requirements.txt
# this trick can also be useful (replace ANALYZER_NAME with the pypi dist name)
analyzer_version=[l.strip().rsplit('==')[-1] for l in open('requirements.txt').readlines() if re.match(r'^ANALYZER_NAME==', l)][0],
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],
analyzer_license="", # short name for a software license
)
# and then add I/O specifications: an app must have at least one input and one output
Expand Down

0 comments on commit a030f16

Please sign in to comment.