Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up a project script #173

Closed
wants to merge 1 commit into from
Closed

Conversation

K20shores
Copy link
Collaborator

To get the script to work with

[project.scripts]
music_box = "acom_music_box:main"

We need to be able to run something like from acom_music_box import main; main()

To achieve that, I had to rename music_box_main.py to acom_music_box.py and put everything inside the if __name__ == '__main__': block into a function called main

@K20shores K20shores requested a review from carl-drews July 2, 2024 13:51
@carl-drews
Copy link
Collaborator

This solution concerns me, because acom_music_box was already the project/package name before I started work. I was also following the pattern in the test cases:

if __name__ == "__main__":
    test = TestChapman()
    test.test_run()

Maybe the scripts simply have to have a main(). Let me investigate your rename suggestion a little bit more.

@K20shores K20shores closed this Jul 2, 2024
@K20shores K20shores deleted the project_script branch September 17, 2024 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants