Skip to content

Commit

Permalink
Fix the script name to be the project name (astral-sh#801)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitsuhiko authored Feb 28, 2024
1 parent 5bbbd7f commit 2111778
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ that were not yet released.

_Unreleased_

- The `init` command now generates a script with the name of the
project rather than `hello`. #801

- Retain markers when adding dependencies with features when uv is used. #807

<!-- released start -->
Expand Down
2 changes: 1 addition & 1 deletion rye/src/templates/pyproject.toml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ classifiers = ["Private :: Do Not Upload"]
{%- if is_script %}

[project.scripts]
hello = {{ name_safe ~ ":main"}}
{{ name }} = {{ name_safe ~ ":main"}}
{%- endif %}

{%- if not is_virtual %}
Expand Down
2 changes: 1 addition & 1 deletion rye/tests/test_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ fn test_init_script() {
+ my-project==0.1.0 (from file:[TEMP_PATH]/project)
"###);

rye_cmd_snapshot!(space.rye_cmd().arg("run").arg("hello"), @r###"
rye_cmd_snapshot!(space.rye_cmd().arg("run").arg("my-project"), @r###"
success: true
exit_code: 0
----- stdout -----
Expand Down

0 comments on commit 2111778

Please sign in to comment.