jvcli 2.0.21__tar.gz → 2.0.22__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.
- {jvcli-2.0.21/jvcli.egg-info → jvcli-2.0.22}/PKG-INFO +3 -1
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/__init__.py +1 -1
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/utils.py +27 -49
- {jvcli-2.0.21 → jvcli-2.0.22/jvcli.egg-info}/PKG-INFO +3 -1
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli.egg-info/requires.txt +2 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/setup.py +2 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/tests/test_utils.py +27 -20
- {jvcli-2.0.21 → jvcli-2.0.22}/LICENSE +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/MANIFEST.in +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/README.md +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/api.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/auth.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/cli.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/client/__init__.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/client/app.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/client/lib/__init__.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/client/lib/page.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/client/lib/utils.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/client/lib/widgets.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/client/pages/__init__.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/client/pages/action_dashboard_page.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/client/pages/analytics_page.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/client/pages/chat_page.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/client/pages/graph_page.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/commands/__init__.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/commands/auth.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/commands/clean.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/commands/client.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/commands/create.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/commands/download.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/commands/info.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/commands/publish.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/commands/server.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/commands/startproject.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/commands/studio.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/commands/update.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/studio/assets/index-DDV79SDu.js +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/studio/assets/index-DdMMONxd.css +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/studio/index.html +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/studio/jac_logo.png +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/studio/tauri.svg +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/studio/vite.svg +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/studio-auth/assets/index-Bh6lyeXA.js +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/studio-auth/assets/index-DdMMONxd.css +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/studio-auth/index.html +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/studio-auth/jac_logo.png +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/studio-auth/tauri.svg +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/studio-auth/vite.svg +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/templates/2.0.0/action_info.yaml +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/templates/2.0.0/agent_descriptor.yaml +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/templates/2.0.0/agent_info.yaml +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/templates/2.0.0/agent_knowledge.yaml +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/templates/2.0.0/agent_memory.yaml +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/templates/2.0.0/project/README.md +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/templates/2.0.0/project/actions/README.md +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/templates/2.0.0/project/daf/README.md +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/templates/2.0.0/project/env.example +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/templates/2.0.0/project/gitignore.example +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/templates/2.0.0/project/globals.jac +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/templates/2.0.0/project/main.jac +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/templates/2.0.0/project/tests/README.md +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/templates/CHANGELOG.md +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli/templates/README.md +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli.egg-info/SOURCES.txt +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli.egg-info/dependency_links.txt +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli.egg-info/entry_points.txt +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/jvcli.egg-info/top_level.txt +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/setup.cfg +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/tests/test_api.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/tests/test_auth.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/tests/test_clean.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/tests/test_cli.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/tests/test_create.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/tests/test_download.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/tests/test_info.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/tests/test_publish.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/tests/test_render_basic.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/tests/test_server.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/tests/test_startproject.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/tests/test_studio.py +0 -0
- {jvcli-2.0.21 → jvcli-2.0.22}/tests/test_update.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: jvcli
|
3
|
-
Version: 2.0.
|
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"
|
@@ -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(
|
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
|
-
|
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
|
-
|
106
|
-
|
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
|
-
|
106
|
+
# Replace comma(s) and optional surrounding spaces with one space
|
107
|
+
specifiers = re.sub(r"\s*,\s*", " ", specifiers.strip())
|
143
108
|
|
144
|
-
|
145
|
-
|
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.
|
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"
|
@@ -224,20 +224,29 @@ class TestUtilsFullCoverage:
|
|
224
224
|
@pytest.mark.parametrize(
|
225
225
|
"version, spec, want",
|
226
226
|
[
|
227
|
+
# Standard equality and range cases
|
227
228
|
("1.0.0", "1.0.0", True),
|
228
|
-
("2.1.0", ">=2.0.0,<3.0.0", True),
|
229
|
+
("2.1.0", ">=2.0.0,<3.0.0", True), # comma within range
|
230
|
+
("2.1.0", ">=2.0.0 <3.0.0", True), # space within range
|
231
|
+
# Caret/Tilde matching (node-semver style)
|
229
232
|
("1.0.0", "^1.0.0", True),
|
230
233
|
("1.2.3", "~1.2.0", True),
|
234
|
+
("1.3.0", "~1.2.0", False),
|
235
|
+
("2.0.0", "^1.2.0", False),
|
236
|
+
("0.3.0", "^0.2.0", False),
|
237
|
+
# Missing/empty/invalid input
|
231
238
|
("", "1.0.0", False),
|
232
239
|
("1.0.0", "", False),
|
233
240
|
(None, "1.0.0", False),
|
234
241
|
("1.0.0", None, False),
|
235
242
|
("invalid", "1.0.0", False),
|
236
243
|
("1.0.0", "invalid", False),
|
237
|
-
("1.0", ">=invalid", False),
|
238
|
-
|
239
|
-
("2.
|
240
|
-
("
|
244
|
+
("1.0", ">=invalid", False), # invalid spec
|
245
|
+
# Specifier normalization with commas/spaces
|
246
|
+
("1.2.3", ">=1.0.0, <2.0.0", True), # comma
|
247
|
+
("1.2.3", ">=1.0.0 <2.0.0", True), # space
|
248
|
+
("1.2.3", ">=1.0.0, <2.0.0, !=1.2.3", False), # comma, exclusion
|
249
|
+
("1.2.3", ">=1.0.0 !=1.2.3", False), # space, exclusion
|
241
250
|
],
|
242
251
|
)
|
243
252
|
def test_is_version_compatible_general(
|
@@ -248,27 +257,25 @@ class TestUtilsFullCoverage:
|
|
248
257
|
|
249
258
|
def test_is_version_compatible_pre_release(self) -> None:
|
250
259
|
"""Test is_version_compatible with pre-release versions."""
|
251
|
-
|
252
|
-
assert
|
253
|
-
|
254
|
-
assert is_version_compatible("1.0.0-alpha", "1.0.0
|
255
|
-
|
260
|
+
# Pre-release in spec and version; allow_prerelease allows this
|
261
|
+
assert is_version_compatible("1.0.0-alpha", ">=1.0.0-alpha,<2.0.0", True)
|
262
|
+
# Should NOT match because allow_prerelease=False and pre-release only matches if explicitly specified
|
263
|
+
assert not is_version_compatible("1.0.0-alpha", ">=1.0.0,<2.0.0", False)
|
264
|
+
# Exact match on pre-release
|
265
|
+
assert is_version_compatible("1.0.0-alpha", "1.0.0-alpha", True)
|
266
|
+
# Non-matching pre-release
|
267
|
+
assert not is_version_compatible("1.0.0-alpha", "1.0.0-beta", False)
|
256
268
|
|
257
269
|
def test_is_version_compatible_invalid_specifier(self) -> None:
|
258
270
|
"""Test is_version_compatible with invalid specifiers."""
|
259
271
|
|
260
|
-
#
|
261
|
-
assert not is_version_compatible(
|
262
|
-
|
263
|
-
) # Only major version, needs minor version too
|
264
|
-
assert not is_version_compatible("1.0.0", "~v1") # Prefixed version
|
265
|
-
assert not is_version_compatible(
|
266
|
-
"1.0.0", "~1-alpha"
|
267
|
-
) # Pre-release without minor
|
268
|
-
assert not is_version_compatible("1.0.0", "~a.b.c") # Non-numeric version parts
|
272
|
+
# ~1 is not a valid node-semver range (must specify at least minor)
|
273
|
+
assert not is_version_compatible("1.0.0", "~1-alpha")
|
274
|
+
assert not is_version_compatible("1.0.0", "~a.b.c")
|
269
275
|
|
270
276
|
def test_is_version_compatible_caret_with_zero_major_minor(self) -> None:
|
271
277
|
"""Test is_version_compatible with caret operator for 0.0.x versions."""
|
278
|
+
|
272
279
|
# For ^0.0.1, only the exact version (and builds) should match
|
273
280
|
assert is_version_compatible("0.0.1", "^0.0.1")
|
274
281
|
assert is_version_compatible("0.0.1+build", "^0.0.1")
|
@@ -281,7 +288,7 @@ class TestUtilsFullCoverage:
|
|
281
288
|
assert not is_version_compatible("0.1.0", "^0.0.1")
|
282
289
|
assert not is_version_compatible("1.0.0", "^0.0.1")
|
283
290
|
|
284
|
-
#
|
291
|
+
# For ^0.0.0, only 0.0.0 should match
|
285
292
|
assert is_version_compatible("0.0.0", "^0.0.0")
|
286
293
|
assert not is_version_compatible("0.0.1", "^0.0.0")
|
287
294
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|