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

Feature request: support for PDM package manager #191

Open
OldaKodym opened this issue Feb 23, 2024 · 6 comments
Open

Feature request: support for PDM package manager #191

OldaKodym opened this issue Feb 23, 2024 · 6 comments

Comments

@OldaKodym
Copy link

PDM is a modern package manager that works similarly to poetry but in my experience its way faster for larger distribution like pytorch and it also supports additional nifty stuff like centralized package caches.

Beyond the amazing stuff you guys are already putting out there, are you considering adding other package managers that gain a significant userbase?

@ainoam
Copy link

ainoam commented Feb 25, 2024

Thanks for suggesting @OldaKodym.

We're always keeping an eye on the ML development ecosystem to help ClearML users streamline their work with their favorite tools.

We'll pin this to our roadmap. Having this here will help push it forward as more users support this request 😃

@OldaKodym
Copy link
Author

@ainoam Cool, thanks for the response!

In the meantime, it would be great if there was general support for pyproject.toml-based build process instead of always using pip install requirements.txt. That would let me at least use the pip build frontend with custom build backends like pdm-backend. However, right now if I try to specify a path to a project folder with Task.add_requirements(), it fails because any existing path gets interpreted as a requirements file.

The things is I can actually get it to work if I want the agent to build a local module using the pyproject.toml, by doing the following:

Task.ignore_requirements("my_module")
Task._force_requirements[
        "my_module @ file:///${PROJECT_ROOT}/path/to/my_module"
    ] = None

But it feels quite hacky. It would be nice to have an option similar to running Task.force_requirements_env_freeze() that would allow me to specify the pyproject.toml file instead of requirements file.

@ainoam
Copy link

ainoam commented Feb 28, 2024

@OldaKodym pyproject.toml is already supported via [poetry]
(

# supported options: pip, conda, poetry
).

Just configure the agent to use poetry as package manager and it will ignore the "installed packages" and use the pyproject.toml inside the repo (and of course update back for visibility)

@OldaKodym
Copy link
Author

OldaKodym commented Feb 28, 2024

@ainoam The issue is that poetry is, surprisingly, not PEP 621 compliant (uses [tool.poetry] instead of standard [project] table), so the poetry build frontend cannot be used to install actual PEP-compliant pyproject.toml files that all the other tools use. I can do that with any other build frontend including pip, but not poetry and therefore, not with clearml-agent.

Basically, the option to run pip build frontend with pyproject.toml file will enable installing projects built with any PEP-compliant build backend like pdm, hatch and any others. I believe this enables quite a few use cases, with the added benefit of compatibility with standard tools like pip(env) and setuptools.

@ainoam
Copy link

ainoam commented Mar 7, 2024

Thanks for the detailed information @OldaKodym.
Is PDM a "drop in" replacement for poetry i.e. same frontend interface to install/run?

@OldaKodym
Copy link
Author

@ainoam the basic frontend interface is similar. Running pdm install in project root will create a venv (optionally), read or create a lockfile and install the packages, then pdm run python can be used to run scripts using the installed env.
There are of course some differences in usage such as poetry show vs pdm list but the tools are similar.

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

No branches or pull requests

2 participants