Skip to content

Conversation

SAKURA-CAT
Copy link
Member

close #1027


Now swanlab can be directly executed by the Python interpreter.

@SAKURA-CAT SAKURA-CAT requested review from Zeyi-Lin and Copilot June 5, 2025 05:45
@SAKURA-CAT SAKURA-CAT self-assigned this Jun 5, 2025
@SAKURA-CAT SAKURA-CAT added the 🐛 bug Something isn't working label Jun 5, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a __main__.py entrypoint so that swanlab can be executed directly with python -m swanlab.

  • Introduces a module-level docstring with metadata.
  • Imports and invokes the existing cli() function on execution.
Comments suppressed due to low confidence (2)

swanlab/main.py:1

  • [nitpick] Consider replacing the autogenerated metadata docstring with a concise description of this module’s purpose (e.g., "Entry point for the SwanLab CLI") to align with standard docstring practices.
"""

swanlab/main.py:10

  • Add an integration test to confirm that running python -m swanlab successfully invokes the CLI without errors, ensuring the new entrypoint is exercised.
cli()

@SAKURA-CAT SAKURA-CAT requested a review from Feudalman June 5, 2025 05:54
@SAKURA-CAT SAKURA-CAT merged commit 247dec3 into main Jun 5, 2025
5 checks passed
@SAKURA-CAT SAKURA-CAT deleted the fix/__main__ branch June 5, 2025 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[QUESTION] /Library/Developer/CommandLineTools/usr/bin/python3: No module named swanlab.__main__; 'swanlab' is a package and cannot be directly executed
2 participants