jvcli 2.0.20__py3-none-any.whl → 2.0.22__py3-none-any.whl

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.
jvcli/__init__.py CHANGED
@@ -4,5 +4,5 @@ jvcli package initialization.
4
4
  This package provides the CLI tool for Jivas Package Repository.
5
5
  """
6
6
 
7
- __version__ = "2.0.20"
7
+ __version__ = "2.0.22"
8
8
  __supported__jivas__versions__ = ["2.0.0"]
jvcli/commands/create.py CHANGED
@@ -231,7 +231,7 @@ node {architype} :{node_class}: {{
231
231
  app_code = """
232
232
  \"\"\" This module renders the streamlit app for the {title}. \"\"\"
233
233
 
234
- from jvclient.client.lib.widgets import app_controls, app_header, app_update_action
234
+ from jvcli.client.lib.widgets import app_controls, app_header, app_update_action
235
235
 
236
236
  from streamlit_router import StreamlitRouter
237
237
 
jvcli/commands/server.py CHANGED
@@ -152,7 +152,7 @@ def initagents() -> None:
152
152
  Initialize agents in the Jivas system.
153
153
 
154
154
  Usage:
155
- jvcli initagents
155
+ jvcli server initagents
156
156
  """
157
157
 
158
158
  # Check if server is running
@@ -203,7 +203,7 @@ def importagent(agent_name: str, version: str) -> None:
203
203
  Import an agent from a DAF package.
204
204
 
205
205
  Usage:
206
- jvcli importagent <agent_name> [--version <jivas_version>]
206
+ jvcli server importagent <agent_name> [--version <jivas_version>]
207
207
  """
208
208
 
209
209
  # Check if server is running
jvcli/utils.py CHANGED
@@ -5,10 +5,10 @@ import re
5
5
  import tarfile
6
6
 
7
7
  import click
8
+ import nodesemver
8
9
  import requests
10
+ import semver
9
11
  import yaml
10
- from packaging.specifiers import InvalidSpecifier, SpecifierSet
11
- from packaging.version import InvalidVersion, Version
12
12
 
13
13
  from jvcli import __supported__jivas__versions__
14
14
  from jvcli.api import RegistryAPI
@@ -91,58 +91,36 @@ def validate_package_name(name: str) -> None:
91
91
  )
92
92
 
93
93
 
94
- def is_version_compatible(version: str, specifiers: str) -> bool:
94
+ def is_version_compatible(
95
+ version: str, specifiers: str, allow_prerelease: bool = True
96
+ ) -> bool:
95
97
  """
96
- Determines if the provided version satisfies the given specifiers or exact version match.
98
+ Determines if the provided version satisfies the given specifiers or exact version match,
99
+ with an option to consider prerelease versions.
97
100
 
98
- Args:
99
- - version (str): The version to be checked. E.g., "2.1.0".
100
- - specifiers (str): The version specifier set or exact version. E.g., "2.1.0", ">=0.2,<0.3", or "^2.0.0".
101
-
102
- Returns:
103
- - bool: True if the version satisfies the specifier set or exact match, False otherwise.
101
+ - Converts comma-separated specifiers to space-separated (Node-style).
104
102
  """
105
- try:
106
- # Handle edge cases for empty strings or None inputs
107
- if not version or not specifiers:
108
- return False
109
-
110
- # Handle exact version equality when no special characters present
111
- if all(c not in specifiers for c in "<>!=~^*,"):
112
- return Version(version) == Version(specifiers)
113
-
114
- # Handle tilde (~) syntax, as in npm semver, if used
115
- if specifiers.startswith("~"):
116
- base_version = Version(specifiers[1:])
117
- if base_version.release is None or len(base_version.release) < 2:
118
- raise InvalidSpecifier(f"Invalid tilde specifier: '{specifiers}'")
119
- next_minor = base_version.minor + 1
120
- specifiers = f">={base_version},<{base_version.major}.{next_minor}.0"
121
-
122
- # Explicitly handle caret (^) syntax (npm semver style)
123
- elif specifiers.startswith("^"):
124
- base_version = Version(specifiers[1:])
125
- major, minor, patch = (
126
- base_version.major,
127
- base_version.minor,
128
- base_version.micro,
129
- )
130
-
131
- if major > 0:
132
- specifiers = f">={base_version},<{major + 1}.0.0"
133
- elif major == 0 and minor > 0:
134
- specifiers = f">={base_version},<0.{minor + 1}.0"
135
- else: # major == 0 and minor == 0
136
- specifiers = f">={base_version},<0.0.{patch + 1}"
137
-
138
- # Finally check using the SpecifierSet
139
- specifier_set = SpecifierSet(specifiers)
140
- parsed_version = Version(version)
103
+ if not version or not specifiers:
104
+ return False
141
105
 
