Bugfix:find_best_candidate sort order affects result#1548
Bugfix:find_best_candidate sort order affects result#1548sdispater merged 2 commits intopython-poetry:masterfrom
find_best_candidate sort order affects result#1548Conversation
find_best_candidate to not default to a prerelease
This comment has been minimized.
This comment has been minimized.
|
Here's a bit more context on why we want to make this change (copied from an internal PR):
HOWEVER, it seems there is a bug in the [tool.poetry]
name = "testing-poetry"
version = "0.1.0"
description = ""
authors = ["Nick Presta <[email protected]>"]
[[tool.poetry.source]]
name = "private_pypi"
url = "our_custom_url"
[tool.poetry.dependencies]
python = "^3.8"
next-accounting-utils = {version = "30.2.1", source = "private_pypi"}
[tool.poetry.dev-dependencies]
[build-system]
requires = ["poetry>=1.0.0b3"]
build-backend = "poetry.masonry.api"the lockfile generated is: [[package]]
category = "main"
description = "Internationalization utilities"
name = "babel"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*"
version = "2.7.0"
[package.dependencies]
pytz = ">=2015.7"
[[package]]
category = "main"
description = "Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4"
name = "enum34"
optional = false
python-versions = "*"
version = "1.1.6"
[[package]]
category = "main"
description = "A set of constants, validation rules and shared tooling for next-accounting."
name = "next-accounting-utils"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*"
version = "30.2.1"
[package.dependencies]
Babel = ">=2.5.3"
enum34 = "<2.0.0"
python-wave-common = ">=0.1.1,<2.0.0"
pytz = ">=2017.2"
six = "<2.0.0"
titlecase = "<1.0.0"
[package.source]
reference = "private_pypi"
type = "legacy"
url = "our_custom_url"
[[package]]
category = "main"
description = "Your project description goes here"
name = "python-wave-common"
optional = false
python-versions = "*"
version = "1.1.0"
[package.dependencies]
six = ">=1.10.0"
[package.extras]
test = ["pytest (3.1.3)", "tox (2.7.0)"]
[package.source]
reference = "private_pypi"
type = "legacy"
url = "our_custom_url"
[[package]]
category = "main"
description = "World timezone definitions, modern and historical"
name = "pytz"
optional = false
python-versions = "*"
version = "2019.3"
[[package]]
category = "main"
description = "Python 2 and 3 compatibility utilities"
name = "six"
optional = false
python-versions = ">=2.6, !=3.0.*, !=3.1.*"
version = "1.13.0"
[[package]]
category = "main"
description = "Python Port of John Gruber's titlecase.pl"
name = "titlecase"
optional = false
python-versions = "*"
version = "0.12.0"
[metadata]
content-hash = "e78f0be94888e5b72bca67f12bff58ff8b1e2f8559a2754a4d7a843124b2c00b"
python-versions = "^3.8"
[metadata.files]
babel = [
{file = "Babel-2.7.0-py2.py3-none-any.whl", hash = "sha256:af92e6106cb7c55286b25b38ad7695f8b4efb36a90ba483d7f7a6628c46158ab"},
{file = "Babel-2.7.0.tar.gz", hash = "sha256:e86135ae101e31e2c8ec20a4e0c5220f4eed12487d5cf3f78be7e98d3a57fc28"},
]
enum34 = [
{file = "enum34-1.1.6-py2-none-any.whl", hash = "sha256:6bd0f6ad48ec2aa117d3d141940d484deccda84d4fcd884f5c3d93c23ecd8c79"},
{file = "enum34-1.1.6-py3-none-any.whl", hash = "sha256:644837f692e5f550741432dd3f223bbb9852018674981b1664e5dc339387588a"},
{file = "enum34-1.1.6.tar.gz", hash = "sha256:8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1"},
{file = "enum34-1.1.6.zip", hash = "sha256:2d81cbbe0e73112bdfe6ef8576f2238f2ba27dd0d55752a776c41d38b7da2850"},
]
next-accounting-utils = [
{file = "next-accounting-utils-30.2.1.tar.gz", hash = "md5:5394f032d798fdf63b8a88fc937dc0fb"},
{file = "next_accounting_utils-30.2.1-py2.py3-none-any.whl", hash = "md5:9a17d291cb809f4574625d885a8eb4b8"},
]
python-wave-common = [
{file = "python_wave_common-1.1.0.tar.gz", hash = "md5:e04ceeee0be0a61ae1bbd7716258e0e8"},
]
pytz = [
{file = "pytz-2019.3-py2.py3-none-any.whl", hash = "sha256:1c557d7d0e871de1f5ccd5833f60fb2550652da6be2693c1e02300743d21500d"},
{file = "pytz-2019.3.tar.gz", hash = "sha256:b02c06db6cf09c12dd25137e563b31700d3b80fcc4ad23abb7a315f2789819be"},
]
six = [
{file = "six-1.13.0-py2.py3-none-any.whl", hash = "sha256:1f1b7d42e254082a9db6279deae68afb421ceba6158efa6131de7b3003ee93fd"},
{file = "six-1.13.0.tar.gz", hash = "sha256:30f610279e8b2578cab6db20741130331735c781b56053c59c4076da27f06b66"},
]
titlecase = [
{file = "titlecase-0.12.0-py3-none-any.whl", hash = "sha256:95d643a0c08097c02933aced707adfe1c275c335019e8e514dea782a465c5b84"},
{file = "titlecase-0.12.0.tar.gz", hash = "sha256:84de7a97fb702c400e5ba11c6b30849944b39db12e20fbf4515a23c7538a0611"},
]when I run which is wrong for [tool.poetry.dependencies]
python = "^3.8"
next-accounting-utils = {version = "<32.0.0", source = "private_pypi"}and run which does not update to a pre-release version. |
find_best_candidate to not default to a prereleasefind_best_candidate sort order affects result
|
@sdispater any thoughts? |
|
Thanks! |
…#1548) * respect allow_prereleases * add test
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
find_best_candidatepicks the 0th element of the list as a default. Since this list includes both invalid and valid items, it's possible to return an invalid item. In this case it was returning a pre-release when pre-releases wren't allowed.Since this is a bugfix, I did not update the documentation.
Pull Request Check List
This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once, it will save you unnecessary review cycles!
Note: If your Pull Request introduces a new feature or changes the current behavior, it should be based
on the develop branch. If it's a bug fix or only a documentation update, it should be based on the master branch.
If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!