lmnr 0.6.5__py3-none-any.whl → 0.6.7__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.
- lmnr/cli.py +44 -0
- lmnr/version.py +1 -1
- {lmnr-0.6.5.dist-info → lmnr-0.6.7.dist-info}/METADATA +2 -2
- {lmnr-0.6.5.dist-info → lmnr-0.6.7.dist-info}/RECORD +7 -7
- {lmnr-0.6.5.dist-info → lmnr-0.6.7.dist-info}/LICENSE +0 -0
- {lmnr-0.6.5.dist-info → lmnr-0.6.7.dist-info}/WHEEL +0 -0
- {lmnr-0.6.5.dist-info → lmnr-0.6.7.dist-info}/entry_points.txt +0 -0
lmnr/cli.py
CHANGED
@@ -4,6 +4,9 @@ import importlib.util
|
|
4
4
|
import os
|
5
5
|
import re
|
6
6
|
import sys
|
7
|
+
import urllib.request
|
8
|
+
import urllib.error
|
9
|
+
from pathlib import Path
|
7
10
|
|
8
11
|
from lmnr.sdk.evaluations import Evaluation
|
9
12
|
|
@@ -16,6 +19,39 @@ LOG = get_default_logger(__name__)
|
|
16
19
|
EVAL_DIR = "evals"
|
17
20
|
|
18
21
|
|
22
|
+
def add_cursor_rules():
|
23
|
+
"""Download laminar.mdc file from a hardcoded public URL and save it to .cursor/rules/laminar.mdc"""
|
24
|
+
# Hardcoded URL for the laminar.mdc file
|
25
|
+
url = "https://raw.githubusercontent.com/lmnr-ai/lmnr/dev/rules/laminar.mdc"
|
26
|
+
|
27
|
+
# Create .cursor/rules directory if it doesn't exist
|
28
|
+
rules_dir = Path(".cursor/rules")
|
29
|
+
rules_dir.mkdir(parents=True, exist_ok=True)
|
30
|
+
|
31
|
+
# Define the target file path
|
32
|
+
target_file = rules_dir / "laminar.mdc"
|
33
|
+
|
34
|
+
try:
|
35
|
+
LOG.info(f"Downloading laminar.mdc from {url}")
|
36
|
+
|
37
|
+
# Download the file
|
38
|
+
with urllib.request.urlopen(url) as response:
|
39
|
+
content = response.read()
|
40
|
+
|
41
|
+
# Write the content to the target file (this will overwrite if it exists)
|
42
|
+
with open(target_file, 'wb') as f:
|
43
|
+
f.write(content)
|
44
|
+
|
45
|
+
LOG.info(f"Successfully downloaded laminar.mdc to {target_file}")
|
46
|
+
|
47
|
+
except urllib.error.URLError as e:
|
48
|
+
LOG.error(f"Failed to download file from {url}: {e}")
|
49
|
+
sys.exit(1)
|
50
|
+
except Exception as e:
|
51
|
+
LOG.error(f"Unexpected error: {e}")
|
52
|
+
sys.exit(1)
|
53
|
+
|
54
|
+
|
19
55
|
async def run_evaluation(args):
|
20
56
|
sys.path.append(os.getcwd())
|
21
57
|
|
@@ -103,8 +139,16 @@ def cli():
|
|
103
139
|
help="Fail on error",
|
104
140
|
)
|
105
141
|
|
142
|
+
parser_download = subparsers.add_parser(
|
143
|
+
"add-cursor-rules",
|
144
|
+
description="Download laminar.mdc file and add it to .cursor/rules",
|
145
|
+
help="Download laminar.mdc file and add it to .cursor/rules",
|
146
|
+
)
|
147
|
+
|
106
148
|
parsed = parser.parse_args()
|
107
149
|
if parsed.subcommand == "eval":
|
108
150
|
asyncio.run(run_evaluation(parsed))
|
151
|
+
elif parsed.subcommand == "add-cursor-rules":
|
152
|
+
add_cursor_rules()
|
109
153
|
else:
|
110
154
|
parser.print_help()
|
lmnr/version.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: lmnr
|
3
|
-
Version: 0.6.
|
3
|
+
Version: 0.6.7
|
4
4
|
Summary: Python SDK for Laminar
|
5
5
|
License: Apache-2.0
|
6
6
|
Author: lmnr.ai
|
@@ -41,7 +41,7 @@ Provides-Extra: vertexai
|
|
41
41
|
Provides-Extra: watsonx
|
42
42
|
Provides-Extra: weaviate
|
43
43
|
Requires-Dist: argparse (>=1.0)
|
44
|
-
Requires-Dist: grpcio (
|
44
|
+
Requires-Dist: grpcio (>=1)
|
45
45
|
Requires-Dist: httpx (>=0.25.0)
|
46
46
|
Requires-Dist: opentelemetry-api (>=1.33.0)
|
47
47
|
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc (>=1.33.0)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
lmnr/__init__.py,sha256=eJ-gIHEk8KV-BeaU8c9spQww_T2G5_OMu4F8JEzngvA,1281
|
2
|
-
lmnr/cli.py,sha256=
|
2
|
+
lmnr/cli.py,sha256=YqemvkUEXMJe_xVXmqX8AyMdnRLvSBLsuoCc6gz7H3g,4834
|
3
3
|
lmnr/opentelemetry_lib/.flake8,sha256=bCxuDlGx3YQ55QHKPiGJkncHanh9qGjQJUujcFa3lAU,150
|
4
4
|
lmnr/opentelemetry_lib/__init__.py,sha256=E_NwAWxh3hckZjXTA80hOzmRUL8RvnSYRdcPExwVROc,2056
|
5
5
|
lmnr/opentelemetry_lib/decorators/__init__.py,sha256=E8OF6yaCitsjvHLscbrUs-OaomOd0Vjftf5La834WD8,8669
|
@@ -48,9 +48,9 @@ lmnr/sdk/laminar.py,sha256=jbsNHl-IbZs_6okGGckkDbh_gpV2rsR3ao5jflIZHgU,28627
|
|
48
48
|
lmnr/sdk/log.py,sha256=nt_YMmPw1IRbGy0b7q4rTtP4Yo3pQfNxqJPXK3nDSNQ,2213
|
49
49
|
lmnr/sdk/types.py,sha256=wnC1OkF-FErpAaRbEGYtiDnPBYw2qxmz3zu8kVBMn7w,12657
|
50
50
|
lmnr/sdk/utils.py,sha256=AK9njI7s0cacR93NpvQr6nEiEp6Cj-GIBWSdbFHrWVk,3858
|
51
|
-
lmnr/version.py,sha256=
|
52
|
-
lmnr-0.6.
|
53
|
-
lmnr-0.6.
|
54
|
-
lmnr-0.6.
|
55
|
-
lmnr-0.6.
|
56
|
-
lmnr-0.6.
|
51
|
+
lmnr/version.py,sha256=QKgugwDOKRISsnVvyqWlOf4zKJ-k26wBS0Qk3AIWIJU,1321
|
52
|
+
lmnr-0.6.7.dist-info/LICENSE,sha256=67b_wJHVV1CBaWkrKFWU1wyqTPSdzH77Ls-59631COg,10411
|
53
|
+
lmnr-0.6.7.dist-info/METADATA,sha256=zDwh1midVEMqtKFf_lcohn1TMU_g396t2XSCv-MSWXI,15131
|
54
|
+
lmnr-0.6.7.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
55
|
+
lmnr-0.6.7.dist-info/entry_points.txt,sha256=K1jE20ww4jzHNZLnsfWBvU3YKDGBgbOiYG5Y7ivQcq4,37
|
56
|
+
lmnr-0.6.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|