clamsproject / clams-python

CLAMS SDK for python
http://sdk.clams.ai/
Apache License 2.0
4 stars 1 forks source link

automatic version string generation not working #187

Closed keighrim closed 6 months ago

keighrim commented 6 months ago

Bug Description

Reported by @leorabaumgarten ,

(clams) C:\Users\baumg\Brandeis\clams\app-east-textdetection>python app.py
Traceback (most recent call last):
  File "app.py", line 112, in <module>
    app = EastTextDetection()
  File "app.py", line 18, in __init__
    super().__init__()
  File "C:\Users\baumg\miniconda3\envs\clams\lib\site-packages\clams\app\__init__.py", line 39, in __init__
    self.metadata: AppMetadata = self._load_appmetadata()
  File "C:\Users\baumg\miniconda3\envs\clams\lib\site-packages\clams\app\__init__.py", line 80, in _load_appmetadata
    metadata = metadatapy.appmetadata()
  File "C:\Users\baumg\Brandeis\clams\app-east-textdetection\metadata.py", line 15, in appmetadata
    metadata = AppMetadata(
  File "pydantic\main.py", line 339, in pydantic.main.BaseModel.__init__
  File "pydantic\main.py", line 1066, in pydantic.main.validate_model
  File "pydantic\fields.py", line 439, in pydantic.fields.ModelField.get_default
  File "C:\Users\baumg\miniconda3\envs\clams\lib\site-packages\clams\appmetadata\__init__.py", line 41, in generate_app_version
    proc = subprocess.run(
  File "C:\Users\baumg\miniconda3\envs\clams\lib\subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'C:\Program Files\Git\cmd\git.EXE --git-dir "C:\Users\baumg\Brandeis\clams\app-east-textdetection\.git" describe --tags --always' returned non-zero exit status 1.

with Python 3.8.16, git version 2.36.0.windows.1

Possibly Windows path issue.

Reproduction steps

Run a CLAMS app using SDK 1.0.9, from source code under a non-tag commit.

Expected behavior

No response

Screenshots

No response

Additional context

No response

keighrim commented 6 months ago

I wasn't able to reproduce the error on my Windows device.

(base) C:\Users\krim\Projects\clams\clamsproject\app-east-wrapper>conda create -n app-east-wrapper python=3.8
...
(base) C:\Users\krim\Projects\clams\clamsproject\app-east-wrapper>conda activate app-east-wrapper
(app-east-wrapper) C:\Users\krim\Projects\clams\clamsproject\app-east-wrapper>pip install -r requirements.txt
...
Successfully installed Flask-3.0.0 Flask-RESTful-0.3.10 Jinja2-3.1.2 MarkupSafe-2.1.3 Pillow-10.1.0 Werkzeug-3.0.1 aniso8601-9.0.1 attrs-23.1.0 blinker-1.7.0 certifi-2023.11.17 charset-normalizer-3.3.2 clams-python-1.0.9 click-8.1.7 colorama-0.4.6 deepdiff-6.7.1 gunicorn-21.2.0 idna-3.6 importlib-metadata-7.0.0 importlib-resources-6.1.1 imutils-0.5.4 isodate-0.6.1 itsdangerous-2.1.2 jsonschema-4.20.0 jsonschema-specifications-2023.11.2 lapps-0.0.2 lxml-4.9.3 mmif-python-1.0.8 numpy-1.24.4 opencv-python-rolling-4.7.0.20230617 ordered-set-4.1.0 packaging-23.2 pkgutil-resolve-name-1.3.10 platformdirs-4.1.0 pydantic-1.10.13 pytesseract-0.3.10 pytz-2023.3.post1 referencing-0.32.0 requests-2.31.0 requests-file-1.5.1 requests-toolbelt-1.0.0 rpds-py-0.13.2 six-1.16.0 typing-extensions-4.9.0 urllib3-2.1.0 zeep-4.2.1 zipp-3.17.0

(app-east-wrapper) C:\Users\krim\Projects\clams\clamsproject\app-east-wrapper>python app.py
C:\Users\krim\anaconda3\envs\app-east-wrapper\lib\site-packages\mmif\utils\video_document_helper.py:13: UserWarning: Optional package "ffmpeg" is not found. You might want to install Computer-Vision dependencies by running `pip install mmif-python[cv]==1.0.8`
  warnings.warn(f"Optional package \"{e.name}\" is not found. "
 * Serving Flask app 'EastTextDetection'
 * Debug mode: on
2023-12-15 16:17:35 werkzeug INFO     25408 WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:5000/
 * Running on http://192.168.1.100:5000/
2023-12-15 16:17:35 werkzeug INFO     25408 Press CTRL+C to quit
2023-12-15 16:17:35 werkzeug INFO     25408  * Restarting with stat
C:\Users\krim\anaconda3\envs\app-east-wrapper\lib\site-packages\mmif\utils\video_document_helper.py:13: UserWarning: Optional package "ffmpeg" is not found. You might want to install Computer-Vision dependencies by running `pip install mmif-python[cv]==1.0.8`
  warnings.warn(f"Optional package \"{e.name}\" is not found. "
2023-12-15 16:17:36 werkzeug WARNING  8464  * Debugger is active!
2023-12-15 16:17:36 werkzeug INFO     8464  * Debugger PIN: 177-216-419

(app-east-wrapper) C:\Users\krim\Projects\clams\clamsproject\app-east-wrapper>git describe --tags --always
v1.1-4-g6be9441

(app-east-wrapper) C:\Users\krim\Projects\clams\clamsproject\app-east-wrapper>git --version
git version 2.41.0.windows.3

(app-east-wrapper) C:\Users\krim\Projects\clams\clamsproject\app-east-wrapper>where git
C:\Users\krim\bin\MinGit\cmd\git.exe

(app-east-wrapper) C:\Users\krim\Projects\clams\clamsproject\app-east-wrapper>