You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since cookiecutter, along with other libraries like inquirer and typer, is used exclusively in the CLI for templating new projects, could we make these optional dependencies? This would reduce the installation footprint.
Also one idea, can we maybe have a script inside crawlee that would install things instead of expecting them to be already part of the crawlee deps? That way only the create command (which would just trigger this script) would install them.
I used the python-package-size tool to measure the size of each package. This tool creates a separate virtual environment for every package, installs the package along with all its transitive dependencies, and measures the total size. Note that the reported size includes all dependencies, so removing a package does not necessarily mean we will save that much space (if the dependencies are shared with other packages).
Cookiecutter
Creating new venv /tmp/tmpbyp2thfj/venv-cookiecutter
Installing cookiecutter: /tmp/tmpbyp2thfj/venv-cookiecutter/bin/pip install cookiecutter
Size of cookiecutter: 21.8 MB
Typer
Creating new venv /tmp/tmpbyp2thfj/venv-typer
Installing typer: /tmp/tmpbyp2thfj/venv-typer/bin/pip install typer
Size of typer: 11.8 MB
Inquirer
Creating new venv /tmp/tmpbyp2thfj/venv-inquirer
Installing inquirer: /tmp/tmpbyp2thfj/venv-inquirer/bin/pip install inquirer
Size of inquirer: 1.2 MB
Wouldn't this mean that pipx run crawlee create my-crawler stop working?
If we made a cli extra, the command would become pipx run crawlee[cli] create my-crawler. If the cli detected missing dependencies, it could just offer the user the right command. Wouldn't that be satisfactory?
If we made a cli extra, the command would become pipx run crawlee[cli] create my-crawler. If the cli detected missing dependencies, it could just offer the user the right command. Wouldn't that be satisfactory?
If we decide to mention uvx as well, the corresponding command would be uvx --with crawlee[cli] crawlee create my-crawler, which is... unsexy. See astral-sh/uv#6296 - the --with flag may become unnecessary in the future.
It seems that uv is still in its early stages. I would wait a few more months before try to migrate. For example, the uv publish feature is currently labeled as experimental.
We don't have to support uvx, people can use it already. We might just want to add that to the landing page or whatever. But that's straying from the original topic here...
Activity
B4nan commentedon Nov 15, 2024
Wouldn't this mean that
pipx run crawlee create my-crawlerstop working?vdusek commentedon Nov 18, 2024
The mentioned packages & their (transitive) dependencies.
Cookiecutter
Inquirer
Typer
B4nan commentedon Nov 18, 2024
Can you also check their install size?
Also one idea, can we maybe have a script inside crawlee that would install things instead of expecting them to be already part of the crawlee deps? That way only the
createcommand (which would just trigger this script) would install them.vdusek commentedon Dec 3, 2024
I used the python-package-size tool to measure the size of each package. This tool creates a separate virtual environment for every package, installs the package along with all its transitive dependencies, and measures the total size. Note that the reported size includes all dependencies, so removing a package does not necessarily mean we will save that much space (if the dependencies are shared with other packages).
Cookiecutter
Typer
Inquirer
janbuchar commentedon Dec 5, 2024
If we made a
cliextra, the command would becomepipx run crawlee[cli] create my-crawler. If the cli detected missing dependencies, it could just offer the user the right command. Wouldn't that be satisfactory?vdusek commentedon Dec 6, 2024
I am ok with that.
janbuchar commentedon Dec 6, 2024
If we decide to mention
uvxas well, the corresponding command would beuvx --with crawlee[cli] crawlee create my-crawler, which is... unsexy. See astral-sh/uv#6296 - the--withflag may become unnecessary in the future.vdusek commentedon Dec 6, 2024
It seems that
uvis still in its early stages. I would wait a few more months before try to migrate. For example, theuv publishfeature is currently labeled as experimental.janbuchar commentedon Dec 6, 2024
We don't have to support uvx, people can use it already. We might just want to add that to the landing page or whatever. But that's straying from the original topic here...
vdusek commentedon Feb 19, 2025
Moving it to new issues and let's discuss it on Monday.
vdusek commentedon Feb 19, 2025
We could utilize the
uv's script dependencies, as @Mantisus stated here:janbuchar commentedon Feb 19, 2025
That, too -
pipxanduvxshould both support script dependencies.But with the new release of
uv, both of these should work equally if we make thatcliextra:refactor!: move `cli` dependencies to optional dependencies (apify#1011)