-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Pre-release version of a package not found even with --allow-prereleases
#3538
Comments
when trying to install as above it doesn't work. # pyproject.toml
[tool.poetry.dependencies]
elastic-enterprise-search = {version = "7.10.0b1", allow-prereleases = true} |
I second this! I'm unable to install pre-release versions with the Also verified that I can install the pre-release version when explicitly defining its version in |
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
poetry works fine. But maybe there is a standard way of defining prerelease versions I am missing? |
looks like doing:
works fine for poetry 1.1.5 works just fine for me. If allowing pre-releases just adding a wildcard |
I know this is an old issue but this still seems to be a problem. |
@xiurobert did you try the version on master? This might have been fixed by #5500. |
I think that poetry takes the view that
in 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):
which 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 I'm struggling to parse that! Really not sure what you mean? |
Should have explained it clearer. Effectively when searching for a compatible version |
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 |
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.
|
Yes, I found the same code - but I don't find any code in the solver that would pay attention to This is consistent with the observed behaviour - it'll use poetry 1.2.0b1 if the constraint is My assertion is that this is reasonable, if confusing, it sounds as though you are more willing to call this a bug. (The a1 vs b1 thing is a bit of a side-issue, perhaps I should drop it. But the flag is called |
Oh what i meant was if you said
This is correct. The solver works only on the pre-selected candidates iirc. And since the
I not saying you are wrong here. I am indicating that the there is a bug in the candidate selection not the solver - ie. we were not selecting pre-releases when searching for package candidates. |
Sorry, didn't get the chance to test it. I ended up returning back to virtualenvs. Will give it a shot again when I work on my personal projects. |
I'm having some trouble installing Poetry version 1.1.13 # pyproject.toml
[tool.poetry.dependencies]
python = "^3.10"
# 1 - Installs version 13.12
# python-telegram-bot = {version = "^13.12", allow-prereleases = true}
# 2 - SolverProblemError
# python-telegram-bot = {version = "20.0a0", allow-prereleases = true}
# 3 - SolverProblemError
# python-telegram-bot = {version = "^20.0a0", allow-prereleases = true} I'm quite confused and not sure how I can install the pre-release 😞 |
2 installs python-telegram-bot 20.a0 just fine for me at both 1.1.13 and master. |
Huh, you're right. Not sure what I was doing wrong earlier 😅 😆 Thanks 👍🏻 user@computer:~/RSS_Feederbot$ poetry --version
Poetry version 1.1.13
user@computer:~/RSS_Feederbot$ cat pyproject.toml
[tool.poetry]
name = "rss_feederbot"
version = "1.0.0"
description = "An RSS feed reading Telegram bot"
license = "MIT"
[tool.poetry.dependencies]
python = "^3.10"
reader = "^2.12"
loguru = "^0.6.0"
python-telegram-bot = {version = "20.0a0", allow-prereleases = true}
emoji = "^1.7.0"
[tool.poetry.dev-dependencies]
black = "^22.3.0"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
user@computer:~/RSS_Feederbot$ poetry install |
This looks like the original request is working now. Testing on
chose
chose
chose i.e.
happily selected So perhaps Although if that's true, I'm not sure why it's recorded in pyproject.toml, since that last command, with or without
i.e. in both cases it guessed the same constraint, locked the same packages, etc. |
Previously I was able to use What doesn't work:
|
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 |
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, If you want to use 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 |
That makes sense... silly of me. I just find it odd that |
Only encountered this in CI, where poetry 1.2 started getting installed (https://github.com/sjdemartini/graphene-django-permissions/actions/runs/3284716438/jobs/5411001549), since originally I was using Poetry 1.1 locally: ``` poetry.core.constraints.version.exceptions.ParseConstraintError: Could not parse version constraint: ^3.0.0* ``` Poetry 1.2 (released August 2022) contained a backwards incompatible change for `allow-preleases` logic, which led to this breakage (and difference from 1.1). See python-poetry/poetry#3538 (comment) for the new preferred approach.
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 |
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. |
-vvv
option).Issue
I am trying to install a pre-release verion of https://github.com/elastic/enterprise-search-python
Their recommended installation method is
When trying to install it with poetry using
Am I doing something wrong? Or is it that this package is configured incorrectly?
The text was updated successfully, but these errors were encountered: