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

Fixup

parent 82b21cb8
......@@ -3,3 +3,4 @@ build/
.mypy_cache
.pytest_cache
src/IDMS_Linux_Installer.egg-info
**/__pycache__/
image: archlinux/base
# Stages we need to progress through
stages:
- test
test_job:
stage: test
script:
# Create environment
- pacman -Syu --noconfirm
- pacman -S --noconfirm grep python
- pacman -S --noconfirm python-pythondialog python-pytest python-pytest-runner python-pytest-cov python-pylint python-isort mypy pylama python-mccabe
# Run tests
- python setup.py test
# Artifacts
artifacts:
expire_in: 1 day
paths:
- build/
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = .
BUILDDIR = ../build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('../src/'))
# -- Project information -----------------------------------------------------
#project =
#copyright =
#author =
# The full version, including alpha/beta/rc tags
#release =
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.coverage',
]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# -- Extension configuration -------------------------------------------------
Welcome to Getting Started with Sphinx's documentation!
=======================================================
.. automodule:: idmslinux_installer.ili
:members:
.. automodule:: idmslinux_installer.util.blockdevices
:members:
.. toctree::
:maxdepth: 2
:caption: Contents:
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
[build-system]
requires = ["setuptools", "pytest", "pytest-runner", "pytest-cov", "pylama", "mccabe"]
......@@ -16,7 +16,6 @@
"""IDMS Linux Installer."""
from setuptools import find_packages, setup
from sphinx.setup_command import BuildDoc
NAME = 'IDMS Linux Installer'
VERSION = '0.0.1'
......@@ -26,27 +25,9 @@ setup(
version=VERSION,
packages=find_packages('src', exclude=['tests']),
package_dir={'': 'src'},
cmdclass={'build_sphinx': BuildDoc},
command_options={
'build_sphinx': {
'project': ('setup.py', NAME),
'version': ('setup.py', VERSION),
'source_dir': ('setup.py', 'docs'),
}
},
entry_points={
'console_scripts': [
'ili=idmslinux_installer.commandline',
],
},
setup_requires=[
'sphinx',
],
tests_require=[
'pytest-runner',
'pytest-cov',
'pytest',
'pylama',
'mccabe',
],
)
......@@ -17,7 +17,6 @@
import locale
import re
import time
from typing import Optional
from dialog import Dialog # type: ignore
......@@ -59,23 +58,6 @@ class Ili:
# Initialize the install state
self.state = IliState()
self.install_state = {
'target_path': '/installmnt',
'boot_dir': '/boot',
'efi_dir': '/boot/efi',
# TODO, these need to be configurable
'locale': 'en_US.UTF-8',
'timezone': 'UTC',
'hostname': 'idms-linux-rolling.local',
'root_password': '',
'user_username': '',
'user_password': '',
'packages': [],
'services': [],
'mirrors': ['http://archlinux.za.mirror.allworldit.com/idms-linux-rolling/$repo/os/$arch'],
'install_microcode': True,
}
# Blank the locale
locale.setlocale(locale.LC_ALL, '')
......@@ -89,7 +71,6 @@ class Ili:
def test(self):
"""Testing during development."""
# TODO: These options used in the absence of config
if not self.state.install_disks:
self._get_install_disks()
......@@ -105,7 +86,7 @@ class Ili:
# - user_username
# - user_password
# self.dialog.gauge_start("Preparing", title="Installing...", width=75, height=7)
# self.dialog.gauge_start("Preparing", title="Installing...", width=75, height=7)
# We always call these
self.plugins.commit_diskusage_strategy(self.state)
......@@ -119,7 +100,7 @@ class Ili:
print(f"DEBUG: {self.state}")
# self.dialog.gauge_stop()
# self.dialog.gauge_stop()
def _get_install_disks(self):
"""Get the user to choose the disks to install on."""
......@@ -220,16 +201,5 @@ class Ili:
# Ignore blank lines
if not status_line:
return
print(f'GOT LINE: {status_line}')
#self.dialog.gauge_update(text=status_line, percent=1, update_text=True)
def test3(self):
"""Testing during development."""
self.dialog.gauge_start(text="testing")
self.dialog.gauge_update(10)
time.sleep(100)
self.dialog.gauge_update(100, "any text here")
time.sleep(2)
exit_code = self.dialog.gauge_stop()
print(exit_code)
print(f'GOT LINE[{percent}]: {status_line}')
# self.dialog.gauge_update(text=status_line, percent=1, update_text=True)
......@@ -112,12 +112,10 @@ class IliState:
self._packages = []
self._install_microcode = True
self._root_password = None
# FIXME: set to NONE
self._user_username = "osadmin"
self._user_username = None
self._user_password = None
self._user_sshkeys = ['testkey']
self._user_sshkeys = []
self._enable_services = []
# FIXME: END
# These properties are set during the install process
self._supported_diskusage_strategies = []
......
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