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

pyproject.toml formatting isn't preserved #628

Closed
cnpryer opened this issue Apr 25, 2023 · 1 comment · Fixed by #854
Closed

pyproject.toml formatting isn't preserved #628

cnpryer opened this issue Apr 25, 2023 · 1 comment · Fixed by #854
Labels
bug Something isn't working
Milestone

Comments

@cnpryer
Copy link
Owner

cnpryer commented Apr 25, 2023

Labeling this as a bug because, imo, its a ux problem. Technically huak could take an opinion on pyproject.toml formatting (which it still may, but it's undecided).

Using the following pyproject.toml

[project]
name = "mock_project"
version = "0.0.1"
description = ""
dependencies = [
    "click ==8.1.3",
]

[[project.authors]]
name = "Chris Pryer"
email = "[email protected]"

[project.optional-dependencies]
dev = [
    "pytest >=6",
    "black ==22.8.0",
    "isort ==5.12.0",
]

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

huak add xlcsv also updates the ordering of the tables

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

[project]
name = "mock_project"
version = "0.0.1"
description = ""
dependencies = [
    "click ==8.1.3",
    "xlcsv ==0.3.0",
]

[[project.authors]]
name = "Chris Pryer"
email = "[email protected]"

[project.optional-dependencies]
dev = [
    "pytest >=6",
    "black ==22.8.0",
    "isort ==5.12.0",
]
@cnpryer cnpryer added the bug Something isn't working label Apr 25, 2023
@cnpryer cnpryer added this to the General-use release milestone Oct 26, 2023
@cnpryer
Copy link
Owner Author

cnpryer commented Nov 8, 2023

pyproject-toml-rs as a parser is nice, but from what I can tell trying to use it to also modify and write contents to files can be challending. See related PyO3/pyproject-toml-rs#10.

In #831 I'm using toml_edit, but I'm also thinking about situations with [tool] used:

[tool.huak]
toolchain = "3.12"

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 a pull request may close this issue.

1 participant