142
- return parsed_version in specifier_set
106
+ # Replace comma(s) and optional surrounding spaces with one space
107
+ specifiers = re.sub(r"\s*,\s*", " ", specifiers.strip())
143
108
 
144
- except (InvalidVersion, InvalidSpecifier, TypeError) as e:
145
- print(f"Version parsing error: {e}")
109
+ try:
110
+ # For nodesemver
111
+ return nodesemver.satisfies(
112
+ version, specifiers, include_prerelease=allow_prerelease
113
+ )
114
+ except ImportError:
115
+ try:
116
+ # For python-semver >=3.0.0
117
+ # semver>=3.0.0 supports allow_prerelease
118
+ return semver.satisfies(
119
+ version, specifiers, allow_prerelease=allow_prerelease
120
+ )
121
+ except Exception:
122
+ return False
123
+ except Exception:
146
124
  return False
147
125
 
148
126
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jvcli
3
- Version: 2.0.20
3
+ Version: 2.0.22
4
4
  Summary: CLI tool for Jivas Package Repository
5
5
  Home-page: https://github.com/TrueSelph/jvcli
6
6
  Author: TrueSelph Inc.
@@ -18,6 +18,8 @@ Requires-Dist: streamlit-elements>=0.1.0
18
18
  Requires-Dist: streamlit-router>=0.1.8
19
19
  Requires-Dist: streamlit-javascript>=0.1.5
20
20
  Requires-Dist: python-dotenv>=1.0.0
21
+ Requires-Dist: semver>=3.0.4
22
+ Requires-Dist: node-semver>=0.9.0
21
23
  Provides-Extra: dev
22
24
  Requires-Dist: pre-commit; extra == "dev"
23
25
  Requires-Dist: pytest; extra == "dev"
@@ -1,8 +1,8 @@
1
- jvcli/__init__.py,sha256=7DZPxtJmca6a1wPs0ff-L6lGopkyfrLpndciskhCi8Q,171
1
+ jvcli/__init__.py,sha256=lT7FAm-c7E3TY64J6wemhe_xxJ2oqIp46gFZyyPqf_w,171
2
2
  jvcli/api.py,sha256=gd-EP1e75e7HijyrP-EF6i_jjCo6YUeSbm1l5daKLfQ,10352
3
3
  jvcli/auth.py,sha256=mHP425hvXhNxzeX--cApkrP7SdDPmfG6V0Li5TLHmIg,1953
4
4
  jvcli/cli.py,sha256=ntTkriNGtfxFAdJw5ikdq2wD43pIqDpb7lfXsCMXOWQ,1191
5
- jvcli/utils.py,sha256=rhXStZMsW7mMp5l0p_90c7G0p1FhfVB97Cr9zN1plds,8484
5
+ jvcli/utils.py,sha256=ZTwvGcEE94aORLDbevfkPNICFqNU8PpqH7d424xuYlg,7242
6
6
  jvcli/client/__init__.py,sha256=WGP05OBzZHReqENYs1qYqMnYvgAaNVW6KvGQvyB3NGs,85
7
7
  jvcli/client/app.py,sha256=bjdGY9J43qymdmODt0BgzN66Aolyo1653ZuCj_gNdKA,6184
8
8
  jvcli/client/lib/__init__.py,sha256=_Wv8CNIxeIle_x0U9T6w9s5mPuOY9-0u69BvTEPXLUw,38
@@ -18,11 +18,11 @@ jvcli/commands/__init__.py,sha256=bjZvM55MC2NugvRlxkEU9CDDP9NnsygcsGZewj1gQcg,57
18
18
  jvcli/commands/auth.py,sha256=lO5G1_TCbxhOfy7xH9EULwvCLqf7iQTF9Q3MrpAtHPY,1611
