jvcli 2.0.13__py3-none-any.whl → 2.0.15__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.13"
7
+ __version__ = "2.0.15"
8
8
  __supported__jivas__versions__ = ["2.0.0"]
@@ -1,13 +1,37 @@
1
+ # JIVAS/Jaclang configuration
2
+ JIVAS_ENVIRONMENT=development
3
+
1
4
  JIVAS_USER=admin@jivas.com
2
5
  JIVAS_PASSWORD=password
3
6
  JIVAS_PORT=8000
4
- JIVAS_BASE_URL=http://localhost:8000
5
- JIVAS_STUDIO_URL=http://localhost:8989
6
- JIVAS_FILES_URL=http://localhost:9000/files
7
7
  JIVAS_DESCRIPTOR_ROOT_PATH=".jvdata"
8
8
  JIVAS_ACTIONS_ROOT_PATH="actions"
9
9
  JIVAS_DAF_ROOT_PATH="daf"
10
+ JIVAS_BASE_URL=http://127.0.0.1:8000
11
+ JIVAS_STUDIO_URL=http://127.0.0.1:8989
12
+ JACPATH="./"
13
+
14
+ # JIVAS Files Serving Config
15
+ JIVAS_FILE_INTERFACE="local"
10
16
  JIVAS_FILES_ROOT_PATH=".files"
17
+ JIVAS_FILES_URL=http://127.0.0.1:9000/files
18
+ # S3 Config
19
+ # JIVAS_S3_ENDPOINT=access_key_id # optional
20
+ # JIVAS_S3_ACCESS_KEY_ID=access_key_id
21
+ # JIVAS_S3_SECRET_ACCESS_KEY=secret_access_key
22
+ # JIVAS_S3_REGION=us-east-1
23
+ # JIVAS_S3_BUCKET_NAME=my-bucket
24
+
25
+ # Secrets Config
11
26
  JIVAS_WEBHOOK_SECRET_KEY="ABCDEFGHIJK"
12
- JIVAS_ENVIRONMENT=development
13
- JACPATH="./"
27
+ TOKEN_SECRET=s3cr3t
28
+
29
+ # MongoDB Config
30
+ # DATABASE_HOST=mongodb://localhost:27017/?replicaSet=my-rs
31
+
32
+ # Typesense Config
33
+ # TYPESENSE_HOST=localhost
34
+ # TYPESENSE_PORT=8108
35
+ # TYPESENSE_PROTOCOL=http
36
+ # TYPESENSE_API_KEY=abcd
37
+ # TYPESENSE_CONNECTION_TIMEOUT_SECONDS=2
jvcli/utils.py CHANGED
@@ -6,8 +6,8 @@ import tarfile
6
6
 
7
7
  import click
8
8
  import yaml
9
- from packaging.specifiers import SpecifierSet
10
- from packaging.version import parse as parse_version
9
+ from packaging.specifiers import InvalidSpecifier, SpecifierSet
10
+ from packaging.version import InvalidVersion, Version
11
11
 
12
12
  from jvcli import __supported__jivas__versions__
13
13
  from jvcli.api import RegistryAPI
@@ -92,61 +92,56 @@ def validate_package_name(name: str) -> None:
92
92
 
93
93
  def is_version_compatible(version: str, specifiers: str) -> bool:
94
94
  """
95
- Compares the provided version to a given set of specifications/modifiers or exact version match.
95
+ Determines if the provided version satisfies the given specifiers or exact version match.
96
96
 
97
97
  Args:
98
- - version (str): The version to be compared. E.g., "2.1.0".
99
- - specifiers (str): The version specifier set or exact version. E.g., "2.1.0" or ">=0.2,<0.3" or "0.0.1" or "^2.0.0"
98
+ - version (str): The version to be checked. E.g., "2.1.0".
99
+ - specifiers (str): The version specifier set or exact version. E.g., "2.1.0", ">=0.2,<0.3", or "^2.0.0".
100
100
 
101
101
  Returns:
102
102
  - bool: True if the version satisfies the specifier set or exact match, False otherwise.
103
103
  """
104
104
  try:
105
- # Parse the version to check
106
- version = parse_version(version)
107
-
108
- # Check if specifiers is a simple exact version match
109
- try:
110
- exact_version = parse_version(specifiers)
111
- return version == exact_version
112
- except Exception:
113
- # If parsing fails, treat it as a specifier set
114
- pass
115
-
116
- # Handle "~" shorthand by translating it to a compatible range
105
+ # Handle edge cases for empty strings or None inputs
106
+ if not version or not specifiers:
107
+ return False
108
+
109
+ # Handle exact version equality when no special characters present
110
+ if all(c not in specifiers for c in "<>!=~^*,"):
111
+ return Version(version) == Version(specifiers)
112
+
113
+ # Handle tilde (~) syntax, as in npm semver, if used
117
114
  if specifiers.startswith("~"):
118
- base_version = specifiers[1:]
119
- parsed_base = parse_version(base_version)
120
- major = parsed_base.major
121
- minor = parsed_base.minor
122
- # Assuming the next release constraint is on minor bump
123
- upper_bound = f"<{major}.{minor + 1}"
124
- specifiers = f">={base_version},{upper_bound}"
125
-
126
- # Handle "^" shorthand to translate to a compatible range
127
- if specifiers.startswith("^"):
128
- base_version = specifiers[1:]
129
- parsed_base = parse_version(base_version)
130
- major = parsed_base.major
131
- minor = parsed_base.minor
132
- patch = parsed_base.micro
115
+ base_version = Version(specifiers[1:])
116
+ if base_version.release is None or len(base_version.release) < 2:
117
+ raise InvalidSpecifier(f"Invalid tilde specifier: '{specifiers}'")
118
+ next_minor = base_version.minor + 1
119
+ specifiers = f">={base_version},<{base_version.major}.{next_minor}.0"
120
+
121
+ # Explicitly handle caret (^) syntax (npm semver style)
122
+ elif specifiers.startswith("^"):
123
+ base_version = Version(specifiers[1:])
124
+ major, minor, patch = (
125
+ base_version.major,
126
+ base_version.minor,
127
+ base_version.micro,
128
+ )
129
+
133
130
  if major > 0:
134
- upper_bound = f"<{major + 1}.0.0"
135
- elif minor > 0:
136
- upper_bound = f"<0.{minor + 1}.0"
137
- else:
138
- upper_bound = f"<0.0.{patch + 1}"
139
- specifiers = f">={base_version},{upper_bound}"
140
-
141
- # Create a SpecifierSet with the given specifiers
142
- spec_set = SpecifierSet(specifiers)
143
-
144
- # Check if the version matches the specifier set
145
- return version in spec_set
146
-
147
- except Exception as e:
148
- # Handle exceptions if the inputs are malformed or invalid
149
- click.secho(f"Error comparing versions: {e}", fg="red")
131
+ specifiers = f">={base_version},<{major + 1}.0.0"
132
+ elif major == 0 and minor > 0:
133
+ specifiers = f">={base_version},<0.{minor + 1}.0"
134
+ else: # major == 0 and minor == 0
135
+ specifiers = f">={base_version},<0.0.{patch + 1}"
136
+
137
+ # Finally check using the SpecifierSet
138
+ specifier_set = SpecifierSet(specifiers)
139
+ parsed_version = Version(version)
140
+
141
+ return parsed_version in specifier_set
142
+
143
+ except (InvalidVersion, InvalidSpecifier, TypeError) as e:
144
+ print(f"Version parsing error: {e}")
150
145
  return False
151
146
 
152
147
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jvcli
3
- Version: 2.0.13
3
+ Version: 2.0.15
4
4
  Summary: CLI tool for Jivas Package Repository
5
5
  Home-page: https://github.com/TrueSelph/jvcli
6
6
  Author: TrueSelph Inc.
@@ -1,8 +1,8 @@
1
- jvcli/__init__.py,sha256=iP0a4m_Caa6fevXHBBUuG0B34jHhQlSABgEgRRknw7o,171
1
+ jvcli/__init__.py,sha256=iSCiYNZIcwNAk36tylM6zmJ5NrQtETpE49Pe5ZDTPoI,171
2
2
  jvcli/api.py,sha256=gd-EP1e75e7HijyrP-EF6i_jjCo6YUeSbm1l5daKLfQ,10352
3
3
  jvcli/auth.py,sha256=p04T02ufqbENx_93oDPg3xsq7sv-Nabeq3YR1kLXfSg,1215
4
4
  jvcli/cli.py,sha256=VM_QGPiYfSdqOZ4n0YLZbrOwXm0d5lHmzv47MqTyBMc,1060
5
- jvcli/utils.py,sha256=NKWjjJ45NFlwT7QVMh1YMY2zfvGaJ_8LppG4D8QXCwA,7726
5
+ jvcli/utils.py,sha256=sdVMBNPSI4985OdspmCxj0BVL61c6dwEQNwhvPJIiAU,7648
6
6
  jvcli/client/__init__.py,sha256=WGP05OBzZHReqENYs1qYqMnYvgAaNVW6KvGQvyB3NGs,85
7
7
  jvcli/client/app.py,sha256=2LGSY2R9GXXRNUu34wb_-i9hLOWbP34YbzgTEnBX-g8,6087
8
8
  jvcli/client/lib/__init__.py,sha256=_Wv8CNIxeIle_x0U9T6w9s5mPuOY9-0u69BvTEPXLUw,38
@@ -44,7 +44,7 @@ jvcli/templates/2.0.0/agent_info.yaml,sha256=3olXRQDQG-543o7zSWWT23kJsK29QGhdx6-
44
44
  jvcli/templates/2.0.0/agent_knowledge.yaml,sha256=hI0ifr0ICiZGce-oUFovBOmDWxGU1Z2M10WyZH_wS2g,284
45
45
  jvcli/templates/2.0.0/agent_memory.yaml,sha256=_MBgObZcW1UzwWuYQVJiPZ_7TvYbGrDgd-xMuzJEkVo,9
46
46
  jvcli/templates/2.0.0/project/README.md,sha256=cr6yHG1qEzO7xDFchEDpl8tKawVvF0tsUVTrWyxjiG4,1077
47
- jvcli/templates/2.0.0/project/env.example,sha256=aB3Wp-0fJV1o9WlFLjxjdA5fKMg2zBV-y8-nBm9Q-bk,396
47
+ jvcli/templates/2.0.0/project/env.example,sha256=L58RTUlPccbY8W9yGAbYA_G3gG36KPElheq9ONKUK50,967
48
48
  jvcli/templates/2.0.0/project/gitignore.example,sha256=W-TIjt_iOIV0zI9bisMeJ4mvsD2Ko13jXnNKG2GlXIg,518
49
49
  jvcli/templates/2.0.0/project/globals.jac,sha256=CEt7L25wEZfE6TupqpM1ilHbtJMQQWExDQ5GJlkHPts,56
50
50
  jvcli/templates/2.0.0/project/main.jac,sha256=r37jsaGq-85YvDbHP3bQvBXk0u8w0rtRTZTNxZOjTW0,48
@@ -57,9 +57,9 @@ jvcli/templates/2.0.0/project/sh/inituser.sh,sha256=BYvLfFZdL0n7AGmjmoTQQcb236f5
57
57
  jvcli/templates/2.0.0/project/sh/serve.sh,sha256=EsXOqszYD5xa8fjAEwyYCz8mSTX-v5VfiTZeKUpOKYw,105
58
58
  jvcli/templates/2.0.0/project/sh/startclient.sh,sha256=3GbJtTxycLBUJGfX2_b3cfQoAPFzhvcJpWRtS2sSsRM,119
59
59
  jvcli/templates/2.0.0/project/tests/README.md,sha256=-1ZXkxuUKa6tMw_jlF3rpCvUFq8ijW2L-nSuAkbCANo,917
60
- jvcli-2.0.13.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
61
- jvcli-2.0.13.dist-info/METADATA,sha256=5sZydra7NeSynQK9z7YRSisg2eE1rEYe9OAj_-hiK_M,4202
62
- jvcli-2.0.13.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
63
- jvcli-2.0.13.dist-info/entry_points.txt,sha256=XunGcL0LWmIMIytaUckUA27czEf8M2Y4aTOfYIpOgrQ,42
64
- jvcli-2.0.13.dist-info/top_level.txt,sha256=akZnN9Zy1dFT93N0ms-C8ZXUn-xlhq37nO3jSRp0Y6o,6
65
- jvcli-2.0.13.dist-info/RECORD,,
60
+ jvcli-2.0.15.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
61
+ jvcli-2.0.15.dist-info/METADATA,sha256=tVp-zxw7lmmwqGfUJLpqa4nGI5Cf705kIamu6F_imk8,4202
62
+ jvcli-2.0.15.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
63
+ jvcli-2.0.15.dist-info/entry_points.txt,sha256=XunGcL0LWmIMIytaUckUA27czEf8M2Y4aTOfYIpOgrQ,42
64
+ jvcli-2.0.15.dist-info/top_level.txt,sha256=akZnN9Zy1dFT93N0ms-C8ZXUn-xlhq37nO3jSRp0Y6o,6
65
+ jvcli-2.0.15.dist-info/RECORD,,
File without changes