unitysvc-services 0.1.8__py3-none-any.whl → 0.1.9__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.

Potentially problematic release.


This version of unitysvc-services might be problematic. Click here for more details.

unitysvc_services/test.py CHANGED
@@ -720,26 +720,38 @@ def run(
720
720
  if verbose and result["stdout"]:
721
721
  console.print(f" [dim]stdout:[/dim] {result['stdout'][:200]}")
722
722
 
723
- # Save successful test output to .out file
724
- if result.get("stdout") and result.get("listing_file") and result.get("actual_filename"):
723
+ # Save successful test output to .out and .err files
724
+ if result.get("listing_file") and result.get("actual_filename"):
725
725
  listing_file = Path(result["listing_file"])
726
726
  actual_filename = result["actual_filename"]
727
-
728
- # Create filename: {listing_stem}_{actual_filename}.out
729
- # e.g., "svclisting_test.py.out" for svclisting.json and test.py
730
727
  listing_stem = listing_file.stem
731
- output_filename = f"{listing_stem}_{actual_filename}.out"
728
+
729
+ # Create filename pattern: {service_name}_{listing_stem}_{actual_filename}.out/.err
730
+ # e.g., "llama-3-1-405b-instruct_svclisting_test.py.out"
731
+ base_filename = f"{service_name}_{listing_stem}_{actual_filename}"
732
+ out_filename = f"{base_filename}.out"
733
+ err_filename = f"{base_filename}.err"
732
734
 
733
735
  # Save to listing directory
734
- output_path = listing_file.parent / output_filename
736
+ out_path = listing_file.parent / out_filename
737
+ err_path = listing_file.parent / err_filename
735
738
 
736
739
  # Write stdout to .out file
737
740
  try:
738
- with open(output_path, "w", encoding="utf-8") as f:
739
- f.write(result["stdout"])
740
- console.print(f" [dim]→ Output saved to:[/dim] {output_path}")
741
+ with open(out_path, "w", encoding="utf-8") as f:
742
+ f.write(result["stdout"] or "")
743
+ console.print(f" [dim]→ Output saved to:[/dim] {out_path}")
741
744
  except Exception as e:
742
745
  console.print(f" [yellow]⚠ Failed to save output: {e}[/yellow]")
746
+
747
+ # Write stderr to .err file
748
+ try:
749
+ with open(err_path, "w", encoding="utf-8") as f:
750
+ f.write(result["stderr"] or "")
751
+ if result["stderr"]:
752
+ console.print(f" [dim]→ Error output saved to:[/dim] {err_path}")
753
+ except Exception as e:
754
+ console.print(f" [yellow]⚠ Failed to save error output: {e}[/yellow]")
743
755
  else:
744
756
  console.print(f" [red]✗ Failed[/red] - {result['error']}")
745
757
  if verbose:
@@ -748,16 +760,36 @@ def run(
748
760
  if result["stderr"]:
749
761
  console.print(f" [dim]stderr:[/dim] {result['stderr'][:200]}")
750
762
 
751
- # Write failed test content to current directory
752
- if result.get("rendered_content") and result.get("listing_file") and result.get("actual_filename"):
763
+ # Write failed test outputs and script to current directory
764
+ if result.get("listing_file") and result.get("actual_filename"):
753
765
  listing_file = Path(result["listing_file"])
754
766
  actual_filename = result["actual_filename"]
755
767
  listing_stem = listing_file.stem
756
768
 
757
769
  # Create filename: failed_{service_name}_{listing_stem}_{actual_filename}
770
+ # This will be the base name for .out, .err, and the script file
758
771
  failed_filename = f"failed_{service_name}_{listing_stem}_{actual_filename}"
759
772
 
760
- # Prepare content with environment variables as header comments
773
+ # Write stdout to .out file in current directory
774
+ out_filename = f"{failed_filename}.out"
775
+ try:
776
+ with open(out_filename, "w", encoding="utf-8") as f:
777
+ f.write(result["stdout"] or "")
778
+ console.print(f" [yellow]→ Output saved to:[/yellow] {out_filename}")
779
+ except Exception as e:
780
+ console.print(f" [yellow]⚠ Failed to save output: {e}[/yellow]")
781
+
782
+ # Write stderr to .err file in current directory
783
+ err_filename = f"{failed_filename}.err"
784
+ try:
785
+ with open(err_filename, "w", encoding="utf-8") as f:
786
+ f.write(result["stderr"] or "")
787
+ console.print(f" [yellow]→ Error output saved to:[/yellow] {err_filename}")
788
+ except Exception as e:
789
+ console.print(f" [yellow]⚠ Failed to save error output: {e}[/yellow]")
790
+
791
+ # Write failed test script content to current directory (for debugging)
792
+ # rendered_content is always set if we got here (set during template rendering)
761
793
  content_with_env = result["rendered_content"]
762
794
 
763
795
  # Add environment variables as comments at the top
@@ -774,14 +806,13 @@ def run(
774
806
 
775
807
  content_with_env = env_header + content_with_env
776
808
 
777
- # Write to current directory
778
809
  try:
779
810
  with open(failed_filename, "w", encoding="utf-8") as f:
780
811
  f.write(content_with_env)
781
- console.print(f" [yellow]→ Test content saved to:[/yellow] {failed_filename}")
812
+ console.print(f" [yellow]→ Test script saved to:[/yellow] {failed_filename}")
782
813
  console.print(" [dim] (includes environment variables for reproduction)[/dim]")
783
814
  except Exception as e:
784
- console.print(f" [yellow]⚠ Failed to save test content: {e}[/yellow]")
815
+ console.print(f" [yellow]⚠ Failed to save test script: {e}[/yellow]")
785
816
 
786
817
  console.print()
787
818
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: unitysvc-services
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: SDK for digital service providers on UnitySVC
5
5
  Author-email: Bo Peng <bo.peng@unitysvc.com>
6
6
  Maintainer-email: Bo Peng <bo.peng@unitysvc.com>
@@ -8,7 +8,7 @@ unitysvc_services/publisher.py,sha256=_r6wqJJkC-9RtyKcxiegPoSRDi2-nRL16M8OJ-vi7e
8
8
  unitysvc_services/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  unitysvc_services/query.py,sha256=q0_g5YAl9cPlHpW7k7Y6A-t4fQSdI-_4Jl6g2KgkEm0,24049
10
10
  unitysvc_services/scaffold.py,sha256=Y73IX8vskImxSvxDgR0mvEFuAMYnBKfttn3bjcz3jmQ,40331
11
- unitysvc_services/test.py,sha256=4ydyfx1HWAbmE_kHl3tkH9Jy0d0Zg3kshgoCvGnxwDY,30726
11
+ unitysvc_services/test.py,sha256=Uf06_mgRcEGf9HHYzW2BGTzrDKwd3n7Xb60DFChP8kM,32472
12
12
  unitysvc_services/update.py,sha256=K9swocTUnqqiSgARo6GmuzTzUySSpyqqPPW4xF7ZU-g,9659
13
13
  unitysvc_services/utils.py,sha256=4tEBdO90XpkS6j73ZXnz5dNLVXJaPUILWMwzk5_fUQ4,15276
14
14
  unitysvc_services/validator.py,sha256=NYoIWV2iMyjse1-mIVz2GnFXNDewLnJVDIDAjqnsBCs,30241
@@ -23,9 +23,9 @@ unitysvc_services/schema/listing_v1.json,sha256=gzSK5ncnqmcb44WPnv0FG9xyJ-wUznca
23
23
  unitysvc_services/schema/provider_v1.json,sha256=L2rudq1RcfAE67WJXmowJu5_YReqxioiQO0263SWaNc,22033
24
24
  unitysvc_services/schema/seller_v1.json,sha256=QhYuaJBugWVbgAEBhrSyYAPT1Ss_6Z0rz0lA2FhJOo8,8841
25
25
  unitysvc_services/schema/service_v1.json,sha256=sifCZzx0hT7k6tpDCkPUgXYG9e5OVUaeKudTjEPFO4E,24293
26
- unitysvc_services-0.1.8.dist-info/licenses/LICENSE,sha256=_p8V6A8OMPu2HIztn3O01v0-urZFwk0Dd3Yk_PTIlL8,1065
27
- unitysvc_services-0.1.8.dist-info/METADATA,sha256=5aBwnpthsr774DSkKkQg7lyzWqFWGcb1Paf1mr3Bm7E,7234
28
- unitysvc_services-0.1.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
29
- unitysvc_services-0.1.8.dist-info/entry_points.txt,sha256=RBhVHKky3rsOly4jVa29c7UAw5ZwNNWnttmtzozr5O0,97
30
- unitysvc_services-0.1.8.dist-info/top_level.txt,sha256=GIotQj-Ro2ruR7eupM1r58PWqIHTAq647ORL7E2kneo,18
31
- unitysvc_services-0.1.8.dist-info/RECORD,,
26
+ unitysvc_services-0.1.9.dist-info/licenses/LICENSE,sha256=_p8V6A8OMPu2HIztn3O01v0-urZFwk0Dd3Yk_PTIlL8,1065
27
+ unitysvc_services-0.1.9.dist-info/METADATA,sha256=BvwR1hhrzV9S8DN5YDX6brfBAuVRq51lwZ_QHJRhhx4,7234
28
+ unitysvc_services-0.1.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
29
+ unitysvc_services-0.1.9.dist-info/entry_points.txt,sha256=RBhVHKky3rsOly4jVa29c7UAw5ZwNNWnttmtzozr5O0,97
30
+ unitysvc_services-0.1.9.dist-info/top_level.txt,sha256=GIotQj-Ro2ruR7eupM1r58PWqIHTAq647ORL7E2kneo,18
31
+ unitysvc_services-0.1.9.dist-info/RECORD,,