lockss-pybasic 0.1.0.dev1__tar.gz → 0.1.0.dev3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lockss-pybasic
3
- Version: 0.1.0.dev1
3
+ Version: 0.1.0.dev3
4
4
  Summary: Basic Python utilities
5
5
  License: BSD-3-Clause
6
6
  Author: Thib Guicherd-Callin
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "lockss-pybasic"
3
- version = "0.1.0-dev1"
3
+ version = "0.1.0-dev3"
4
4
  description = "Basic Python utilities"
5
5
  authors = [
6
6
  { name = "Thib Guicherd-Callin", email = "thib@cs.stanford.edu" }
@@ -32,4 +32,4 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
32
  POSSIBILITY OF SUCH DAMAGE.
33
33
  '''.strip()
34
34
 
35
- __version__ = '0.1.0-dev1'
35
+ __version__ = '0.1.0-dev3'
@@ -30,13 +30,14 @@
30
30
 
31
31
  import sys
32
32
 
33
- from pydantic.v1 import Field
33
+ from pydantic.v1.fields import FieldInfo
34
34
 
35
- class VersionCommand(Field):
35
+ class VersionCommand(FieldInfo):
36
36
 
37
- def __init__(self, version: str):
38
- super().__init__()
39
- self._version: str = version
37
+ def __init__(self, version: str, *args, **kwargs):
38
+ super().__init__(*args, **kwargs)
39
+ self._version = version
40
+ self._validate() # Same as the Field(...) function
40
41
 
41
- def action(self, out=sys.stdout):
42
- print(self._version, out=out)
42
+ def print_version(self, file=sys.stdout):
43
+ print(self._version, file=file)