19
19
  jvcli/commands/clean.py,sha256=AOyssr5MZ_EJ0wW6Q8GoWQ7ve5OGke9W82GusBFoDCg,1006
20
20
  jvcli/commands/client.py,sha256=yIp0wCmoxgxImJrpl0dH9qURGMcVKTxonVd1d-BdsxI,1432
21
- jvcli/commands/create.py,sha256=HIL01nTcyEEXk4yLMwnPsRtj_cbhsuz2AEN2BwWeI-o,13393
21
+ jvcli/commands/create.py,sha256=koPSQcQX4yFtZsmODJmPCevkov3m36JpkDHhLmMgzwg,13390
22
22
  jvcli/commands/download.py,sha256=GiLX_43CQOW9d5vF04fAszOWh3AB-7Mgote4tJ9RVng,3416
23
23
  jvcli/commands/info.py,sha256=NyIDpR_AGMMSFPE0tFZv4dIuv_gwqrfd589zQAA_Q3s,2685
24
24
  jvcli/commands/publish.py,sha256=q1ihoL42GmEsU5ggHN3bcg8QD26kjRUZGfQpRzI2GMo,6630
25
- jvcli/commands/server.py,sha256=9Ak9w9xENsYV_U2XQGAny8zc6iLfJSMc-cazjeD5Hs0,8136
25
+ jvcli/commands/server.py,sha256=UX0h8ssmDMZBfAP58vzC6gpqkiNefPPOGmsJANAcZ38,8150
26
26
  jvcli/commands/startproject.py,sha256=5qis2Dhed-HhKqZ8e37Xpy__Rmqga8cTwAOmfGVPzmU,3375
27
27
  jvcli/commands/studio.py,sha256=avD5M3Ss7R6AtUMN3Mk6AmTyPJ7LnXcmwQ0mbRzivrQ,8192
28
28
  jvcli/commands/update.py,sha256=LwCLg-W1b8WSdFkiiJ8WwTit2HJXTLpM5OQ4WBTe9C4,1997
@@ -53,9 +53,9 @@ jvcli/templates/2.0.0/project/main.jac,sha256=r37jsaGq-85YvDbHP3bQvBXk0u8w0rtRTZ
53
53
  jvcli/templates/2.0.0/project/actions/README.md,sha256=TU1t-rOBH5WQP_HUWaEBLq5BbPv4jejtjIrwTW4hZwM,1742
54
54
  jvcli/templates/2.0.0/project/daf/README.md,sha256=fO-dcc3j-1E6sFagIvvJsISAth11N-2d64G0yHi7JrY,1682
55
55
  jvcli/templates/2.0.0/project/tests/README.md,sha256=-1ZXkxuUKa6tMw_jlF3rpCvUFq8ijW2L-nSuAkbCANo,917
56
- jvcli-2.0.20.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
57
- jvcli-2.0.20.dist-info/METADATA,sha256=gGszGZTT-H41S6IADbTnS_1VHAnXBaeDLSlsshwr-xI,21604
58
- jvcli-2.0.20.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
59
- jvcli-2.0.20.dist-info/entry_points.txt,sha256=XunGcL0LWmIMIytaUckUA27czEf8M2Y4aTOfYIpOgrQ,42
60
- jvcli-2.0.20.dist-info/top_level.txt,sha256=akZnN9Zy1dFT93N0ms-C8ZXUn-xlhq37nO3jSRp0Y6o,6
61
- jvcli-2.0.20.dist-info/RECORD,,
56
+ jvcli-2.0.22.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
57
+ jvcli-2.0.22.dist-info/METADATA,sha256=jP6ROizsxjWb8u8KcbtmdczZNZ8xXl6p2o-ZMu4c75o,21667
58
+ jvcli-2.0.22.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
59
+ jvcli-2.0.22.dist-info/entry_points.txt,sha256=XunGcL0LWmIMIytaUckUA27czEf8M2Y4aTOfYIpOgrQ,42
60
+ jvcli-2.0.22.dist-info/top_level.txt,sha256=akZnN9Zy1dFT93N0ms-C8ZXUn-xlhq37nO3jSRp0Y6o,6
61
+ jvcli-2.0.22.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (79.0.0)
2
+ Generator: setuptools (80.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5