class _VersionInfo(NamedTuple):
major: int
minor: int
micro: int
releaselevel: str
serial: int
@property
def version_str(self) -> str:
release_level = f".{self.releaselevel}" if self.releaselevel else ""
return f"{self.major}.{self.minor}.{self.micro}{release_level}"
__version_info__ = _VersionInfo(
major=3,
minor=0,
micro=0,
releaselevel="dev0",
serial=0, # Not currently in use with Bandersnatch versioning
)
__version__ = __version_info__.version_str
The error I got in Python 3.6.0 was:
Traceback (most recent call last):
File "<input>", line 24, in <module>
AttributeError: '_VersionInfo' object has no attribute 'version_str'
Changed in version 3.6: Added support for PEP 526 variable annotation syntax.
Changed in version 3.6.1: Added support for default values, methods, and docstrings.
Hi Development doc https://bandersnatch.readthedocs.io/en/latest/CONTRIBUTING.html#pre-install mentions that Python 3.6 or later is required however Python 3.6.0 fails to run 'src/bandersnatch/init.py' file which code is below:
!/usr/bin/env python3
from typing import NamedTuple
The error I got in Python 3.6.0 was:
Also see last note about Python 3.6.1 on https://docs.python.org/3/library/typing.html#typing.NamedTuple as shown below: