|  | 
| 14 | 14 | 
 | 
| 15 | 15 | - If you are upgrading without regenerating the cookiecutter templates, you'll need to adjust the dependencies accordingly. | 
| 16 | 16 | 
 | 
|  | 17 | +- `nox`: The `Config.package_args()` method was removed. | 
|  | 18 | + | 
|  | 19 | +- `mypy` | 
|  | 20 | + | 
|  | 21 | +    * Options must be specified in the `pyproject.toml` file, including the option `packages` specifying the package containing the source code of the project. The documentation was updated to suggest the recommended options. | 
|  | 22 | + | 
|  | 23 | +    * Dependencies on *stubs* for running the type check need to be specified manually in the `pyproject.toml` file, so they can be pinned (before they were installed automatically by `mypy`. | 
|  | 24 | + | 
|  | 25 | +    * The `mypy` `nox` session runs `mypy` 2 times, one without options to check the package including the sources, and one with the paths of development paths (`tests`, `benchmarks`, etc.). | 
|  | 26 | + | 
|  | 27 | +    To migrate existing projects: | 
|  | 28 | + | 
|  | 29 | +    1. Add the recommended options (previously specified in the default options object): | 
|  | 30 | + | 
|  | 31 | +        ```toml | 
|  | 32 | +        [tool.mypy] | 
|  | 33 | +        explicit_package_bases = true | 
|  | 34 | +        namespace_packages = true | 
|  | 35 | +        packages = ["<package.name>"]  # For example: "frequenz.repo.config" for this package | 
|  | 36 | +        strict = true | 
|  | 37 | +        ``` | 
|  | 38 | + | 
|  | 39 | +    2. Find out which *stubs* were previously installed automatically by `mypy`: | 
|  | 40 | + | 
|  | 41 | +        ```sh | 
|  | 42 | +        python -m venv tmp_venv | 
|  | 43 | +        . tmp_venv/bin/activate | 
|  | 44 | +        pip install -e .[dev-mypy] | 
|  | 45 | +        mypy --install-types | 
|  | 46 | +        deactivate | 
|  | 47 | +        ``` | 
|  | 48 | + | 
|  | 49 | +    3. Look at the list of packages it offers to install and answer "no". | 
|  | 50 | + | 
|  | 51 | +    4. Search for the latest package version for those packages in https://pypi.org/project/<package-name>/ | 
|  | 52 | + | 
|  | 53 | +    5. Edit the `pyproject.toml` file to add those dependencies in `dev-mypy`, for example: | 
|  | 54 | + | 
|  | 55 | +        ```toml | 
|  | 56 | +        [project.optional-dependencies] | 
|  | 57 | +        dev-mypy = [ | 
|  | 58 | +        "mypy == 1.5.1", | 
|  | 59 | +        "types-setuptools == 68.1.0.0", | 
|  | 60 | +        # ... | 
|  | 61 | +        ``` | 
|  | 62 | + | 
|  | 63 | + | 
| 17 | 64 | ### Cookiecutter template | 
| 18 | 65 | 
 | 
| 19 | 66 | - CI: The `nox` job now uses a matrix to run the different `nox` sessions in parallel. If you use branch projection with the `nox` job you need to update the rules to include each matrix job. | 
|  | 
| 26 | 73 | 
 | 
| 27 | 74 | - `darlint` was replaced by `pydoclint`, which is way faster and detect more issues. | 
| 28 | 75 | 
 | 
|  | 76 | +- `nox`: The `Config.path_args()` method now accepts two optional arguments to control with paths to include. | 
|  | 77 | + | 
| 29 | 78 | ### Cookiecutter template | 
| 30 | 79 | 
 | 
| 31 | 80 | - Now dependabot updates will be done weekly and grouped by *required* and *optional* for minor and patch updates (major updates are still done individually for each dependency). | 
|  | 
0 commit comments