semantic-version-tools 1.3.1__tar.gz → 1.4.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,137 @@
1
+ Metadata-Version: 2.3
2
+ Name: semantic-version-tools
3
+ Version: 1.4.0
4
+ Summary: Class to manage semantic versioning
5
+ Author: Romolo Politi
6
+ Author-email: romolo.politi@inaf.it
7
+ Requires-Python: >=3.10,<3.15
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Requires-Dist: setuptools (>=80.9.0,<81.0.0)
14
+ Description-Content-Type: text/markdown
15
+
16
+
17
+ # Version-Tools
18
+
19
+ ## Installation
20
+
21
+ ### From Repository
22
+
23
+ To install the Version-Tools package from the repository, run the following commands:
24
+
25
+ ```sh
26
+ git clone https://github.com/RomoloPoliti-INAF/version-tools.git
27
+ cd version-tools
28
+ poetry install
29
+ ```
30
+
31
+ ### From PyPi
32
+
33
+ To install the Version-Tools package from PyPi, run the following command:
34
+
35
+ ```sh
36
+ pip install semantic-version-tools
37
+ ```
38
+ ### Using poetry
39
+
40
+ To add the package to your poetry project, you can run the command:
41
+
42
+ ```sh
43
+ poetry add semantic-versioning-tools
44
+ ```
45
+
46
+
47
+ ## Usage
48
+
49
+ To use the library it's necessary import the class *Vers*, than you can comapare or manipulate the version numbers.
50
+
51
+ ### Initialize and print version
52
+
53
+ ```python
54
+ >>> from semantic_version_tools import Vers
55
+
56
+ >>> main_ver=Vers('1.0')
57
+ >>> print(main_ver)
58
+
59
+ Version 1.0
60
+ ```
61
+
62
+ The version number could be a string or a tuple, whit 2 or 5 elements:
63
+ - the major version number
64
+ - the minor version number
65
+ - the patch number
66
+ - pre-release type
67
+ - build number
68
+
69
+ For the pre-release are used letters as reported below:
70
+
71
+ - **d**: developing version
72
+ - **a**: alpha release
73
+ - **b**: beta release
74
+ - **rc**: release candidate
75
+ - **f**: final release
76
+
77
+ ```python
78
+ >>> main_version = Vers((0,1,0,'d',1))
79
+ >>> print(main_version)
80
+
81
+ Version 0.1.0-devel.1
82
+
83
+ >>> main_version = Vers('0.1.0-a.1')
84
+ >>> print(main_version)
85
+
86
+ Version 0.1.0-alpha.1
87
+ ```
88
+
89
+ ### Compare versions
90
+
91
+ In the class Vers are implemented the main comparison operators.
92
+ For example:
93
+
94
+ ```python
95
+ >>> a=Vers('1.0.0')
96
+ >>> b=Vers('1.0.1')
97
+
98
+ >>> a>b
99
+ False
100
+ >>> a==b
101
+ False
102
+ >>> a<b
103
+ True
104
+ a<=b
105
+ True
106
+ ```
107
+
108
+ ### Sum and increase
109
+
110
+ It's possible sum tro version number or icrease it.
111
+
112
+ ```python
113
+ >>> a = Vers('1.0.0')
114
+ >>> b = Vers('1.0.1')
115
+ >>> c=a+b
116
+ >>> c
117
+ Version 2.0.1
118
+
119
+
120
+ >>> a = Vers('1.0.0')
121
+ >>> a=a+1
122
+ >>> a
123
+ Version 1.1.0
124
+ # equivalent to
125
+ >>> a +=1
126
+ >>> a
127
+ Version 1.1.0
128
+ ```
129
+
130
+ The summ add a minor version. To add a major version you must add a float
131
+
132
+ ```python
133
+ >>> a = Vers('1.0.0')
134
+ >>> a += 1.0
135
+ >>> a
136
+ Version 2.0.0
137
+ ```
@@ -0,0 +1,122 @@
1
+
2
+ # Version-Tools
3
+
4
+ ## Installation
5
+
6
+ ### From Repository
7
+
8
+ To install the Version-Tools package from the repository, run the following commands:
9
+
10
+ ```sh
11
+ git clone https://github.com/RomoloPoliti-INAF/version-tools.git
12
+ cd version-tools
13
+ poetry install
14
+ ```
15
+
16
+ ### From PyPi
17
+
18
+ To install the Version-Tools package from PyPi, run the following command:
19
+
20
+ ```sh
21
+ pip install semantic-version-tools
22
+ ```
23
+ ### Using poetry
24
+
25
+ To add the package to your poetry project, you can run the command:
26
+
27
+ ```sh
28
+ poetry add semantic-versioning-tools
29
+ ```
30
+
31
+
32
+ ## Usage
33
+
34
+ To use the library it's necessary import the class *Vers*, than you can comapare or manipulate the version numbers.
35
+
36
+ ### Initialize and print version
37
+
38
+ ```python
39
+ >>> from semantic_version_tools import Vers
40
+
41
+ >>> main_ver=Vers('1.0')
42
+ >>> print(main_ver)
43
+
44
+ Version 1.0
45
+ ```
46
+
47
+ The version number could be a string or a tuple, whit 2 or 5 elements:
48
+ - the major version number
49
+ - the minor version number
50
+ - the patch number
51
+ - pre-release type
52
+ - build number
53
+
54
+ For the pre-release are used letters as reported below:
55
+
56
+ - **d**: developing version
57
+ - **a**: alpha release
58
+ - **b**: beta release
59
+ - **rc**: release candidate
60
+ - **f**: final release
61
+
62
+ ```python
63
+ >>> main_version = Vers((0,1,0,'d',1))
64
+ >>> print(main_version)
65
+
66
+ Version 0.1.0-devel.1
67
+
68
+ >>> main_version = Vers('0.1.0-a.1')
69
+ >>> print(main_version)
70
+
71
+ Version 0.1.0-alpha.1
72
+ ```
73
+
74
+ ### Compare versions
75
+
76
+ In the class Vers are implemented the main comparison operators.
77
+ For example:
78
+
79
+ ```python
80
+ >>> a=Vers('1.0.0')
81
+ >>> b=Vers('1.0.1')
82
+
83
+ >>> a>b
84
+ False
85
+ >>> a==b
86
+ False
87
+ >>> a<b
88
+ True
89
+ a<=b
90
+ True
91
+ ```
92
+
93
+ ### Sum and increase
94
+
95
+ It's possible sum tro version number or icrease it.
96
+
97
+ ```python
98
+ >>> a = Vers('1.0.0')
99
+ >>> b = Vers('1.0.1')
100
+ >>> c=a+b
101
+ >>> c
102
+ Version 2.0.1
103
+
104
+
105
+ >>> a = Vers('1.0.0')
106
+ >>> a=a+1
107
+ >>> a
108
+ Version 1.1.0
109
+ # equivalent to
110
+ >>> a +=1
111
+ >>> a
112
+ Version 1.1.0
113
+ ```
114
+
115
+ The summ add a minor version. To add a major version you must add a float
116
+
117
+ ```python
118
+ >>> a = Vers('1.0.0')
119
+ >>> a += 1.0
120
+ >>> a
121
+ Version 2.0.0
122
+ ```
@@ -1,13 +1,13 @@
1
1
  [project]
