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

Fix rye add and rye remove to create proper tool.rye section on --dev and --exclude flags #1256

Conversation

flyaroundme
Copy link
Contributor

@flyaroundme flyaroundme commented Jul 21, 2024

Hey!

This is to address issue #1249

Closes #1249

Looks like the [tool.rye] section in pyproject.toml is not created properly if it was not already presented in the file.
This was due to the it not being created as a table.

Tested it like that:

  • Have pyproject.toml without [tool.rye] table:
[project]
authors = [{ name = "xxx", email = "xxx@xxx.com" }]
name = "rye-test"
version = "0.1.0"
description = "wasm sample use py2wasm, rust, wasmer, gowasm, wasmedge"
readme = "README.md"
requires-python = ">=3.11.7"


[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
$ rye add --dev ipython

results in
pyproject.toml

[project]
authors = [{ name = "xxx", email = "xxx@xxx.com" }]
name = "rye-test"
version = "0.1.0"
description = "wasm sample use py2wasm, rust, wasmer, gowasm, wasmedge"
readme = "README.md"
requires-python = ">=3.11.7"


[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.rye]
dev-dependencies = [
    "ipython>=8.26.0",
]

Before fix it was:
pyproject.toml

tool = { rye = { dev-dependencies = [
    "ipython>=8.26.0",
] } }
[project]
authors = [{ name = "xxx", email = "xxx@xxx.com" }]
name = "rye-test"
version = "0.1.0"
description = "wasm sample use py2wasm, rust, wasmer, gowasm, wasmedge"
readme = "README.md"
requires-python = ">=3.11.7"


[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

Thanks!

@charliermarsh charliermarsh added the bug Something isn't working label Jul 21, 2024
@charliermarsh charliermarsh enabled auto-merge (squash) July 21, 2024 12:14
@charliermarsh charliermarsh merged commit 57b7c08 into astral-sh:main Jul 21, 2024
8 checks passed
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.

rye add command: --dev flag is not working properly
2 participants