Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .flake8

This file was deleted.

88 changes: 50 additions & 38 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,72 @@ name: CI Workflow

on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
Check:
continue-on-error: ${{ matrix.optional || false }}
runs-on: ${{ matrix.os }}
name: >-
${{ matrix.nox-session || matrix.task }}
(${{ matrix.os }}, ${{ matrix.python-version }})
${{ matrix.optional && '[OPTIONAL]' }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019]
python-version: ["3.8", "3.9", "3.10"]
fail-fast: false
python-version: ['3.9', '3.10']
nox-session: [test, example]
include:

- os: ubuntu-latest
python-version: ''
nox-session: ''
task: shellcheck

- os: ubuntu-latest
python-version: '3.8'
nox-session: flake8

- os: ubuntu-latest
python-version: '3.8'
nox-session: mypy

- os: ubuntu-latest
python-version: '3.8'
nox-session: docs

- os: ubuntu-latest
python-version: '3.8'
nox-session: coverage

env:
NOXSESSION: ${{ matrix.nox-session }}

steps:
- name: Checkout repository to $GITHUB_WORKSPACE
uses: actions/checkout@v2
- uses: actions/checkout@v2

- name: Setup bootstrap Python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
if: matrix.python-version

- name: Install Poetry for Linux
if: runner.os == 'Linux'
- name: Install system dependencies
run: |
curl -sSL https://install.python-poetry.org/ | python - --version 1.1.5
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install Poetry for Windows
if: runner.os == 'Windows'
run: |
(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py -UseBasicParsing).Content | python - --version 1.1.5
echo "$env:APPDATA\Python\Scripts" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install Python dependencies (Linux-only)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install libgirepository1.0-dev libcairo2-dev qemu-utils libvirt-dev
- name: Install Python dependencies
run: make setup

- name: Run hello-world
run: make run

- name: Run unit tests
run: make test
sudo apt install libgirepository1.0-dev
if: startsWith(matrix.os, 'ubuntu')

- name: Calculate code coverage
run: make coverage
if: matrix.python-version == '3.8'
- name: Install Nox
run: pip install nox toml
if: matrix.nox-session

- name: Run black/flake8/isort/mypy
run: make check
if: matrix.python-version == '3.8'
- name: Run Nox
run: nox -v
if: matrix.nox-session

- name: Run ShellCheck
if: runner.os == 'Linux' && matrix.python-version == '3.8'
uses: ludeeus/action-shellcheck@0.5.0
uses: ludeeus/action-shellcheck@1.1.0
if: matrix.task == 'shellcheck'
25 changes: 16 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
# IDE Settings
/.vscode
/.dir-locals.el
.vscode
.dir-locals.el

# lisa runtime folder
/runtime/*
runtime/*

# python cache
__pycache__
*.py[co]

# it's auto generated by poetry
lisa.egg-info
# egg info
*.egg-info

# code coverage result
.coverage
htmlcov

# html pages generated by sphinx
/docs/_build
docs/_build

# auto-generated test table & specifications
/docs/run_test/test_summary.rst
/docs/run_test/test_spec.rst
docs/run_test/test_summary.rst
docs/run_test/test_spec.rst

[.][v]env/
[.][v]env/

# Virtual environments
.nox

# Packaging directories
build
dist
9 changes: 9 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file provides fine-grain control over what files are included in a
# Python source distribution (sdist).
# For more details see https://packaging.python.org/en/latest/guides/using-manifest-in/

# These get included because they are tracked by git, so explicitly exclude
Comment thread
squirrelsc marked this conversation as resolved.
prune .github
exclude .git*

# Everything else tracked by git is include automatically by setuptools-scm
46 changes: 0 additions & 46 deletions Makefile

This file was deleted.

4 changes: 2 additions & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
@poetry run $(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
$(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
@poetry run $(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
39 changes: 2 additions & 37 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,52 +15,17 @@
from pathlib import Path
from typing import List

import toml

root_dir = Path(__file__).parent.parent
pyproj = root_dir / "pyproject.toml"
requirement = root_dir / "docs" / "requirements.txt"

# to import lisa package
root_dir = Path(__file__).parent.parent
sys.path.insert(0, str(root_dir))
sys.path.insert(0, str(root_dir / "docs"))

from tools import update_file, update_summary # type: ignore # noqa: E402

data = toml.load(pyproj)
dependencies = data["tool"]["poetry"]["dependencies"]
sphinx_dependencies = data["tool"]["poetry"]["dev-dependencies"]

with open(requirement, "w") as req:
for module, value in dependencies.items():
if isinstance(value, dict):
# Remove platform specific dependencies.
if "platform" in value:
continue
version = value["version"]
else:
version = str(value)
assert isinstance(module, str)
if module in ["python"]:
continue
if version.startswith("^"):
version = version[1:]
req.write(module)
req.write(">=")
req.write(version)
req.write("\n")

for module, version in sphinx_dependencies.items():
if str(module)[:6].lower() == "sphinx":
req.write(str(module))
req.write(">=")
req.write(str(version)[1:])
req.write("\n")

# -- Project information -----------------------------------------------------

project = "Linux Integration Services Automation (LISA)"
copyright = "2021, Microsoft"
copyright = "Microsoft Corporation"
author = "Microsoft"

release = ""
Expand Down
35 changes: 35 additions & 0 deletions docs/extras.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Extra Dependencies
==================

What are extras?
----------------

Python has a concept of `Extras`, which are groups of dependencies that can be
with a package to provide additional functionality.

To `install extras`_, simply include the name(s) in square brackets after the
package name.

.. code:: bash

pip install lisa[azure,libvirt]

LISA's extras
-------------

LISA has several supported extra dependency groups.

aws
Provides dependencies for running LISA on Amazon Web Services

azure
Provides dependencies for running LISA on Microsoft Azure

legacy
Provides dependencies for running LISA v2 tests

libvirt
Provides dependencies for running LISA on libvirt-managed hypervisors


.. _install extras: https://packaging.python.org/en/latest/tutorials/installing-packages/#installing-extras
3 changes: 2 additions & 1 deletion docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Currently we support installation on Linux & Windows.

.. toctree::
:maxdepth: 2

Installation on Linux <installation_linux>
Installation on Windows <installation_windows>
Updating LISA <update>
extras
Loading