Closed amal-khailtash closed 4 years ago
The problem seems to be with packages with a/b. ... (alpha/beta) designation. The same thing happens with sty.
Search:
$ poetry search sty
sty (1.0.0b8)
Add:
$ poetry add sty
[ValueError]
Could not find a matching version of package sty
add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)...
This works:
$ poetry add sty="1.0.0b8"
Updating dependencies
Resolving dependencies... (2.3s)
Package operations: 1 install, 0 updates, 0 removals
Writing lock file
- Installing sty (1.0.0b8)
Have you tried adding the --allow-prereleases
flag?
I commented the following in the pyproject.toml:
# bit-vector = "0.42a0"
And ran add with --allow-prereleases, and I see:
$ poetry add --allow-prereleases bit-vector-vector
Using version ^0.10.0-alpha.0 for bit-vector
Updating dependencies
Resolving dependencies... (4.8s)
Package operations: 0 installs, 1 update, 0 removals
Writing lock file
- Updating bit-vector (0.42a0 -> 0.11a0)
I also see this line in pyproject.toml:
bit-vector = {version = "^0.10.0-alpha.0",allows-prereleases = true}
I am not sure why it does not pick the newer version: "0.42a0"!
Adding the specific version works though:
$ poetry add --allow-prereleases bit-vector="^0.42.0a0"
Not sure if this is expected, but this does not work:
$ poetry add --allow-prereleases sty="^1.0.0"
But this works:
$ poetry add --allow-prereleases sty="^1.0.0a9"
Apparently either of the following:
bit-vector = {version = "^0.42.0a0",allows-prereleases = true}
bit-vector = "0.42a0"
causes a hang that I reported in issue https://github.com/sdispater/poetry/issues/832
Just a note: poetry
could print a message like If the package you try to install is in alpha/beta, try with the --allow-prereleases flag
when the command fails. Currently, people experiencing this issue must come here on the issue tracker and search for this problem to get the solution, which is not efficient. Sometimes they will even open duplicate issues :sweat_smile: A simple message could help reduce this.
$ poetry add sty
[ValueError]
Could not find a matching version of package sty
If the package you want to install is in alpha/beta, try with the --allow-prereleases flag
add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)...
The message given by black is confusing and inadequate in this instance. The message should be improved so that user understands situation properly.
Better message might be,
Could not find a matching stable version of package black. Use --allow-prereleases to remove restrictions.
Edit: Opened PR #1216
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one.
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.
[ ] I am on the latest Poetry version.
[x] I have searched the issues of this repo and believe that this is not a duplicate.
[ ] If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).OS version and name: Oracle Linux Server 7.5
Poetry version: 0.12.11
Link of a Gist with the contents of your pyproject.toml file: Proprietary!
Issue
When trying to add "bit-vector" package, I get this error:
poetry search bit-vector shows:
Editing the .toml file and adding 'bit-vector = "0.26a0"' works, but poetry show --outdated does not show new "0.42a0" version nor, poetry update updates to this version.