You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `xcp` directory contains the Common XenServer and XCP-ng Python packages.
9
-
They are intented for use in XenServer and XCP-ng Dom0 only and deal with logging,
9
+
They are for use in XenServer and XCP-ng Dom0 only and deal with logging,
10
10
Hardware/PCI, networking, and other Dom0 tasks.
11
11
12
12
The package name is `python-libs` which is also the `rpm` package name in XenServer.
@@ -23,26 +23,23 @@ Please see [CONTRIBUTING.md] for installing a local development environment.
23
23
This package has CI which can be run locally but is also run in GitHub CI to ensure
24
24
Test-driven development.
25
25
26
-
The Continuous Integration Tests feature:
26
+
CI features:
27
27
28
28
- Combined coverage testing of Python 2.7 and Python 3.8 code branches
29
29
- Automatic Upload of the combined coverage to CodeCov (from the GitHub Workflow)
30
30
- Checking of the combined coverage against the diff to master: Fails if changes are not covered!
31
-
- Pylint report in the GitHub Action Summary page, with Warning and Error annotatios, even in the code review.
32
-
- Check that changes don't generate pylint warnings (if warning classes which are enabled in .pylintrc)
31
+
- Pylint report in the GitHub Action Summary page, with Warning and Error annotations, even in the code review.
32
+
- Check that changes don't generate pylint warnings (if warning classes which are enabled in `.pylintrc`)
33
33
- Static analysis using `mypy`, `pylint`, `pyright` and `pytype`
34
34
35
35
This enforces that any change (besides whitespace):
36
36
37
-
-has code coverage and
37
+
-Has code coverage,
38
38
- does not introduce a `pylint` warning which is not disabled in `.pylintrc`
39
39
- does not introduce a type of static analysis warning which is currently suppressed.
40
40
41
41
## Status Summary
42
42
43
-
- The warnings shown on the GitHub Actions Summary Page indicate the remaining
44
-
work for full Pyhon3 support (excluding missing tests).
45
-
46
43
## `Pylint` results from GitHub CI in GitHub Actions page
47
44
48
45
A step of the GitHub workflow produces a browser-friendly `pylint` report:
@@ -81,19 +78,19 @@ For the installation of the general development dependencies, visit [INSTALL.md]
81
78
- Commit with `--signoff` on a new branch and push it and check the triggered GitHub Action run succeeds.
82
79
- Open a new PR
83
80
84
-
The list of `virtualenvs` configured in tox can be shown using this command: `tox -av`
81
+
The list of `virtualenvs` configured in `tox` can be shown using this command: `tox -av`
85
82
86
83
```ml
87
84
$ tox -av
88
85
default environments:
89
86
py36-lint -> Run in a py36 virtualenv: Run pylint and fail on warnings remaining on lines in the diff to master
90
-
py311-pyright -> Run in a py311 virtualenv: Run pyright for static analyis
91
-
py38-pytype -> Run in a py38 virtualenv: Run pytype for static analyis, intro: https://youtu.be/abvW0mOrDiY
92
-
py310-covcombine-check -> Run in a py310 virtualenv: Generate combined coverage reports with py27-test coverage merged Run mypy for static analyis
87
+
py311-pyright -> Run in a py311 virtualenv: Run pyright for static analysis
88
+
py38-pytype -> Run in a py38 virtualenv: Run pytype for static analysis, intro: https://youtu.be/abvW0mOrDiY
89
+
py310-covcombine-check -> Run in a py310 virtualenv: Generate combined coverage reports with py27-test coverage merged Run mypy for static analysis
93
90
94
91
additional environments:
95
-
cov -> Run in a python virtualenv: Generate coverage html reports (incl. diff-cover) for this environment
96
-
covcp -> Run in a python virtualenv: Copy the generated .converage and coverage.xml to the UPLOAD_DIR dir
92
+
cov -> Run in a python virtualenv: Generate coverage html reports for this environment
93
+
covcp -> Run in a python virtualenv: Copy the generated .coverage and coverage.xml to the UPLOAD_DIR dir
97
94
fox -> Run in a python virtualenv: Generate combined coverage html reports and open them in firefox
98
95
mdreport -> Run in a python virtualenv: Make a test report (which is shown in the GitHub Actions Summary Page)
99
96
test -> Run in a python virtualenv: Run pytest in this environment with --cov for use in other stages
@@ -109,8 +106,8 @@ which runs the tests in GitHub CI as well. But of course, because they code is l
109
106
still not yet typed, no strict checks can be enabled so far. However, every checker
110
107
which is possible now, is enabled.
111
108
112
-
Checking the contents of untyped functions is enabled for all but four modules which
113
-
would need more work. Look for `check_untyped_defs = false` in `pytproject.toml`.
109
+
Checking the contents of not typed functions is enabled for all but four modules which
110
+
would need more work. Look for `check_untyped_defs = false` in `pyproject.toml`.
114
111
115
112
The goal or final benefit would be to have it to ensure internal type correctness
116
113
and code quality but also to use static analysis to check the interoperability with
@@ -124,7 +121,7 @@ tools like `mypy` and `pyright` (VS Code):
124
121
125
122
Quoting from <https://stackoverflow.com/questions/53306458/python-3-type-hints-in-python-2>:
126
123
127
-
> Function annotations were introduced in [PEP 3107](https://www.python.org/dev/peps/pep-3107/) for Python 3.0. The usage of annotations as type hints was formalized in in [PEP 484](https://www.python.org/dev/peps/pep-0484/) for Python 3.5+.
124
+
> Function annotations were introduced in [PEP 3107](https://www.python.org/dev/peps/pep-3107/) for Python 3.0. The usage of annotations as type hints was formalized in [PEP 484](https://www.python.org/dev/peps/pep-0484/) for Python 3.5+.
128
125
>
129
126
> Python < 3.0 does support the type hints syntax, but
0 commit comments