clams-python 1.2.3__tar.gz → 1.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. {clams_python-1.2.3/clams_python.egg-info → clams_python-1.2.4}/PKG-INFO +2 -2
  2. clams_python-1.2.4/VERSION +1 -0
  3. {clams_python-1.2.3 → clams_python-1.2.4}/clams/develop/__init__.py +1 -0
  4. {clams_python-1.2.3 → clams_python-1.2.4}/clams/develop/templates/app/Containerfile.template +8 -8
  5. {clams_python-1.2.3 → clams_python-1.2.4}/clams/develop/templates/app/README.md.template +10 -10
  6. {clams_python-1.2.3 → clams_python-1.2.4}/clams/develop/templates/app/app.py.template +7 -7
  7. {clams_python-1.2.3 → clams_python-1.2.4}/clams/develop/templates/app/cli.py.template +1 -1
  8. {clams_python-1.2.3 → clams_python-1.2.4}/clams/develop/templates/app/metadata.py.template +4 -4
  9. clams_python-1.2.4/clams/ver/__init__.py +1 -0
  10. {clams_python-1.2.3 → clams_python-1.2.4/clams_python.egg-info}/PKG-INFO +2 -2
  11. {clams_python-1.2.3 → clams_python-1.2.4}/clams_python.egg-info/requires.txt +1 -1
  12. {clams_python-1.2.3 → clams_python-1.2.4}/requirements.txt +1 -1
  13. clams_python-1.2.3/VERSION +0 -1
  14. clams_python-1.2.3/clams/ver/__init__.py +0 -1
  15. {clams_python-1.2.3 → clams_python-1.2.4}/LICENSE +0 -0
  16. {clams_python-1.2.3 → clams_python-1.2.4}/MANIFEST.in +0 -0
  17. {clams_python-1.2.3 → clams_python-1.2.4}/README.md +0 -0
  18. {clams_python-1.2.3 → clams_python-1.2.4}/clams/__init__.py +0 -0
  19. {clams_python-1.2.3 → clams_python-1.2.4}/clams/app/__init__.py +0 -0
  20. {clams_python-1.2.3 → clams_python-1.2.4}/clams/appmetadata/__init__.py +0 -0
  21. {clams_python-1.2.3 → clams_python-1.2.4}/clams/develop/templates/app/.dockerignore.template +0 -0
  22. {clams_python-1.2.3 → clams_python-1.2.4}/clams/develop/templates/app/.gitignore.template +0 -0
  23. {clams_python-1.2.3 → clams_python-1.2.4}/clams/develop/templates/app/LICENSE.template +0 -0
  24. {clams_python-1.2.3 → clams_python-1.2.4}/clams/develop/templates/app/requirements.txt.template +0 -0
  25. {clams_python-1.2.3 → clams_python-1.2.4}/clams/develop/templates/gha/for-clams-team.md.template +0 -0
  26. {clams_python-1.2.3 → clams_python-1.2.4}/clams/develop/templates/gha/workflows/issue-apps-project.yml.template +0 -0
  27. {clams_python-1.2.3 → clams_python-1.2.4}/clams/develop/templates/gha/workflows/issue-assign.yml.template +0 -0
  28. {clams_python-1.2.3 → clams_python-1.2.4}/clams/develop/templates/gha/workflows/issue-close.yml.template +0 -0
  29. {clams_python-1.2.3 → clams_python-1.2.4}/clams/develop/templates/gha/workflows/publish.yml.template +0 -0
  30. {clams_python-1.2.3 → clams_python-1.2.4}/clams/mmif_utils/__init__.py +0 -0
  31. {clams_python-1.2.3 → clams_python-1.2.4}/clams/mmif_utils/rewind.py +0 -0
  32. {clams_python-1.2.3 → clams_python-1.2.4}/clams/mmif_utils/source.py +0 -0
  33. {clams_python-1.2.3 → clams_python-1.2.4}/clams/restify/__init__.py +0 -0
  34. {clams_python-1.2.3 → clams_python-1.2.4}/clams/serve/__init__.py +0 -0
  35. {clams_python-1.2.3 → clams_python-1.2.4}/clams_python.egg-info/SOURCES.txt +0 -0
  36. {clams_python-1.2.3 → clams_python-1.2.4}/clams_python.egg-info/dependency_links.txt +0 -0
  37. {clams_python-1.2.3 → clams_python-1.2.4}/clams_python.egg-info/entry_points.txt +0 -0
  38. {clams_python-1.2.3 → clams_python-1.2.4}/clams_python.egg-info/top_level.txt +0 -0
  39. {clams_python-1.2.3 → clams_python-1.2.4}/setup.cfg +0 -0
  40. {clams_python-1.2.3 → clams_python-1.2.4}/setup.py +0 -0
  41. {clams_python-1.2.3 → clams_python-1.2.4}/tests/test_clamsapp.py +0 -0
  42. {clams_python-1.2.3 → clams_python-1.2.4}/tests/test_clamscli.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: clams-python
3
- Version: 1.2.3
3
+ Version: 1.2.4
4
4
  Summary: A collection of APIs to develop CLAMS app for python
5
5
  Home-page: https://clams.ai
6
6
  Author: Brandeis Lab for Linguistics and Computation
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3 :: Only
14
14
  Requires-Python: >=3.8
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
- Requires-Dist: mmif-python==1.0.15
17
+ Requires-Dist: mmif-python==1.0.16
18
18
  Requires-Dist: Flask>=2
19
19
  Requires-Dist: Flask-RESTful>=0.3.9
20
20
  Requires-Dist: gunicorn>=20
@@ -0,0 +1 @@
1
+ 1.2.4
@@ -171,6 +171,7 @@ def prep_argparser(**kwargs):
171
171
  parser.add_argument(
172
172
  '-u', '--update',
173
173
  action='count',
174
+ default=0, # > Note, the default will be None unless explicitly set to 0. (https://docs.python.org/3/library/argparse.html#action)
174
175
  help=f'Set update level by passing this flag multiple times. This is EXPERIMENTAL, and developers MUST NOT'
175
176
  f'rely on the update results, and should conduct manual checks afterward. LEVEL 0: does not update and '
176
177
  f'raise an error when existing directory found. LEVEL 1: generate non-existing files and generate '
@@ -1,11 +1,11 @@
1
1
  # Use the same base image version as the clams-python python library version
2
2
  FROM ghcr.io/clamsproject/clams-python:$CLAMS_VERSION
3
3
  # See https://github.com/orgs/clamsproject/packages?tab=packages&q=clams-python for more base images
4
- # IF you want to automatically publish this image to the clamsproject organization,
4
+ # IF you want to automatically publish this image to the clamsproject organization,
5
5
  # 1. you should have generated this template without --no-github-actions flag
6
- # 1. to add arm64 support, change relevant line in .github/workflows/container.yml
7
- # * NOTE that a lots of software doesn't install/compile or run on arm64 architecture out of the box
8
- # * make sure you locally test the compatibility of all software dependencies before using arm64 support
6
+ # 1. to add arm64 support, change relevant line in .github/workflows/container.yml
7
+ # * NOTE that a lots of software doesn't install/compile or run on arm64 architecture out of the box
8
+ # * make sure you locally test the compatibility of all software dependencies before using arm64 support
9
9
  # 1. use a git tag to trigger the github action. You need to use git tag to properly set app version anyway
10
10
 
11
11
  ################################################################################
@@ -15,11 +15,11 @@ ENV CLAMS_APP_VERSION ${CLAMS_APP_VERSION}
15
15
  ################################################################################
16
16
 
17
17
  ################################################################################
18
- # This is duplicate from the base image Containerfile
18
+ # This is duplicate from the base image Containerfile
19
19
  # but makes sure the cache directories are consistent across all CLAMS apps
20
20
 
21
21
  # https://github.com/openai/whisper/blob/ba3f3cd54b0e5b8ce1ab3de13e32122d0d5f98ab/whisper/__init__.py#L130
22
- ENV XDG_CACHE_HOME='/cache'
22
+ ENV XDG_CACHE_HOME='/cache'
23
23
  # https://huggingface.co/docs/huggingface_hub/main/en/package_reference/environment_variables#hfhome
24
24
  ENV HF_HOME="/cache/huggingface"
25
25
  # https://pytorch.org/docs/stable/hub.html#where-are-my-downloaded-models-saved
@@ -37,8 +37,8 @@ RUN mkdir /cache && rm -rf /root/.cache && ln -s /cache /root/.cache
37
37
  # main app installation
38
38
  COPY ./ /app
39
39
  WORKDIR /app
40
- RUN pip3 install -r requirements.txt
40
+ RUN pip3 install --no-cache-dir -r requirements.txt
41
41
 
42
- # default command to run the CLAMS app in a production server
42
+ # default command to run the CLAMS app in a production server
43
43
  CMD ["python3", "app.py", "--production"]
44
44
  ################################################################################
@@ -1,33 +1,33 @@
1
1
  # TO_DEVS: BURN AFTER READING
2
2
 
3
- Delete this section of the document once the app development is done, before publishing the repository.
3
+ Delete this section of the document once the app development is done, before publishing the repository.
4
4
 
5
5
  ---
6
- This skeleton code is a scaffolding for Python-based CLAMS app development. Specifically, it contains
6
+ This skeleton code is a scaffolding for Python-based CLAMS app development. Specifically, it contains
7
7
 
8
- 1. `app.py` and `metadata.py` to write the app
8
+ 1. `app.py` and `metadata.py` to write the app
9
9
  1. `requirements.txt` to specify python dependencies
10
10
  1. `Containerfile` to containerize the app and specify system dependencies
11
11
  1. `.gitignore` and `.dockerignore` files listing commonly ignored files
12
12
  1. an empty `LICENSE` file to replace with an actual license information of the app
13
13
  1. This `README.md` file for additional information not specified in the general user manual at https://apps.clams.ai/clamsapp
14
- 1. A number of GitHub Actions workflows for issue/bug-report management
14
+ 1. A number of GitHub Actions workflows for issue/bugreport management
15
15
  1. A GHA workflow to publish app images upon any push of a git tag
16
16
  * **NOTE**: All GHA workflows included are designed to only work in repositories under `clamsproject` organization.
17
17
 
18
18
  Before pushing your first commit, please make sure to delete this section of the document.
19
19
 
20
- Then use the following section to document any additional information specific to this app. If your app works significantly different from what's described in the generic readme file, be as specific as possible.
20
+ Then use the following section to document any additional information specific to this app. If your app works significantly different from what's described in the generic readme file, be as specific as possible.
21
21
 
22
22
 
23
- > **warning**
23
+ > **warning**
24
24
  > TO_DEVS: Delete these `TO_DEVS` notes and warnings before publishing the repository.
25
25
 
26
26
  ---
27
27
 
28
28
  # $APP_NAME
29
29
 
30
- > **warning**
30
+ > **warning**
31
31
  > TO_DEVS: Again, delete these `TO_DEVS` notes and warnings before publishing the repository.
32
32
 
33
33
  ## Description
@@ -37,11 +37,11 @@ Then use the following section to document any additional information specific t
37
37
 
38
38
  ## User instruction
39
39
 
40
- General user instructions for CLAMS apps is available at [CLAMS Apps documentation](https://apps.clams.ai/clamsapp).
40
+ General user instructions for CLAMS apps are available at [CLAMS Apps documentation](https://apps.clams.ai/clamsapp).
41
41
 
42
42
  Below is a list of additional information specific to this app.
43
43
 
44
- > **note**
44
+ > **note**
45
45
  > TO_DEVS: Below is a list of additional information specific to this app.
46
46
 
47
47
 
@@ -57,7 +57,7 @@ Below is a list of additional information specific to this app.
57
57
 
58
58
  ### Configurable runtime parameter
59
59
 
60
- For the full list of parameters, please refer to the app metadata from [CLAMS App Directory](https://apps.clams.ai) or [`metadata.py`](metadata.py) file in this repository.
60
+ For the full list of parameters, please refer to the app metadata from the [CLAMS App Directory](https://apps.clams.ai) or the [`metadata.py`](metadata.py) file in this repository.
61
61
 
62
62
  > **warning**
63
63
  > TO_DEVS: If you're not developing this app for publishing on the CLAMS App Directory, the above paragraph is not applicable. Feel free to delete or change it.
@@ -6,7 +6,7 @@ app.py Template
6
6
  The app.py script does several things:
7
7
  - import the necessary code
8
8
  - create a subclass of ClamsApp that defines the metadata and provides a method to run the wrapped NLP tool
9
- - provide a way to run the code as a RESTful Flask service
9
+ - provide a way to run the code as a RESTful Flask service
10
10
 
11
11
 
12
12
  """
@@ -31,8 +31,8 @@ class $APP_CLASS_NAME(ClamsApp):
31
31
 
32
32
  def _appmetadata(self):
33
33
  # see https://sdk.clams.ai/autodoc/clams.app.html#clams.app.ClamsApp._load_appmetadata
34
- # Also check out ``metadata.py`` in this directory.
35
- # When using the ``metadata.py`` leave this do-nothing "pass" method here.
34
+ # Also check out ``metadata.py`` in this directory.
35
+ # When using the ``metadata.py`` leave this do-nothing "pass" method here.
36
36
  pass
37
37
 
38
38
  def _annotate(self, mmif: Mmif, **parameters) -> Mmif:
@@ -41,14 +41,14 @@ class $APP_CLASS_NAME(ClamsApp):
41
41
 
42
42
  def get_app():
43
43
  """
44
- This function effectively creates an instance of the app class, without any arguments passed in, meaning, any
44
+ This function effectively creates an instance of the app class, without any arguments passed in, meaning, any
45
45
  external information such as initial app configuration should be set without using function arguments. The easiest
46
- way to do this is to set global variables before calling this.
46
+ way to do this is to set global variables before calling this.
47
47
  """
48
- # for example:
48
+ # for example:
49
49
  # return $APP_CLASS_NAME(create, from, global, params)
50
50
  raise NotImplementedError
51
-
51
+
52
52
 
53
53
  if __name__ == "__main__":
54
54
  parser = argparse.ArgumentParser()
@@ -57,7 +57,7 @@ def metadata_to_argparser(app_metadata: AppMetadata) -> argparse.ArgumentParser:
57
57
  'open.',
58
58
  # will check if stdin is a keyboard, and return None if it is
59
59
  default=None if sys.stdin.isatty() else sys.stdin)
60
- parser.add_argument('OUT_MMIF_FILE', nargs='?', type=argparse.FileType('w'),
60
+ parser.add_argument('OUT_MMIF_FILE', nargs='?', type=argparse.FileType('w'),
61
61
  help='output MMIF file path, or STDOUT if `-` or not provided. NOTE: When this is set to '
62
62
  'STDOUT, any print statements in the app code will be redirected to stderr.',
63
63
  default=sys.stdout)
@@ -1,5 +1,5 @@
1
1
  """
2
- The purpose of this file is to define the metadata of the app with minimal imports.
2
+ The purpose of this file is to define the metadata of the app with minimal imports.
3
3
 
4
4
  DO NOT CHANGE the name of the file
5
5
  """
@@ -10,12 +10,12 @@ from clams.app import ClamsApp
10
10
  from clams.appmetadata import AppMetadata
11
11
 
12
12
 
13
- # DO NOT CHANGE the function name
13
+ # DO NOT CHANGE the function name
14
14
  def appmetadata() -> AppMetadata:
15
15
  """
16
16
  Function to set app-metadata values and return it as an ``AppMetadata`` obj.
17
17
  Read these documentations before changing the code below
18
- - https://sdk.clams.ai/appmetadata.html metadata specification.
18
+ - https://sdk.clams.ai/appmetadata.html metadata specification.
19
19
  - https://sdk.clams.ai/autodoc/clams.appmetadata.html python API
20
20
 
21
21
  :return: AppMetadata object holding all necessary information.
@@ -26,7 +26,7 @@ def appmetadata() -> AppMetadata:
26
26
  name="$APP_NAME",
27
27
  description="", # briefly describe what the purpose and features of the app
28
28
  app_license="", # short name for a software license like MIT, Apache2, GPL, etc.
29
- identifier="$APP_IDENTIFIER", # should be a single string without whitespaces. If you don't intent to publish this app to the CLAMS app-directory, please use a full IRI format.
29
+ identifier="$APP_IDENTIFIER", # should be a single string without whitespaces. If you don't intent to publish this app to the CLAMS app-directory, please use a full IRI format.
30
30
  url="https://fakegithub.com/some/repository", # a website where the source code and full documentation of the app is hosted
31
31
  # (if you are on the CLAMS team, this MUST be "https://github.com/clamsproject/app-$APP_IDENTIFIER"
32
32
  # (see ``.github/README.md`` file in this directory for the reason)
@@ -0,0 +1 @@
1
+ __version__ = "1.2.4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: clams-python
3
- Version: 1.2.3
3
+ Version: 1.2.4
4
4
  Summary: A collection of APIs to develop CLAMS app for python
5
5
  Home-page: https://clams.ai
6
6
  Author: Brandeis Lab for Linguistics and Computation
@@ -14,7 +14,7 @@ Classifier: Programming Language :: Python :: 3 :: Only
14
14
  Requires-Python: >=3.8
15
15
  Description-Content-Type: text/markdown
16
16
  License-File: LICENSE
17
- Requires-Dist: mmif-python==1.0.15
17
+ Requires-Dist: mmif-python==1.0.16
18
18
  Requires-Dist: Flask>=2
19
19
  Requires-Dist: Flask-RESTful>=0.3.9
20
20
  Requires-Dist: gunicorn>=20
@@ -1,4 +1,4 @@
1
- mmif-python==1.0.15
1
+ mmif-python==1.0.16
2
2
  Flask>=2
3
3
  Flask-RESTful>=0.3.9
4
4
  gunicorn>=20
@@ -1,4 +1,4 @@
1
- mmif-python==1.0.15
1
+ mmif-python==1.0.16
2
2
 
3
3
  Flask>=2
4
4
  Flask-RESTful>=0.3.9
@@ -1 +0,0 @@
1
- 1.2.3
@@ -1 +0,0 @@
1
- __version__ = "1.2.3"
File without changes
File without changes
File without changes
File without changes
File without changes