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

pdm export with the --group option #2767

Open
renaudjester opened this issue Apr 3, 2024 · 0 comments
Open

pdm export with the --group option #2767

renaudjester opened this issue Apr 3, 2024 · 0 comments
Labels
⭐ enhancement Improvements for existing features

Comments

@renaudjester
Copy link

Problem

I want to create a requirement file using the pdm export command for a specific --group. Though, I cannot seem to make it work except if I do some workaround.

Here is a pyproject.toml that can be used:

[project]
name = "test_pdm"
version = "0.1.0"
description = "Default template for PDM package"
authors = [
    {name = "renaudjester", email = "hello"},
]
dependencies = [
    "sentry-sdk>=1.44.1",
]
requires-python = "==3.9.*"
readme = "README.md"
license = {text = "MIT"}

[project.optional-dependencies]
group1 = [
    "pandas>=2.2.1",
]
group2 = [
    "aiohttp>=3.9.3",
]
[tool.pdm]
distribution = false

[tool.pdm.dev-dependencies]
dev = [
    "black>=24.3.0",
]

To be able to get only the "group1" I am doing:
pdm export --group group1 --no-default --prod -o requirements.txt

What I expect

Something more concise like:
pdm export --group group1 -o requirements.txt
as for me the --no-default --prod is not very natural and well documented. It seems quite confusing to use those two options at the same time.
I think that poetry has --only and --with options, that could be a great addition.
Maybe I am missing something and if it's the case I'd be happy to get a proper way to do this!

@renaudjester renaudjester added the ⭐ enhancement Improvements for existing features label Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐ enhancement Improvements for existing features
Projects
None yet
Development

No branches or pull requests

1 participant