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

Provide ability to read another .toml file instead of pyproject.toml #4460

Closed
2 tasks done
brechtm opened this issue Aug 31, 2021 · 6 comments
Closed
2 tasks done

Provide ability to read another .toml file instead of pyproject.toml #4460

brechtm opened this issue Aug 31, 2021 · 6 comments
Labels
kind/feature Feature requests/implementations

Comments

@brechtm
Copy link

brechtm commented Aug 31, 2021

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

I am aware that pyproject.toml is a standard in the Python world, but in some cases it can be useful to add another .toml file beside it that builds a different kind of package. This requires Poetry to accept a command line option to point it to this other TOML file. I'm failing to think of a proper name, but something like:

poetry --pyproject alt.toml build

As I'm writing this more and more questions are surfacing [1], so I'm not sure this is a good idea but I'll still post this here for consideration.

[1] e.g. what to do with the venv when switching from one TOML to another

Somewhat related: Ability to specify the directory to run poetry in instead of always using current directory #2179

@brechtm brechtm added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Aug 31, 2021
@finswimmer
Copy link
Member

Hello @brechtm,

thanks for your suggestion. However, poetry follows the principal that there should be only one single source of truth for project metadata (and it should always be the same place). So I don't think we will implement such a feature. Maybe this is something that can be provided by a plugin? The plugin feature is available int the current preview release (1.2.0a2).

Specify the directory where poetry should run in, is another topic as you already linked.

fin swimmer

@brechtm
Copy link
Author

brechtm commented Sep 1, 2021

The use case I had in mind is probably better served by support for specifying multiple projects in the same pyproject.toml (#2270). That way, dependency data can be shared, for example.

@guitarmanvt
Copy link

This doesn't entirely duplicate #2179 , and this ticket actually gets at what I want to do better than that other ticket.

The repo I'm working on provides a pyproject.toml that does not include a [tool.poetry] section. It does include sections for other tools, like black and flake8. I can run poetry init and create the necessary section, but poetry isn't widely-accepted at this company (yet), so I don't want to checkin these changes. That means it's a chore to avoid committing this updated pyproject.toml for every commit.

I want to specify a pyproject.toml file just for poetry, and not for anything else. I can add this special poetry.pyproject.toml to my .gitignore file, and this will satisfy my workflow.

@abn abn removed the status/triage This issue needs to be triaged label Mar 3, 2022
@heimalne
Copy link

heimalne commented Mar 27, 2023

This feature would also be great to work around quirky packages like wxpython or some torch derivatives that expect you to install packages in several steps wxWidgets/Phoenix#2225. With pip you could use call pip twice

pip install attrdict # needs to be installed first for wxpython to install
pip install wxpython ...

With Poetry that's not so easy.

@Kache
Copy link

Kache commented Sep 12, 2023

Another use-case for this: transitional upgrades, either for frameworks or for Python version

e.g. having two pyproject.toml's, one for Python 3.x and another for 3.x+1

in order to have an overlap period where CI needs to pass both builds

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
kind/feature Feature requests/implementations
Projects
None yet
Development

No branches or pull requests

6 participants