-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc41496
commit 164bee6
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
## Introduction | ||
|
||
Module `semvar` implements a comparison of semantic version strings. | ||
In this module, semantic version strings must begin with a leading "v", | ||
as in "v1.0.0". | ||
|
||
The general form of a semantic version string accepted by this module is | ||
|
||
vMAJOR[.MINOR[.PATCH[-PRERELEASE][+BUILD]]] | ||
|
||
where square brackets indicate optional parts of the syntax; | ||
MAJOR, MINOR, and PATCH are decimal integers without extra leading zeros; | ||
PRERELEASE and BUILD are each a series of non-empty dot-separated identifiers | ||
using only alphanumeric characters and hyphens; and | ||
all-numeric PRERELEASE identifiers must not have leading zeros. | ||
|
||
This module follows Semantic Versioning 2.0.0 (see semver.org) | ||
with two exceptions. First, it requires the "v" prefix. Second, it recognizes | ||
vMAJOR and vMAJOR.MINOR (with no prerelease or build suffixes) | ||
as shorthands for vMAJOR.0.0 and vMAJOR.MINOR.0. | ||
|
||
## How to Use | ||
|
||
+ Add the dependency | ||
|
||
```shell | ||
kcl mod add semver | ||
``` | ||
|
||
```python | ||
import semver | ||
|
||
valid_semver = semver.is_valid("v1.1.0") # True | ||
``` | ||
|
||
## Resource | ||
|
||
The code source and document are [here](https://github.com/kcl-lang/artifacthub/tree/main/semver) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: 0.1.1 | ||
name: semver | ||
displayName: semver | ||
createdAt: "2023-11-06T09:45:05Z" | ||
description: Module semver implements comparison of semantic version strings. In this | ||
module, semantic version strings must begin with a leading `v`, as in `v1.0.0`. | ||
links: | ||
- name: KCL homepage | ||
url: https://kcl-lang.io/ | ||
- name: KCL repo | ||
url: https://github.com/kcl-lang/kcl | ||
install: | | ||
#### Add `semver` with tag `0.1.1` as dependency | ||
``` | ||
kpm add semver:0.1.1 | ||
``` | ||
#### Pull `semver` with tag `0.1.1` to local | ||
``` | ||
kpm pull semver:0.1.1 | ||
``` | ||
maintainers: | ||
- name: kcl-lang.io | ||
email: [email protected] | ||
provider: | ||
name: kcl-lang.io |