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

Revert "prefer to avoid casts (#468)" #492

Merged
merged 1 commit into from
Oct 5, 2022

Conversation

neersighted
Copy link
Member

This reverts commit 743e09c.

At runtime, during consumption via the prepare_metadata_for_build_wheel,
API, some of these values were in fact not what their typing was
asserted to be. This would cause a failure when the assertion failed.

This reverts commit 743e09c.

At runtime, during consumption via the prepare_metadata_for_build_wheel,
API, some of these values were in fact not what their typing was
asserted to be. This would cause a failure when the assertion failed.
@sonarcloud
Copy link

sonarcloud bot commented Oct 5, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.8% 0.8% Duplication

@neersighted neersighted enabled auto-merge (rebase) October 5, 2022 21:35
@dimbleby
Copy link
Contributor

dimbleby commented Oct 5, 2022

OutOfOrderTableProxy?!? aren't tomlkit types fun?

full reversion of this MR is an overshoot but I suppose it's simple enough to revert most of the revert

@dimbleby
Copy link
Contributor

dimbleby commented Oct 5, 2022

diff --git a/src/poetry/core/pyproject/toml.py b/src/poetry/core/pyproject/toml.py
index 6c8e79c..6e55912 100644
--- a/src/poetry/core/pyproject/toml.py
+++ b/src/poetry/core/pyproject/toml.py
@@ -64,14 +64,14 @@ class PyProjectTOML:
         return self._build_system

     @property
-    def poetry_config(self) -> Table:
+    def poetry_config(self) -> dict[str, Any]:
         from tomlkit.exceptions import NonExistentKey

         try:
             tool = self.data["tool"]
             assert isinstance(tool, dict)
             config = tool["poetry"]
-            assert isinstance(config, Table)
+            assert isinstance(config, dict)
             return config

should be enough

@neersighted neersighted merged commit 1ef78d3 into python-poetry:main Oct 5, 2022
@neersighted
Copy link
Member Author

I'm going with the full revert for 1.3.1 -- a PR with a V2 that fixes the assertion is very welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants