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

Poetry's internal pyproject.toml continually grows larger with empty lines #6457

Closed
3 tasks done
mtkennerly opened this issue Sep 8, 2022 · 2 comments · Fixed by #7705
Closed
3 tasks done

Poetry's internal pyproject.toml continually grows larger with empty lines #6457

mtkennerly opened this issue Sep 8, 2022 · 2 comments · Fixed by #7705
Labels
area/plugin-api Related to plugins/plugin API kind/bug Something isn't working as expected

Comments

@mtkennerly
Copy link

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Windows 11
  • Poetry version: 1.2.0
  • Link of a Gist with the contents of your pyproject.toml file: N/A

Issue

While I've been testing installing/uninstalling a plugin I wrote and running poetry self add ..., I've noticed that my %APPDATA%/pypoetry/pyproject.toml file is growing with more and more blank lines. Right now, there are 319,760 lines total. It looks like this:

[tool.poetry]
name = "poetry-instance"
version = "1.2.0"
description = ""
authors = []
license = ""

[tool.poetry.dependencies]
python = "3.10.5"
poetry = "1.2.0"

[tool.poetry.group.additional.dependencies]

# around 800 blank lines here

poetry-dynamic-versioning = {extras = ["plugin"], version = "^0.18.0"}





poetry-dynamic-versioning-plugin = "^0.4.0"

# then the rest  of the file is blank

Testing from a blank slate

Delete Poetry's internal pyproject.toml and poetry.lock files.

Run: poetry self add poetry-dynamic-versioning[plugin]. Now pyproject.toml looks like:

[tool.poetry]
name = "poetry-instance"
version = "1.2.0"
description = ""
authors = []
license = ""

[tool.poetry.dependencies]
python = "3.10.5"
poetry = "1.2.0"

[tool.poetry.group.additional.dependencies]
poetry-dynamic-versioning = {extras = ["plugin"], version = "^0.18.0"}

Run: poetry self remove poetry-dynamic-versioning. Now pyproject.toml looks like:

[tool.poetry]
name = "poetry-instance"
version = "1.2.0"
description = ""
authors = []
license = ""

[tool.poetry.dependencies]
python = "3.10.5"
poetry = "1.2.0"

[tool.poetry.group.additional.dependencies]



Run: poetry self add poetry-dynamic-versioning[plugin]. Now pyproject.toml looks like:

[tool.poetry]
name = "poetry-instance"
version = "1.2.0"
description = ""
authors = []
license = ""

[tool.poetry.dependencies]
python = "3.10.5"
poetry = "1.2.0"

[tool.poetry.group.additional.dependencies]



poetry-dynamic-versioning = {extras = ["plugin"], version = "^0.18.0"}




@mtkennerly mtkennerly added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 8, 2022
@neersighted neersighted added area/plugin-api Related to plugins/plugin API and removed status/triage This issue needs to be triaged labels Sep 8, 2022
@kristang
Copy link

kristang commented Jan 5, 2023

Adding additional information from my duplicate issue:

My best guess is that the problem seems to be centered around how generate_system_pyproject touches and parses the lines and writes them back for the preserved keys of {"group", "source"}. It seems to go through Pathlib and uses the inherited write_text from pathlib.Path class.

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/plugin-api Related to plugins/plugin API kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants