poetry add breaks existing [build-system]
See original GitHub issue-
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: DISTRIB_ID=Ubuntu DISTRIB_RELEASE=20.04
-
Poetry version: Poetry version 1.0.10
-
Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/ycd/2311f6e9a48cb7e1e8811c87247dc3a6
Issue
When adding a new dependency with poetry add example[extra1, extra2]
it tries to override existing [build-system] and breaks it.
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
Also streamable link: https://streamable.com/xwvej8
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Basic usage | Documentation | Poetry - Python dependency ...
This is by design, it ensures that your project does not break because of unexpected changes in dependencies. Commit your poetry.lock file to...
Read more >Dependency Management With Python Poetry
Start a new Poetry project; Add Poetry to an existing project; Use the pyproject.toml file; Pin dependencies; Install dependencies with poetry.
Read more >Implementing dependency management with Python Poetry
lock' file, the process changes slightly. Assuming the .toml and .lock files are in sync, Poetry will use the existing .lock file to...
Read more >Python Virtual Environments tutorial using Virtualenv and Poetry
pip install virtualenv. Create environment folder inside the current package/project directory: $ python -m venv env ...
Read more >How I break up with pip and fall in love with poetry my new ...
In the following sections, I will guide you on how to migrate an existing project from pip to poetry. Installing Poetry in your...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Had a quick look, it’s a bug in how we parse the name. That should really change and be normalised in core.
@abn the biggest issue is resolved, but it’s not yet working correctly (I’m using the latest pre-release). That’s the end of my
pyproject.toml
(I concatenate twopyproject.toml
files during project generation withcookiecutter
- one with poetry stuff, ending with[build-system]
table, and another one with tool configs like isort):Then, when I run
poetry add ...
during development, TOML tables are automatically reordered, but there’s an empty line missing between tables:To make it work properly, you have to have an additional empty line at the end of the file, but it would be really annoying to especially exclude
pyproject.toml
fromend-of-file-fixer
pre-commit hook to fix this behaviour. Regardless of the error - I don’t really understand what’s the reason behind that reordering behaviour?