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

support updating all packages when using --prerelease #2552

Closed
DetachHead opened this issue Jan 11, 2024 · 7 comments · Fixed by #2554
Closed

support updating all packages when using --prerelease #2552

DetachHead opened this issue Jan 11, 2024 · 7 comments · Fixed by #2554
Assignees
Labels
⭐ enhancement Improvements for existing features

Comments

@DetachHead
Copy link
Contributor

Is your feature/enhancement proposal related to a problem? Please describe.

i have some dependencies where i want to resolve prerelease versions, but i also don't want them to be reverted to release versions when running pdm update to bump all my dependencies.

currently to do this, i need to run two commands:

pdm update --prerelease foo bar  # update the dependencies i want prereleases for
pdm update  # update everything else

Describe the solution you'd like

maybe it can be specified in the pyproject.toml:

[tool.pdm.dev-dependencies]
dev = [
    {dependency = "foo>=1.0", prerelease=true},
    {dependency = "bar>=1.0", prerelease=true},
    "baz>=2.1",
]

that way, all i have to do is run pdm update

@DetachHead DetachHead added the ⭐ enhancement Improvements for existing features label Jan 11, 2024
@frostming
Copy link
Collaborator

frostming commented Jan 11, 2024

A little trick, use prerelease versions in the version specifier:

dev = [
    "foo>=1.0a0",  # allows prereleases to be locked
    "bar>=1.0a0",
    "baz>=2.1",
]

We won't support a table as dependency specification, unless there is a standard for this(looking forward to PEP 735)

@DetachHead
Copy link
Contributor Author

in my case, i still want to support versions older than the prerelease for prod dependencies, but in the dev environment i want it to resolve to the prerelease versions

@frostming
Copy link
Collaborator

in my case, i still want to support versions older than the prerelease for prod dependencies, but in the dev environment i want it to resolve to the prerelease versions

Sorry I don't get your point, you know there is only one pin for each package, so what version do you want to resolve to?

@DetachHead
Copy link
Contributor Author

sorry i probably didn't explain my use case very well. basically, i want a pre-release version to be pinned, while still supporting release versions that are older. i maintain a pytest plugin that supports the following versions:

dependencies = [
    "pytest<9,>=7"
]

pytest 8.0 has not been released yet, but i want pdm to pin it to 8.0.0rc1 in my dev environment. however i still want users of my plugin to not have to use a prerelease version of pytest, which is why i can't just specify the prerelease version in the dependencies.

i shouldn't have used dev dependencies in the OP, because i think this issue is only relevant for prod dependencies

@frostming
Copy link
Collaborator

dependencies = [
    "pytest<9,>=7"
]

Okay, so you want to pin a rc version in your development environment but the end users who install the library should never use a prerelease, right?

@DetachHead
Copy link
Contributor Author

yeah

@frostming
Copy link
Collaborator

What you actually need is the ability to remember what packages allow prereleases in the resolution result. Unfortunately we don't support this for now and you have to specify --prerelease every time.

@frostming frostming self-assigned this Jan 12, 2024
frostming added a commit that referenced this issue Jan 12, 2024
frostming added a commit that referenced this issue Jan 12, 2024
…fic package

* feat: support updating all packages when using `--prerelease`
Fixes #2552

Signed-off-by: Frost Ming <[email protected]>

* feat: keep allow_prereleases

Signed-off-by: Frost Ming <[email protected]>

* update news

Signed-off-by: Frost Ming <[email protected]>

* ignore coverage

Signed-off-by: Frost Ming <[email protected]>

* ignore coverage

Signed-off-by: Frost Ming <[email protected]>
frostming added a commit that referenced this issue Jan 12, 2024
…fic package

* feat: support updating all packages when using `--prerelease`
Fixes #2552

Signed-off-by: Frost Ming <[email protected]>

* feat: keep allow_prereleases

Signed-off-by: Frost Ming <[email protected]>

* update news

Signed-off-by: Frost Ming <[email protected]>

* ignore coverage

Signed-off-by: Frost Ming <[email protected]>

* ignore coverage

Signed-off-by: Frost Ming <[email protected]>
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

Successfully merging a pull request may close this issue.

2 participants