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

chore: convert setup.py to build #2642

Merged
merged 2 commits into from
Nov 12, 2024
Merged

chore: convert setup.py to build #2642

merged 2 commits into from
Nov 12, 2024

Conversation

mxschmitt
Copy link
Member

@mxschmitt mxschmitt commented Nov 12, 2024

Similar to microsoft/playwright-pytest#254 - a little bit more complex here, because we previously were generating multiple wheels out of a single setup.py invocation. This is not supported with their new build infrastructure. To workaround this, I manage the loop from the outside which seems to work as well.

This addresses #2124 (comment).

@mxschmitt mxschmitt force-pushed the convert-to-build branch 4 times, most recently from 12de833 to 8a652e7 Compare November 12, 2024 00:38
@@ -60,132 +108,78 @@ def download_driver(zip_name: str) -> None:


class PlaywrightBDistWheelCommand(BDistWheelCommand):
user_options = BDistWheelCommand.user_options + [
Copy link
Member Author

@mxschmitt mxschmitt Nov 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Env var seems simpler, since option passing via build is not fully working anyways: pypa/setuptools#2491. Changed it from --all to explicitly passing the output wheel name.

print(bundle["wheel"])
exit(0)

from setuptools import setup # noqa: E402
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order here is non-common because we have the dependencies available only in non-build environments since I removed the deps from local-requirements.txt.

@@ -683,7 +683,7 @@ def fulfill(
json: typing.Optional[typing.Any] = None,
path: typing.Optional[typing.Union[str, pathlib.Path]] = None,
content_type: typing.Optional[str] = None,
response: typing.Optional["APIResponse"] = None
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll extract them into a separate PR tomorrow.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extracted into #2646.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its hard to split the changes, since black starts reading [project.requires-python] from the pyproject.toml. Lets land together.

playwright/async_api/_generated.py Show resolved Hide resolved

wheels = base_wheel_bundles
if not self.all:
# Limit to 1, since for MacOS e.g. we have multiple wheels for the same platform and architecture and Conda expects 1.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this comment still relevant? if so restore?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not anymore since we always output a single wheel now instead of multiple like before.

@mxschmitt mxschmitt requested a review from yury-s November 12, 2024 01:25
@mxschmitt mxschmitt merged commit 4fd5de0 into main Nov 12, 2024
39 of 40 checks passed
@mxschmitt mxschmitt deleted the convert-to-build branch November 12, 2024 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants