Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump mypy version to 1.3.0 #646

Open
1 task done
rominf opened this issue Jun 8, 2023 · 2 comments
Open
1 task done

Bump mypy version to 1.3.0 #646

rominf opened this issue Jun 8, 2023 · 2 comments

Comments

@rominf
Copy link
Contributor

rominf commented Jun 8, 2023

The latest mypy catches more bugs and is three times faster on my PC when running on the whole code base without caches than the current version (9 seconds vs. 27 seconds).

I propose bumping mypy version (and fixing all the issues, of course).

  • I am ready to create a PR.
@wolfv
Copy link
Member

wolfv commented Aug 22, 2023

This would be great @rominf – please go for it :)

rominf added a commit to rominf/quetz that referenced this issue Aug 30, 2023
Preparation for mamba-org#646

* Remove `ignore_missing_imports = true` from mypy configuration.
* Run mypy in the same environment instead of separate to check types
  in dependencies like fastapi.
* Move mypy dependencies from pre-commit configuration to setup.cfg.
* Update mypy dependencies there.
* Add libraries with missing types to ignore list in mypy
  configuration.
* Add pydantic mypy plugin.
* Allow running mypy without explicit paths.
* Update GitHub Actions.
* Temporarily add ignore `annotation-unchecked` to make mypy pass.
* Fix new mypy issues:
  * Use https://github.com/hauntsaninja/no_implicit_optional to make
    `Optional` explicit.
  * If there is no default, first `pydantic.Field` argument should be
    omitted (`None` means that the default argument is `None`).
  * Fix logical error in `_run_migrations`: no config - no migrations.
  * Trivial errors.
rominf added a commit to rominf/quetz that referenced this issue Aug 30, 2023
Preparation for mamba-org#646

* Remove `ignore_missing_imports = true` from mypy configuration.
* Run mypy in the same environment instead of separate to check types
  in dependencies like fastapi.
* Move mypy dependencies from pre-commit configuration to setup.cfg.
* Update mypy dependencies there.
* Add libraries with missing types to ignore list in mypy
  configuration.
* Add pydantic mypy plugin.
* Allow running mypy without explicit paths.
* Update GitHub Actions.
* Temporarily add ignore `annotation-unchecked` to make mypy pass.
* Fix new mypy issues:
  * Use https://github.com/hauntsaninja/no_implicit_optional to make
    `Optional` explicit.
  * If there is no default, first `pydantic.Field` argument should be
    omitted (`None` means that the default argument is `None`).
  * Fix logical error in `_run_migrations`: no config - no migrations.
  * Introduce `ChannelWithOptionalName` for `/channels` patch method to
    preserve compatibility.
  * Trivial errors.
rominf added a commit to rominf/quetz that referenced this issue Aug 30, 2023
Preparation for mamba-org#646

* Remove `ignore_missing_imports = true` from mypy configuration.
* Run mypy in the same environment instead of separate to check types
  in dependencies like fastapi.
* Move mypy dependencies from pre-commit configuration to setup.cfg.
* Update mypy dependencies there.
* Add libraries with missing types to ignore list in mypy
  configuration.
* Add pydantic mypy plugin.
* Allow running mypy without explicit paths.
* Update GitHub Actions.
* Temporarily add ignore `annotation-unchecked` to make mypy pass.
* Fix new mypy issues:
  * Use https://github.com/hauntsaninja/no_implicit_optional to make
    `Optional` explicit.
  * If there is no default, first `pydantic.Field` argument should be
    omitted (`None` means that the default argument is `None`).
  * Fix logical error in `_run_migrations`: no config - no migrations.
  * Introduce `ChannelWithOptionalName` for `/channels` patch method to
    preserve compatibility.
  * Trivial errors.
rominf added a commit to rominf/quetz that referenced this issue Aug 30, 2023
Preparation for mamba-org#646

* Remove `ignore_missing_imports = true` from mypy configuration.
* Run mypy in the same environment instead of separate to check types
  in dependencies like fastapi.
* Move mypy dependencies from pre-commit configuration to setup.cfg.
* Update mypy dependencies there.
* Add libraries with missing types to ignore list in mypy
  configuration.
* Add pydantic mypy plugin.
* Allow running mypy without explicit paths.
* Update GitHub Actions.
* Temporarily add ignore `annotation-unchecked` to make mypy pass.
* Fix new mypy issues:
  * Use https://github.com/hauntsaninja/no_implicit_optional to make
    `Optional` explicit.
  * If there is no default, first `pydantic.Field` argument should be
    omitted (`None` means that the default argument is `None`).
  * Fix logical error in `_run_migrations`: no config - no migrations.
  * Introduce `ChannelWithOptionalName` for `/channels` patch method to
    preserve compatibility.
  * Trivial errors.
rominf added a commit to rominf/quetz that referenced this issue Aug 30, 2023
Preparation for mamba-org#646

* Remove `ignore_missing_imports = true` from mypy configuration.
* Run mypy in the same environment instead of separate to check types
  in dependencies like fastapi.
* Move mypy dependencies from pre-commit configuration to setup.cfg.
* Update mypy dependencies there.
* Add libraries with missing types to ignore list in mypy
  configuration.