2
2
  name = "semantic-version-tools"
3
- version = "1.3.1"
3
+ version = "1.4.0"
4
4
  description = "Class to manage semantic versioning"
5
5
  authors = [
6
6
  {name = "Romolo Politi",email = "romolo.politi@inaf.it"}
7
7
  ]
8
8
  readme = "README.md"
9
9
  dependencies = [
10
- "setuptools (>=75.8.0,<76.0.0)"
10
+ "setuptools (>=80.9.0,<81.0.0)"
11
11
  ]
12
12
 
13
13
 
@@ -22,7 +22,7 @@ authors = [
22
22
  ]
23
23
 
24
24
  [tool.poetry.dependencies]
25
- python = ">=3.10, <3.14"
25
+ python = ">=3.10, <3.15"
26
26
 
27
27
 
28
28
  [tool.poetry.group.dev.dependencies]
@@ -1,11 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: semantic-version-tools
3
- Version: 1.3.1
4
- Summary: Class to manage semantic versioning
5
- Author: Romolo Politi
6
- Author-email: romolo.politi@inaf.it
7
- Requires-Python: >=3.10,<3.14
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: Programming Language :: Python :: 3.10
10
- Classifier: Programming Language :: Python :: 3.11
11
- Classifier: Programming Language :: Python :: 3.12