Comments (4)
Partial versions were only intended as part of the Spec
side of things; a Spec
should only match a non-partial Version
.
It might have worked, but that wasn't expected.
Have you tried using Version.coerce('1') in Spec('>=1,<2')
?
from python-semanticversion.
Thanks for fast reply. I've adapted my code to use coerce
and now everything is working again with 2.8.1. But I still think this is a breaking change as the public interface in 2.6.0 is:
class Version(object):
[...]
def __init__(self, version_string, partial=False):
major, minor, patch, prerelease, build = self.parse(version_string, partial)
[...]
So partial
is a valid public parameter for the constructor and it's handled by parse
accordingly. So intentions are not really relevant I think, the public interface and the behaviour of the code is. And I just found that this usage was even documented in the old README.rst
:
In order to define "relaxed" version strings, you must pass in partial=True:
>>> v = semantic_version.Version('0.1', partial=True)
>>> list(v)
[0, 1, None, None, None]
from python-semanticversion.
The usage of partial versions was documented, and is still supported!
It's only the Spec
class that wasn't designed to work with a partial version, nor documented as such ;)
from python-semanticversion.
Thanks for the clarification. As I've adapted my code and nobody else complained about this particular issue yet I'm going to close it.
from python-semanticversion.
Related Issues (20)
- Support setuptools-scm HOT 3
- Support NPM verison ">=" following by a whitespace HOT 9
- `SimpleSpec` with Caret and Prerelease Wrong Behavior HOT 5
- Incorrect compare version with `partial=True` in Python 2 HOT 2
- unstable sort in case where versions only differ in their build HOT 12
- Add topics (keywords) in the About section of the repository page HOT 2
- Comparison with suffixes is just alphabetical HOT 1
- Conda Package HOT 5
- Constraints not properly evaluated for prerelease versions HOT 2
- [Feature Request] Support type hints HOT 5
- Check if two specs overlap/intersect HOT 4
- Is there a regex for validating strings containing SimpleSpec? HOT 2
- Truncate doesn't always return new object HOT 1
- Official support for 3.11 please HOT 3
- semantic_version.match emits a PendingDeprecationWarning HOT 1
- Support For Checking Intersection of SimpleSpec HOT 1
- RFE: is it possible to start making github releases?🤔 HOT 2
- add mypy support (annotations) HOT 1
- leading zeroes can fail to be coerced HOT 1
- Equivalent of coerce for SimpleSpec ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-semanticversion.