Open noamraph opened 1 week ago
rye init tmpproj
creates a library project by default. What you want is rye init --script tmpproj
which creates a project that is intended to be executable. Using the --script
flag will create an __init__.py
file and __main__.py
file and also add
[project.scripts]
"tmpproj" = "tmpproj:main"
in your pyproject.toml file. And you can run
❯ rye run tmpproj
Hello from tmpproj!
I think this was the behavior in previous versions, I don't know why it was changed.
I suggest to have a section
[project.scripts]
in the initial pyproject.toml, which will call the already-createdhello
function.Currently when I do
rye init
the pyproject.toml doesn't have this section, and I have to google to find what to add.Thanks!
Details:
Version:
pyproject.toml created after running
rye init tmpproj
:When adding this:
I can run: