v0.6.0
Frequenz Repository Configuration Release Notes
Summary
This release replaces darglint (not maintained anymore) with pydoclint which brings performance and checks improvements. It also adds basic flake8 checks and mypy fixes.
Upgrading
-
flake8basic checks are enabled now. Most are already covered bypylint, but there are a few differences, so you might need to fix your code ifflake8find some issues. -
darglint:-
Replaced by
pydoclint,pydoclintcan find a few more issues thandarglint, so your code might need adjusting. -
It is recommended to remove the
darglintconfiguration file.darglintand thedarglintpippackage, if it is kept installed, it will makeflake8run extremely slowly even if not used:pip uninstall darglint) and rebuild younoxvenvs if you use-R.
-
-
If you are upgrading without regenerating the cookiecutter templates, you'll need to adjust the dependencies accordingly.
-
nox: TheConfig.package_args()method was removed. -
mypy-
Options must be specified in the
pyproject.tomlfile, including the optionpackagesspecifying the package containing the source code of the project. The documentation was updated to suggest the recommended options. -
Dependencies on stubs for running the type check need to be specified manually in the
pyproject.tomlfile, so they can be pinned (before they were installed automatically bymypy. -
The
mypynoxsession runsmypy2 times, one without options to check the package including the sources, and one with the paths of development paths (tests,benchmarks, etc.).
To migrate existing projects:
-
Add the recommended options (previously specified in the default options object):
[tool.mypy] explicit_package_bases = true namespace_packages = true packages = ["<package.name>"] # For example: "frequenz.repo.config" for this package strict = true
-
Find out which stubs were previously installed automatically by
mypy:python -m venv tmp_venv . tmp_venv/bin/activate pip install -e .[dev-mypy] mypy --install-types deactivate -
Look at the list of packages it offers to install and answer "no".
-
Search for the latest package version for those packages in https://pypi.org/project//
-
Edit the
pyproject.tomlfile to add those dependencies indev-mypy, for example:[project.optional-dependencies] dev-mypy = [ "mypy == 1.5.1", "types-setuptools == 68.1.0.0", # ...
-
Cookiecutter template
-
CI: The
noxjob now uses a matrix to run the differentnoxsessions in parallel. If you use branch projection with thenoxjob you need to update the rules to include each matrix job. -
See the general upgrading section.
New Features
-
flake8is now used to check the files. -
darlintwas replaced bypydoclint, which is way faster and detect more issues. -
nox: TheConfig.path_args()method now accepts two optional arguments to control with paths to include.
Cookiecutter template
-
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).
-
ci: Add debug information when installing pip packages.
The output of
pip freezeis printed to be able to more easily debug different behaviours between GitHub workflow runs and local runs. -
mypy: Add a commented outno-incrementaloption, which makes the run slower but prevents some issues withmypygiving different results on different runs. -
See the general new features section.
What's Changed
- Clear release notes by @llucax in #123
- Group dependabot updates by @llucax in #126
- ci: Add env and pip debug information by @llucax in #127
- Improve comment about updating dependencies by @llucax in #125
- Replace
darglintwithpydoclintby @llucax in #124 - Improve how
mypyis run by @llucax in #128
Full Changelog: v0.5.2...v0.6.0