* Add pydantic mypy plugin.
* Allow running mypy without explicit paths.
* Update GitHub Actions.
* Temporarily add ignore `annotation-unchecked` to make mypy pass.
* Fix new mypy issues:
  * Use https://github.com/hauntsaninja/no_implicit_optional to make
    `Optional` explicit.
  * If there is no default, first `pydantic.Field` argument should be
    omitted (`None` means that the default argument is `None`).
  * Fix logical error in `_run_migrations`: no config - no migrations.
  * Introduce `ChannelWithOptionalName` for `/channels` patch method to
    preserve compatibility.
  * Trivial errors.
@rominf
Copy link
Contributor Author

rominf commented Aug 30, 2023

Hi @wolfv. I've done some preparation work in #658. Please have a look :-)

rominf added a commit to rominf/quetz that referenced this issue Sep 3, 2023
Preparation for mamba-org#646

* Remove `ignore_missing_imports = true` from mypy configuration.
* Run mypy in the same environment instead of separate to check types
  in dependencies like fastapi.
* Move mypy dependencies from pre-commit configuration to `setup.cfg`.
* Update mypy dependencies there.
* Move `rq` from `environment.yml` to `setup.cfg`: conda-forge version:
  1.9.0, pypi version : 1.15.1 (two years difference; types were added).
* Add libraries with missing types to ignore list in mypy
  configuration.
* Add pydantic mypy plugin.
* Allow running mypy without explicit paths.
* Update GitHub Actions.
* Temporarily add ignore `annotation-unchecked` to make mypy pass.
* Fix new mypy issues:
  * Use https://github.com/hauntsaninja/no_implicit_optional to make
    `Optional` explicit.
  * If there is no default, first `pydantic.Field` argument should be
    omitted (`None` means that the default argument is `None`).
  * Refactor `_run_migrations`. There were two different paths: one for
    normal execution, another one for testing. Simplify arguments and
    the function code itself, introduce a new mock `run_migrations`.
  * Introduce `ChannelWithOptionalName` for `/channels` patch method to
    preserve compatibility. Note, that the solution is a bit dirty (I
    had to use `type: ignore[assignment]`) to minimize the number of
    models and the diff.
  * Trivial errors.
rominf added a commit to rominf/quetz that referenced this issue Sep 3, 2023
Preparation for mamba-org#646

* Remove `ignore_missing_imports = true` from mypy configuration.
* Run mypy in the same environment instead of separate to check types
  in dependencies like fastapi.
* Move mypy dependencies from pre-commit configuration to `setup.cfg`.
* Update mypy dependencies there.
* Move `rq` from `environment.yml` to `setup.cfg`: conda-forge version:
  1.9.0, pypi version : 1.15.1 (two years difference; types were added).
* Add libraries with missing types to ignore list in mypy
  configuration.
* Add pydantic mypy plugin.
* Allow running mypy without explicit paths.
* Update GitHub Actions.
* Temporarily add ignore `annotation-unchecked` to make mypy pass.
* Fix new mypy issues:
  * Use https://github.com/hauntsaninja/no_implicit_optional to make
    `Optional` explicit.
  * If there is no default, the first `pydantic.Field` argument should
    be omitted (`None` means that the default argument is `None`).
  * Refactor `_run_migrations`. There were two different paths: one for
    normal execution and another one for testing. Simplify arguments and
    the function code, and introduce a new mock `run_migrations`.
  * To preserve compatibility, introduce `ChannelWithOptionalName` for
    the `/channels` patch method. Note that the solution is a bit dirty
    (I had to use `type: ignore[assignment]`) to minimize the number of
    models and the diff.
  * Trivial errors.
rominf added a commit to rominf/quetz that referenced this issue Sep 24, 2023
Preparation for mamba-org#646

* Remove `ignore_missing_imports = true` from mypy configuration.
* Run mypy in the same environment instead of separate to check types
  in dependencies like fastapi.
* Move mypy dependencies from pre-commit configuration to `setup.cfg`.
* Update mypy dependencies there.
* Move `rq` from `environment.yml` to `setup.cfg`: conda-forge version:
  1.9.0, pypi version : 1.15.1 (two years difference; types were added).
* Add libraries with missing types to ignore list in mypy
  configuration.
* Add pydantic mypy plugin.
* Allow running mypy without explicit paths.
* Update GitHub Actions.
* Temporarily add ignore `annotation-unchecked` to make mypy pass.
* Fix new mypy issues:
  * Use https://github.com/hauntsaninja/no_implicit_optional to make
    `Optional` explicit.
  * If there is no default, the first `pydantic.Field` argument should
    be omitted (`None` means that the default argument is `None`).
  * Refactor `_run_migrations`. There were two different paths: one for
    normal execution and another one for testing. Simplify arguments and
    the function code, and introduce a new mock `run_migrations`.
  * To preserve compatibility, introduce `ChannelWithOptionalName` for
    the `/channels` patch method. Note that the solution is a bit dirty
    (I had to use `type: ignore[assignment]`) to minimize the number of
    models and the diff.
  * Trivial errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants