Open dil-gfischhof opened 2 years ago
Can you explain how you see this working with poetry (what commands the user would have to run to install playwright with browsers vs. without them)? Or do you want it to essentially run playwright install
as part of playwright installation?
Hi,
as playwright's strength is browser automation, so I think it should install browser as default.
Installing all would be time and space consuming, so I think installing the one with the largest market share -which is chromium- would be a good choice for default.
The adding method / syntax for browsers should follow optional dependencies: poetry add playwright - would install chromium poetry add playwright[chromium] - would install chromium poetry add playwright[all]- would install all poetry add playwright[chrome, firefox] - would install chrome and firefox poetry add playwright[no-browser] - would not install any browser
and I think it would be good to add browser dependencies automatically too, specially because the user may not know what are the dependencies and what kind of dependencies are there, what will not work without them
BR, George
As of right now poetry add playwright does not work instead it throws and error. I am currently using poetry 1.1.13. How should I structure the commands to add playwright?
@codejedi-ai What error do you have?
Currently I use https://github.com/pyppeteer/pyppeteer within a python library to launch a headless chrome instance, do some "stuff"
https://github.com/pyppeteer/pyppeteer currently will install a chrome instance on the first run. For example when testing a poetry project with 'tox'. As this is intended for a library and poetry will not provide the means to add a post install script to my lib is it possible to install a browser at runtime as with pyppeteer?
Potential solutions to this problem are:
from playwright import install
install("chrome")
There is already a project that acheived this by calling pyright install with the subprocess module https://pypi.org/project/install-playwright/
Thank you for your time :)
Hi, I ran into this problem while setting up langchain for webscraping. Looks like Poetry as a tool will never support post-install scripts. @mxschmitt How long is the feedback collection process ? The 7 likes on @dil-gfischhof 's approach makes it seem like there is consensus.
+1 for @dil-gfischhof 's suggestion
Using optional dependencies to install browsers would simplify CI, and help the dev workflow, for the project I'm currently working on. Would be great to see a resolution on this issue, either way, given the original creation date.
+1 for the suggestion
came across the issue while deploying a web scraping service, its clean if we can do this within poetry
Playwright should be able to install browser binaries from poetry install (Python) (Specially related to CI systems)
Hi Folks,
Two things to start my feature request with: 1.) Poetry is practically the new way of Python package management 2.) Installing project dependencies is practically the responsibility of the project (yes, the borders are flexible...)
So I have the following situation: we have a project which needs in-browser testing, and API testing, perhaps someone will need other (performance etc) testing, which does not require browser.
Right now we use Poetry (Python) to install dependencies, it installs Playwright, but is not able to tell Playwright to install browsers binaries.
So now we have to setup our CI to install browser binaries, but the other CI jobs do not need that, so installing is just waste of time and space. But it would be good to have only one type of test job in CI: install project dependencies, and start testing. And if the project needs browser then it should install it automatically.
BR, George