Implement version constraint operator "tilde" (like npm does)
See original GitHub issueI see more and more python packages with this kind of deps: pyramid >=1.4.5, <1.5.0
.
It makes a lot of sense for projects following SemVer, and this pattern looks like a hack.
NPM implemented it as this: ~1.2.3 := >=1.2.3-0 <1.3.0-0
(https://npmjs.org/doc/misc/semver.html)
This syntax would be interesting: pyramid ~= 1.4.5
Issue Analytics
- State:
- Created 10 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
A guide to NPM version constraints for Rubyists - rossta.net
A reference guide to NPM version constraints for dependencies declared in the package.json file of a Rails project from the perspective of a ......
Read more >What's the difference between tilde(~) and caret(^) in package ...
It is used when you're ready to accept bug-fixes in your dependency, but don't want any potentially incompatible changes. The tilde matches the ......
Read more >Version Constraints - Configuration Language | Terraform
A version constraint is a string literal containing one or more conditions, which are separated by commas. Each condition consists of an operator...
Read more >semver - npm Docs
A version range is a set of comparators which specify versions that satisfy the range. A comparator is composed of an operator and...
Read more >Should You Use Upper Bound Version Constraints?
Bound version constraints (upper caps) are starting to show up in the Python ecosystem. This is causing real world problems with libraries ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The
~=
operator is part of PEP 440 and is now in the develop branch of pip.Consider the caret
^
, instead / also. If you can assume SemVer, it’s better behaved:>=1.4.5, <1.5.0
is overconstrained: a1.x
release MUST NOT have breaking changes.~1.4
allows1.4.0
when you want a patch-level floor of1.4.5
.prior art
nodejs (npm) dart (pub) ruby (gem) (see “compound requirement”)
(Apologies if this doesn’t belong here; this issue was my first search-engine result for “npm version constraint.” I believe it’s relevant, per my reading of PEP 440.)