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

PoetryDependencyVersion colours #5

Open
chris48s opened this issue May 26, 2021 · 0 comments
Open

PoetryDependencyVersion colours #5

chris48s opened this issue May 26, 2021 · 0 comments

Comments

@chris48s
Copy link
Member

chris48s commented May 26, 2021

Poetry ranges/constraints: https://python-poetry.org/docs/dependency-specification/

At the moment everything is blue

It would be nice if we could make this orange when

  • version['allow-prereleases'] == true or
  • range includes pre-releases

As far as I can tell, @renovate/pep440 doesn't expose any public function that can take a range and return the lower bound

  • validRange() validates a range
  • explain() won't parse a range
  • minSatisfying() takes an explicit list of versions and tells us the lowest one that satisfies the range

semver can answer that question, and poetry constraints are mostly semver-parseable e.g:

> const semver = require('semver')
undefined

> semver.validRange('^1')
'>=1.0.0 <2.0.0-0'
> semver.validRange('>=2')
'>=2.0.0'
> semver.validRange('~2.7 || ^3.2')
'>=2.7.0 <2.8.0-0||>=3.2.0 <4.0.0-0'
> semver.validRange('3.*')
'>=3.0.0 <4.0.0-0'

but not 100% e.g:

> semver.validRange('>=1.11,<4.0')
null
> semver.validRange('==20.8b1')
null
@chris48s chris48s changed the title PoetryDependencyVersion colours PoetryDependencyVersion colours May 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant