-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add support for pyproject.toml files when adding --editable projects … #7670
base: main
Are you sure you want to change the base?
Conversation
…that are on local disk. There is currently a problem where setup_reader.py can only read setup.cfg or setup.py files for adding local packages. This adds support for flitcore and other backends that are defined in pyproject.toml files
immediate thoughts
|
The codebase I work on is only 3.10, do you mind if I add a fallback to use tomlkit for versions <3.11? tomllib is only available in 3.11. |
…rojects that are on local disk." This reverts commit 5f229f0.
…out during testing.
from poetry.utils._compat import tomllib |
Is there a way to run these tests at my desk so I don't keep spamming you? NVM I guess I can just run each of them manually. |
I'm running through all of the tests in the test suite. Are any of the tests known to be broken? It seems like my change has broken like 10+ tests :( |
If you've figured out how to run the tests then you can very easily verify for yourself that they pass without your changes. On the plus side this probably points you in the right direction for figuring out where to add new tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I think the test failures are just due to the test suite relying too much on mocks, making it fragile when we touch the internals. I am also getting them in #7703, but haven't gotten around to look at them.
@@ -498,6 +499,7 @@ def from_directory(cls, path: Path, disable_build: bool = False) -> PackageInfo: | |||
else: | |||
info = get_pep517_metadata(path) | |||
except PackageInfoError: | |||
info = cls.from_pyproject_toml(path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO, instead of putting this here, we should probably create a from_project_static_files
which tries from_pyproject_toml
and then from_setup_files
, and then replace all existing from_setup_files
usages with from_project_static_files
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll have to do this on Monday when I'm back at my desk. Are you one of the maintainers of poetry? It says "FFY00 approved these changes 3 days ago."
There is currently a problem where setup_reader.py can only read setup.cfg or setup.py files for adding local packages. This adds support for flitcore and other backends that are defined in pyproject.toml files
Resolves: #7669