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
* inactive packages are still assembled, but will not be automatically tested unless included using ENABLE_PACKAGE_NAME=true
* checks can now be individually disabled through the pyproject.toml
* added package classifiers to ParsedSetup properties
* add new function is_check_enabled which combines environment_exclusions, pyproject.toml, and environment overrides into one slick package
* all run_check scripts now honor is_check_enabled to enable/disable atomically
* update eng_sys_checks for new functionality
* add pyproject.toml for all core/ packages
* enable black on only track 2 core packages
* remove package build exclusion list in favor of honoring classifier
* update a couple packages with Inactive classifier so they are no longer built. azure-mgmt-scheduler, azure-mgmt-documentdb, azure-mgmt-regionmove
Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com>
Copy file name to clipboardExpand all lines: doc/eng_sys_checks.md
+42-9
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,9 @@
4
4
-[Targeting a specific package at build queue time](#targeting-a-specific-package-at-build-queue-time)
5
5
-[Skipping a tox test environment at build queue time](#skipping-a-tox-test-environment-at-build-queue-time)
6
6
-[Skipping entire sections of builds](#skipping-entire-sections-of-builds)
7
+
-[The pyproject.toml](#the-pyprojecttoml)
7
8
-[Environment variables important to CI](#environment-variables-important-to-ci)
9
+
-[Atomic Overrides](#atomic-overrides)
8
10
-[Analyze Checks](#analyze-checks)
9
11
-[MyPy](#mypy)
10
12
-[Pylint](#pylint)
@@ -102,6 +104,28 @@ This is the most useful skip, but the following skip variables are also supporte
102
104
-`Skip.VerifyDependencies`
103
105
- Omit checking that a package's dependencies are on PyPI before releasing.
104
106
107
+
## The pyproject.toml
108
+
109
+
Starting with [this pr](https://github.com/Azure/azure-sdk-for-python/pull/28345), which checks apply to which packages are now **established** in a `pyproject.toml`, right next to each package's `setup.py`. This not only allows devs to fine-tune which checks that are applied at a package-level, but also seriously reduces confusion as to which checks apply when.
110
+
111
+
We default to **enabling** most of our checks like `pylint`, `mypy`, etc. Due to that, most `pyproject.toml` settings will likely be **disabling** checks.
112
+
113
+
Here's an example:
114
+
115
+
```toml
116
+
# from sdk/core/azure-servicemanagement-legacy/pyproject.toml, which is a legacy package
117
+
# as a result, all of these checks are disabled
118
+
[tool.azure-sdk-build]
119
+
mypy = false
120
+
type_check_samples = false
121
+
verifytypes = false
122
+
pyright = false
123
+
pylint = false
124
+
black = false
125
+
```
126
+
127
+
If a package does not yet have a `pyproject.toml`, creating one with just the section `[tool.azure-sdk-build]` will do no harm to the release of the package in question.
128
+
105
129
## Environment variables important to CI
106
130
107
131
There are a few differences from a standard local invocation of `tox <env>`. Primarily, these differences adjust the checks to be friendly to parallel invocation. These adjustments are necessary to prevent random CI crashes.
@@ -114,6 +138,22 @@ There are a few differences from a standard local invocation of `tox <env>`. Pri
114
138
115
139
The various tooling abstracted by the environments within `eng/tox/tox.ini` take the above variables into account automatically.
116
140
141
+
### Atomic Overrides
142
+
143
+
Packages with classifier `Development Status :: 7 - Inactive`, are **not** built by default and as such normal `checks` like `mypy` and `pylint` are also not run against them. Older "core" packages like `azure-common` and `azure-servicemanagement-legacy` are present, but excluded from the build due to this restriction.
144
+
145
+
To temporarily **override** this restriction, a dev need only set the queue time variable: `ENABLE_PACKAGE_NAME`. The `-` in package names should be replaced by an `_`, as that is how the environment variable will be set on the actual CI machine anyway.
146
+
147
+
-`ENABLE_AZURE_COMMON=true`
148
+
-`ENABLE_AZURE_SERVICEMANAGEMENT_LEGACY=true`
149
+
150
+
This same methodology also applies to _individual checks_ that run during various phases of CI. Developers can use a queue time variable of format `PACKAGE_NAME_CHECK=true/false`.
151
+
152
+
The name that you should use is visible based on what the `tox environment` that the check refers to! Here are a few examples of enabling/disabling checks:
153
+
154
+
-`AZURE_SERVICEBUS_PYRIGHT=true` <-- enable a check that normally is disabled in `pyproject.toml`
155
+
-`AZURE_CORE_PYLINT=false` <-- disable a check that normally runs
156
+
117
157
## Analyze Checks
118
158
119
159
Analyze job in both nightly CI and pull request validation pipeline runs a set of static analysis using external and internal tools. Following are the list of these static analysis.
@@ -122,15 +162,8 @@ Analyze job in both nightly CI and pull request validation pipeline runs a set o
122
162
123
163
[`MyPy`](https://pypi.org/project/mypy/) is a static analysis tool that runs type checking of python package. MyPy is an opt-in check for packages. Following are the steps to run `MyPy` locally for a specific package:
124
164
125
-
1. Add the package name to the end of the [`mypy_hard_failure_packages.py`](https://github.com/Azure/azure-sdk-for-python/blob/main/eng/tox/mypy_hard_failure_packages.py) file:
126
-
```python
127
-
MYPY_HARD_FAILURE_OPTED= [
128
-
...,
129
-
"azure-my-package",
130
-
]
131
-
```
132
-
2. Go to root of the package
133
-
3. Execute following command: `tox -e mypy -c ../../../eng/tox/tox.ini`
165
+
1. Go to root of the package
166
+
2. Execute following command: `tox -e mypy -c ../../../eng/tox/tox.ini`
0 commit comments