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
{{ message }}
Repository navigation
Pre-release version of a package not found even with --allow-prereleases #3538
python -m pip install --pre elastic-enterprise-search
which works fine.
When trying to install it with poetry using
poetry add --allow-prereleases elastic-enterprise-search
I am getting an old version: 0.2.1 (the same as the one without the --allow-prereleases switch.
Am I doing something wrong? Or is it that this package is configured incorrectly?
Reacted by Ragnar Hägg, KotlinIsland, DetachHead, Dan Loewenherz and Alexandr Dzhurinskij
I second this! I'm unable to install pre-release versions with the --allow-prerelease flag using either Poetry 1.1.4 or 1.1.5. Even did a fresh reinstall of poetry on my system and still have the same problem. However, it does work for my colleagues with the same/similar setup.
Also verified that I can install the pre-release version when explicitly defining its version in pyproject.toml and it works in that case. However, I would like it to always pick the latest pre-release...
mypackage = { version = "^3.0.0*", allow-prereleases = true}
works fine for poetry 1.1.5 works just fine for me. If allowing pre-releases just adding a wildcard * is probably the best bet to get the latest pre-release.
Reacted by Clément Walter, Clint Mod, Gabriele N. Tornetta, Honza Javorek, Nguyễn Hồng Quân, Sander van Dragt, Amit Parekh, Luke Hsiao, Josh Orr, Sergio García Prado and 5 more
^3.0.0b1 == { version = "^3.0.0", allow-prereleases = true } -> this includes all pre-releases in the lowerbound. Unless the upperbound is <= pre-releases there are not included (iirc).
Should have explained it clearer. Effectively when searching for a compatible version ^3.0.0 with allow-prereleases = true behaves the same as ^3.0.0b1. The behaviour being, 3.0.0a1 or earlier is disallowed, 3.0.0b1 | 3.0.0b2 | 3.0.0rc1 | 3.0.0 etc. are allowed.
This looks like the original request is working now.
Testing on Poetry (version 1.2.0b2) (which includes #5500), in a trivial project using poetry-1.2 init -n and then poetry-1.2 lock. (poetry-1.2 is because I'm using pipx, and I already have Poetry 1.1.13 as poetry)
chose 1.12.0rc1 (it guessed ^1.12.0rc1 for the version match), which is a newer pre-release than the latest release. Without --allow-prereleases it chooses 1.11.1, with guessed version match ^1.11.1.
chose 0.31b0 (it guessed ^0.31b0) as this is the latest pre-release, and there has never been a non-pre-release. It does the same thing without --allow-prereleases. I note that the pyproject.toml doesn't record the allow-prereleases flag in this case, because it wasn't provided, but a pre-release version was selected. I'm not sure if there's any scope for this to be an issue though, since once we have the guessed version match, that will accept pre-releases anyway, irrespective of the flag.
So perhaps --allow-prereleases could be slightly-better documented that it only applies when guessing a constraint for names provided without constraints (which is probably the common use-case).
Although if that's true, I'm not sure why it's recorded in pyproject.toml, since that last command, with or without --allow-prereleases has only the following, non-meaningful differences:
Previously I was able to use ^3.0.* to select the latest pre-release, but it seems that's broken now. Is there a new syntax that works for the latest pre-release?
What doesn't work:
aiogram = { version = "^3.0.*", allow-prereleases = true}
aiogram = { version = "3.0.*", allow-prereleases = true}
aiogram = { version = "3.*", allow-prereleases = true}
aiogram = { version = "^3.0.0", allow-prereleases = true}
aiogram = { version = "^3.0", allow-prereleases = true}
aiogram = { version = "^3", allow-prereleases = true}
This issue is a bit of a jumble -- as far as I can tell however, things are currently as they should be. That is to say, --allow-prereleases works as expected during poetry add, and interacts properly now with version constraints.
If you want to use ^ with a beta release, you need to realize the part that comes after ^ sets the lower bound. So ^3.0.0a1, with allow-prereleases = true will take the latest prerelease greater to alpha 1 or later. ^3 with allow-prereleases = true will work for 3.0.1a1, but that is because it comes after the lower bound of 3.0.0.
I'm closing this for now -- if you have a request/idea for docs improvement, please open a docs issue. If you think you are having trouble with allow-prereleases itself (as opposed to figuring out the correct version specifier for your use case), please feel free to chime in here -- but I would make sure your usage of the version specifier is correct first.
Is this supposed to work if we keep the version the same (e.g. rc1) but force re-releases into a development PyPI? This changes the buildID of the underlying package but I can't make poetry to fetch the new one unless I append the buildID to the dependency in pyproject.toml
Activity
kubami commentedon Feb 10, 2021
when trying to install as above it doesn't work.
however when I specify the version explicitly the page installs correctly
markf94 commentedon Mar 31, 2021
I second this! I'm unable to install pre-release versions with the
--allow-prereleaseflag using either Poetry1.1.4or1.1.5. Even did a fresh reinstall ofpoetryon my system and still have the same problem. However, it does work for my colleagues with the same/similar setup.Also verified that I can install the pre-release version when explicitly defining its version in
pyproject.tomland it works in that case. However, I would like it to always pick the latest pre-release...ClementWalter commentedon Apr 14, 2021
I have the same problem with poetry 1.1.5. All private repos so I can't point out to the given packages, but essentially:
does not resolve to using the
3.0.0.dev0version, while if I write directly:poetry works fine.
But maybe there is a standard way of defining prerelease versions I am missing?
alexporter8013 commentedon May 19, 2021
looks like doing:
works fine for poetry 1.1.5 works just fine for me. If allowing pre-releases just adding a wildcard
*is probably the best bet to get the latest pre-release.fix pre-releases for gql
bushshrub commentedon May 18, 2022
I know this is an old issue but this still seems to be a problem.
abn commentedon May 19, 2022
@xiurobert did you try the version on master? This might have been fixed by #5500.
dimbleby commentedon May 19, 2022
I think that poetry takes the view that
^3.0.0is asking for something >= 3.0.03.0.0b1is strictly before 3.0.0in which case I wouldn't expect #5500 to make a difference. But also it's not clear to me that this is wrong!
For instance today (poetry 1.2.0b1 exists but 1.2.0 does not):
poetry = { version = "^1.0.0", allow-prereleases = true}does allow version 1.2.0b1 to be installedpoetry = { version = "^1.2.0", allow-prereleases = true}fails, finding no matching versionswhich is probably correct, there is no available version that is >= 1.2.0.
Possibly this should be documented or documented better, I haven't checked what the docs do say but clearly this is confusing to lots of people.
abn commentedon May 19, 2022
^3.0.0b1=={ version = "^3.0.0", allow-prereleases = true }-> this includes all pre-releases in the lowerbound. Unless the upperbound is<=pre-releases there are not included (iirc).dimbleby commentedon May 19, 2022
@abn I'm struggling to parse that! Really not sure what you mean?
abn commentedon May 19, 2022
Should have explained it clearer. Effectively when searching for a compatible version
^3.0.0withallow-prereleases = truebehaves the same as^3.0.0b1. The behaviour being,3.0.0a1or earlier is disallowed,3.0.0b1 | 3.0.0b2 | 3.0.0rc1 | 3.0.0etc. are allowed.dimbleby commentedon May 19, 2022
You mean: that's what you think the behaviour should be? Per my example - and indeed this issue - that's not what the behaviour is.
(Isn't
3.0.0a1just as good a pre-release version as3.0.0b1- why should one but not the other be disallowed?)abn commentedon May 19, 2022
When selecting packaegs if dependency allows for prereleases, they are selected else discarded.
poetry/src/poetry/repositories/repository.py
Lines 59 to 63 in c880cd7
When finding the best candidate, we select the prerelease if there are only prereleases available and/or preleases are explicitly allowed.
poetry/src/poetry/version/version_selector.py
Lines 47 to 51 in c880cd7
All pre-releases are not made equal. This is more about PEP 440 that poetry.
Ref: https://peps.python.org/pep-0440/#pre-releases
3 remaining items
dbrennand commentedon Jun 1, 2022
I'm having some trouble installing
python-telegram-botpre-release version20.0a0:I'm quite confused and not sure how I can install the pre-release 😞
dimbleby commentedon Jun 1, 2022
2 installs python-telegram-bot 20.a0 just fine for me at both 1.1.13 and master.
dbrennand commentedon Jun 3, 2022
Huh, you're right. Not sure what I was doing wrong earlier 😅 😆 Thanks 👍🏻
TBBle commentedon Jun 7, 2022
This looks like the original request is working now.
Testing on
Poetry (version 1.2.0b2)(which includes #5500), in a trivial project usingpoetry-1.2 init -nand thenpoetry-1.2 lock. (poetry-1.2is because I'm using pipx, and I already have Poetry 1.1.13 aspoetry)chose
8.1.0a1, which is the latest pre-release before 8.2.0. Without--allow-preleases, it chooses7.17.0.chose
1.12.0rc1(it guessed^1.12.0rc1for the version match), which is a newer pre-release than the latest release. Without --allow-prereleases it chooses1.11.1, with guessed version match^1.11.1.chose
0.31b0(it guessed^0.31b0) as this is the latest pre-release, and there has never been a non-pre-release. It does the same thing without--allow-prereleases. I note that the pyproject.toml doesn't record theallow-prereleasesflag in this case, because it wasn't provided, but a pre-release version was selected. I'm not sure if there's any scope for this to be an issue though, since once we have the guessed version match, that will accept pre-releases anyway, irrespective of the flag.i.e.
happily selected
1.12.0rc1.So perhaps
--allow-prereleasescould be slightly-better documented that it only applies when guessing a constraint for names provided without constraints (which is probably the common use-case).Although if that's true, I'm not sure why it's recorded in pyproject.toml, since that last command, with or without
--allow-prereleaseshas only the following, non-meaningful differences:i.e. in both cases it guessed the same constraint, locked the same packages, etc.
wolph commentedon Oct 6, 2022
Previously I was able to use
^3.0.*to select the latest pre-release, but it seems that's broken now. Is there a new syntax that works for the latest pre-release?What doesn't work:
dimbleby commentedon Oct 6, 2022
all of the above are asking for a version that is equal to or later than 3.0.0. A pre-release is before 3.0.0.
Provide a version bound that does not rule out the pre-release you want eg
<4neersighted commentedon Oct 6, 2022
This issue is a bit of a jumble -- as far as I can tell however, things are currently as they should be. That is to say,
--allow-prereleasesworks as expected duringpoetry add, and interacts properly now with version constraints.If you want to use
^with a beta release, you need to realize the part that comes after^sets the lower bound. So^3.0.0a1, withallow-prereleases = truewill take the latest prerelease greater to alpha 1 or later.^3withallow-prereleases = truewill work for 3.0.1a1, but that is because it comes after the lower bound of3.0.0.I'm closing this for now -- if you have a request/idea for docs improvement, please open a docs issue. If you think you are having trouble with
allow-prereleasesitself (as opposed to figuring out the correct version specifier for your use case), please feel free to chime in here -- but I would make sure your usage of the version specifier is correct first.wolph commentedon Oct 6, 2022
That makes sense... silly of me. I just find it odd that
^3.0.*worked earlier and stopped working nowFix graphene-django version specification for Poetry 1.2
ozancaglayan commentedon Sep 1, 2023
Hello,
Is this supposed to work if we keep the version the same (e.g. rc1) but force re-releases into a development PyPI? This changes the buildID of the underlying package but I can't make poetry to fetch the new one unless I append the buildID to the dependency in
pyproject.tomlgithub-actions commentedon Feb 29, 2024
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.