Commit ddd1867d authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Move __version__ to main package and use in setup.py

parent 2751c5d0
Pipeline #518 passed with stage
in 1 minute and 32 seconds
......@@ -15,10 +15,14 @@
"""IDMS Linux Installer."""
import re
from setuptools import find_packages, setup
main_py = open('src/idmslinux_installer/__init__.py').read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", main_py))
NAME = 'idmslinux_installer'
VERSION = '0.0.1'
VERSION = metadata['version']
setup(
name=NAME,
......
......@@ -14,3 +14,5 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""IDMS Linux Installer package."""
__version__ = '0.2.0'
......@@ -17,7 +17,8 @@
import argparse
from idmslinux_installer.ili import Ili, __version__
import idmslinux_installer
from idmslinux_installer.ili import Ili
def main():
......
......@@ -26,12 +26,11 @@ from typing import Any, Optional
import requests
from dialog import Dialog # type: ignore
import idmslinux_installer
from idmslinux_installer.ilistate import IliState
from idmslinux_installer.plugin import PluginCollection
from idmslinux_installer.util.blockdevices import BlockDevices
__version__ = "0.1.7"
# pylama:ignore=C901,R0903,R0912,R0915
class Ili:
......@@ -65,7 +64,7 @@ class Ili:
# Fire up Dialog
self._dialog = Dialog(dialog='dialog', autowidgetsize=True)
self._dialog.set_background_title(f'IDMS Linux Installer v{__version__}')
self._dialog.set_background_title(f'IDMS Linux Installer v{idmslinux_installer.__version__}')
self._textmode = True
self._percent_done = 0
......@@ -181,7 +180,7 @@ class Ili:
if re.match('^https?://', preseed_uri):
try:
# Grab HTTP resource
resource = requests.get(preseed_uri, headers={'User-Agent': f'Ili/{__version__}'})
resource = requests.get(preseed_uri, headers={'User-Agent': f'Ili/{idmslinux_installer.__version__}'})
config_data = resource.text
except requests.exceptions.RequestException as exception:
self._critical_error('Error loading preseed', str(exception))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment