-
Notifications
You must be signed in to change notification settings - Fork 326
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
feat: Improve project bootstrapping #538
Conversation
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.
Pull request is neither linked to an issue or epic nor labeled as adhoc!
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.
Pull request is neither linked to an issue or epic nor labeled as adhoc!
okay, this could use some testing now... plus there's a bunch of stuff to consider
|
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.
Nice, just a few comments
Thanks for the review @vdusek! Do you have anything to add regarding those points for consideration? |
That is generally how pip works. I wouldn't add additional overhead here. Simply dumping the dependencies into
IMO the current setup is fine. Also, all options have default values.
That would be a nice feature, but I wouldn't prioritize it at this moment. We have a guide covering that, which should be sufficient for now.
I would suggest throwing an error. If a user wants to use Poetry, the option should be conditionally on Poetry being installed. |
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.
the Pip versions does not work
I generally agree. But how would you ensure that
It's a 15-minute adventure, the only problem is that it'd make the dialog longer. |
Relevant discussion - https://apify.slack.com/archives/C06ENBV1B9Q/p1728907202834259 |
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.
We provide http client option together with the PW crawler, is that what we want?
src/crawlee/project_template/{{cookiecutter.project_name}}/Dockerfile
Outdated
Show resolved
Hide resolved
...e/project_template/{{cookiecutter.project_name}}/{{cookiecutter.__package_name}}/__main__.py
Outdated
Show resolved
Hide resolved
This comment was marked as resolved.
This comment was marked as resolved.
As long as we don't use |
I would not expose the option to the user, IMO it would results only to confusion. Net a request though. |
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 tested a lot of variants, seems to be working, good job!
This adds a unified `crawlee/project_template` template. The original `playwright` and `beautifulsoup` templates are kept for compatibility with older versions of the CLI. The user is now prompted for package manager type (pip, poetry), crawler type, start URL and whether or not Apify integration should be set up. - closes apify#317 - closes apify#414 (http client selection is not implemented) - closes apify#511 - closes apify#495 ### TODO - [x] http client selection - [x] disable poetry option if it isn't installed - [x] rectify the pip-based setup 1. **manual dependency installation** - no automatic installation, just dump requirements.txt and tell the user to handle it any way they want 2. **pip+venv** - dump requirements.txt, make a virtualenv (.venv) using the current python interpreter, install requirements and tell user to activate it - ~should be disabled if `venv` module is not present~ it's stdlib - [x] test the whole thing on Windows (mainly the various package manager configurations) - [x] fix how cookiecutter.json is read (it is not present when installing via pip)
This adds a unified
crawlee/project_template
template. The originalplaywright
andbeautifulsoup
templates are kept for compatibility with older versions of the CLI.The user is now prompted for package manager type (pip, poetry), crawler type, start URL and whether or not Apify integration should be set up.
CurlImpersonateHttpClient
warning on Windows #495TODO
1. manual dependency installation - no automatic installation, just dump requirements.txt and tell the user to handle it any way they want
2. pip+venv - dump requirements.txt, make a virtualenv (.venv) using the current python interpreter, install requirements and tell user to activate it
-
should be disabled ifit's stdlibvenv
module is not present