lmnr 0.6.5__py3-none-any.whl → 0.6.6__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 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
@@ -3,7 +3,7 @@ import httpx
3
3
  from packaging import version
4
4
 
5
5
 
6
- __version__ = "0.6.5"
6
+ __version__ = "0.6.6"
7
7
  PYTHON_VERSION = f"{sys.version_info.major}.{sys.version_info.minor}"
8
8
 
9
9
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lmnr
3
- Version: 0.6.5
3
+ Version: 0.6.6
4
4
  Summary: Python SDK for Laminar
5
5
  License: Apache-2.0
6
6
  Author: lmnr.ai
@@ -1,5 +1,5 @@
1
1
  lmnr/__init__.py,sha256=eJ-gIHEk8KV-BeaU8c9spQww_T2G5_OMu4F8JEzngvA,1281
2
- lmnr/cli.py,sha256=OBgtPAUNzv6ONchasH53HppR-FEyLlIhAYOntkDYsEA,3308
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=7NB1gwM-7XfGZym-X8zYgkO7-GH3Q3WKdlL5sVWYa8A,1321
52
- lmnr-0.6.5.dist-info/LICENSE,sha256=67b_wJHVV1CBaWkrKFWU1wyqTPSdzH77Ls-59631COg,10411
53
- lmnr-0.6.5.dist-info/METADATA,sha256=Sml-w_OWXXWzCH_34XcT2aJp3WVO-TvmvlDoFWqnSeU,15135
54
- lmnr-0.6.5.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
55
- lmnr-0.6.5.dist-info/entry_points.txt,sha256=K1jE20ww4jzHNZLnsfWBvU3YKDGBgbOiYG5Y7ivQcq4,37
56
- lmnr-0.6.5.dist-info/RECORD,,
51
+ lmnr/version.py,sha256=mhHzwj2eibp55ErvbjUipBjlxuc_-hMH-cT7ZNCN6Ck,1321
52
+ lmnr-0.6.6.dist-info/LICENSE,sha256=67b_wJHVV1CBaWkrKFWU1wyqTPSdzH77Ls-59631COg,10411
53
+ lmnr-0.6.6.dist-info/METADATA,sha256=_LjR4ov6NHgMmdZsGXnJECju7P2Dwt7YudVL3LDen5Y,15135
54
+ lmnr-0.6.6.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
55
+ lmnr-0.6.6.dist-info/entry_points.txt,sha256=K1jE20ww4jzHNZLnsfWBvU3YKDGBgbOiYG5Y7ivQcq4,37
56
+ lmnr-0.6.6.dist-info/RECORD,,
File without changes
File without changes