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