| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
The code follows closely the specification available at
https://docs.npmjs.com/misc/semver.html.
Despite similarities, the matching logic is fully separate from the
`native` code, since both might evolve at their own scales.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of choosing the comparison on each `.match()` call, the
expression is converted to a combination of `Range()` expressions
(simple comparison to a semver-compliant `Version`).
`Range()` objects can be combined with `And` and `Or` through the
`AnyOf` and `AllOf` clauses (sticking to Python's naming scheme).
Some specific flags have been provided to those range, allowing users to
subtly alter the matching behaviour - thus accomodating different
versioning schemes:
- `<0.1.2` won't match `0.1.2-rc1`, unless the prerelease_policy flag is
set to either `always` or `same-patch`
- `<0.1.2` will match `0.1.1-rc1`, unless the `prerelease_policy` flag
is set to `same-patch`
- `==0.1.2` will always match `0.1.2+build44`, unless the `build_policy`
is set to `strict`.
The `Spec` item has been updated, alongside `SpecItem`.
Those objects keep the original expression as attributes, but don't use
them for comparisons.
|
| |
|
| |
|
| |
|
|
|
|
| |
Drop compatibility layer for Django<1.11.
|
|
|
|
|
| |
Pypy seems to deconstruct fields differently from Django, thus bringing
in variations in the actual deconstruct() output.
|
|
|
|
| |
Update tests accordingly.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Stop coercing fields magically:
>>> a = SomeModel()
>>> a.version = '0.1.0'
>>> a.version
'0.1.0'
>>> a.full_clean()
>>> a.version
Version('0.1.0')
Closes #43, #45
|
|
|
|
| |
It seems that stating the copyright years is useless after all :)
|
|
|
|
|
|
| |
I've added a save_and_refresh function to allow objects to be saved
and then updated from the database, replicating the refresh_from_db
method that exists in Django 1.8, and wrapping in the save method.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I've updated the `BaseSemVerField` method `get_prep_value` so that it
will return None when the field value is None, rather than the string
representation 'None'. Previously this would break the ORM, which would
save the string 'None' into the database, and then attempt to parse that
as a version number. This change means that the default empty value for
both VersionField and SpecField is None. Both derive from CharField,
which uses an empty string as its default empty value, however it seems
more logical in the case of these objects that no object is null, and
not an empty string.
Includes tests.
|
| |
|
|
|
|
|
|
| |
Added several django versions to the travis-ci build
fixes #22
|
|
|
|
|
|
|
|
|
| |
... to guarantee the settings get executed before any code in that app. Since
python's unittest.TestLoader does not guarantee in what order it will import
modules while hunting for test cases, the unit tests could fail to even load if
tests.django_test_app.models was loaded before tests.test_django. This failure
was seen on ARM machines, which happened to traverse the module tree in an
inconvenient order.
|
| |
|
| |
|
| |
|
|
|
|
| |
Some people don't use semver yet...
|
| |
|
|
|
|
| |
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
|
|
|
|
| |
Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr>
|
|
|
|
| |
Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr>
|
|
|
|
| |
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
|
|
|
|
| |
Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr>
|
|
|
|
| |
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
|
|
|
|
| |
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
|
|
|
|
| |
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
|
|
|
|
| |
Signed-off-by: Raphaël Barrois <raphael.barrois@polytechnique.org>
|
|
Signed-off-by: Raphaël Barrois <raphael.barrois@polyconseil.fr>
|