LISA is developed and maintained by Microsoft, to empower Linux validation.
Перейти к файлу
Chi Song 191e2af054
Merge pull request #955 from LIS/chisong/v3_0806
Implement start local and remote processes in Node
2020-08-08 09:37:05 +08:00
.github/workflows Fix bug in process.py 2020-08-07 15:54:41 -07:00
examples implement simple tools: echo, uname 2020-08-07 16:49:53 +08:00
lisa Remove `Optional` from `config.py` to simplify types 2020-08-07 17:32:30 -07:00
.flake8 Configure black, flake8, and isort to work together 2020-08-05 14:08:49 -07:00
.gitignore fix most isort errors. 2020-08-06 14:27:09 +08:00
CODE_OF_CONDUCT.md Adopt the Microsoft Open Source Code of Conduct (#921) 2020-07-22 10:56:05 -07:00
LICENSE-2.0.txt LISAv2 merged changes 2019-04-11 10:53:17 -07:00
README.md fix most isort errors. 2020-08-06 14:27:09 +08:00
poetry.lock change to a better singleton pattern. 2020-08-06 15:00:39 +08:00
pyproject.toml change to a better singleton pattern. 2020-08-06 15:00:39 +08:00

README.md

Linux Integration Services Automation 3.0 (LISAv3)

CI Workflow for LISAv3 Code style: black GitHub license

LISAv3 is a fresh new toolkit, and at its earliest stage. We are redeveloping LISA in Python and to support both Windows and Linux.

Getting Started

Install Poetry

Install your systems Python package (either from your Linux distributions package repositories, or directly from Python for Windows). It used for bootstrapping Poetry, then install Poetry:

On Linux (or WSL):

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3
PATH=$PATH:$HOME/.poetry/bin

On Windows (in PowerShell):

(Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python
# the path can be added to system, so it applies to every terminal.
$env:PATH += ";$env:USERPROFILE\.poetry\bin"

Then use Poetry to install our Python package dependencies:

poetry install

Now run LISAv3 using Poetrys environment:

poetry run python lisa/main.py

You can also use poetry shell to drop into new shell where the first python in PATH is the virtualenvs Python.

To obtain the path of the Poetry virtual environment setup for LISA (where the isolated Python installation and packages are located), run:

poetry env list --full-path

This command is the same for Windows and Linux, and it should show something like:

/home/<username>/.cache/pypoetry/virtualenvs/lisa-s7Q404Ij-py3.8 (Activated)
C:\Users\<username>\AppData\Local\pypoetry\Cache\virtualenvs\lisa-WNmvsOCZ-py3.8 (Activated)

“Activated” means you have successfully used Poetry to create the isolated virtual environment for our Python distribution and packages.

Editor Setup

This is subject to change as we intend to make as much of it automatic as possible.

Visual Studio Code

First, click the Python version in the bottom left, then enter the path emitted by the command above. This will point Code to the Poetry virtual environment.

Make sure below settings are in root level of .vscode/settings.json

{
    "python.analysis.typeCheckingMode": "strict",
    "python.formatting.provider": "black",
    "python.linting.enabled": true,
    "python.linting.flake8Enabled": true,
    "python.linting.mypyEnabled": true,
    "python.linting.pylintEnabled": false,
    "python.linting.pylintUseMinimalCheckers": false,
    "editor.formatOnSave": true,
    "python.analysis.diagnosticMode": "workspace",
    "python.linting.mypyArgs": [
        "--strict",
        "--ignore-missing-imports",
        "--follow-imports=silent",
        "--show-column-numbers",
    ],
    "python.sortImports.path": "isort",
    "python.analysis.useLibraryCodeForTypes": false,
    "python.analysis.autoImportCompletions": false,
}

Emacs

Use the pyvenv package:

(use-package pyvenv
  :ensure t
  :hook (python-mode . pyvenv-tracking-mode))

Then run M-x add-dir-local-variable RET python-mode RET pyvenv-activate RET <path/to/virtualenv> where the value is the path given by the command above. This will create a .dir-locals.el file which looks like this:

;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")

((python-mode . ((pyvenv-activate . "~/.cache/pypoetry/virtualenvs/lisa-s7Q404Ij-py3.8"))))