Page MenuHomeSoftware Heritage

typing: minimal changes to make a no-op mypy run pass
ClosedPublic

Authored by zack on Tue, Sep 24, 1:48 PM.

Diff Detail

Repository
rDSCH Scheduling utilities
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

zack created this revision.Tue, Sep 24, 1:48 PM
vlorentz accepted this revision.Tue, Sep 24, 1:50 PM
This revision is now accepted and ready to land.Tue, Sep 24, 1:50 PM
zack updated this revision to Diff 6820.Tue, Sep 24, 1:55 PM
  • tox.ini: add mypy section
zack updated this revision to Diff 6837.Fri, Sep 27, 10:38 AM
  • init.py: switch to documented way of extending path
zack updated this revision to Diff 6904.Tue, Oct 1, 1:09 PM
  • tox: anticipate mypy run to just after flake8
ardumont added inline comments.
swh/scheduler/celery_backend/config.py
191

jsyk, within docker-env, this does not work (after rebuild of the swh containers).

swh-lister_1                  | Traceback (most recent call last):
swh-lister_1                  |   File "/srv/softwareheritage/venv/bin/swh", line 10, in <module>
swh-lister_1                  |     sys.exit(main())
swh-lister_1                  |   File "/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/core/cli/__init__.py", line 56, in main
swh-lister_1                  |     return swh(auto_envvar_prefix='SWH')
swh-lister_1                  |   File "/srv/softwareheritage/venv/lib/python3.7/site-packages/click/core.py", line 764, in __call__
swh-lister_1                  |     return self.main(*args, **kwargs)
swh-lister_1                  |   File "/srv/softwareheritage/venv/lib/python3.7/site-packages/click/core.py", line 717, in main
swh-lister_1                  |     rv = self.invoke(ctx)
swh-lister_1                  |   File "/srv/softwareheritage/venv/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
swh-lister_1                  |     return _process_result(sub_ctx.command.invoke(sub_ctx))
swh-lister_1                  |   File "/srv/softwareheritage/venv/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
swh-lister_1                  |     return _process_result(sub_ctx.command.invoke(sub_ctx))
swh-lister_1                  |   File "/srv/softwareheritage/venv/lib/python3.7/site-packages/click/core.py", line 956, in invoke
swh-lister_1                  |     return ctx.invoke(self.callback, **ctx.params)
swh-lister_1                  |   File "/srv/softwareheritage/venv/lib/python3.7/site-packages/click/core.py", line 555, in invoke
swh-lister_1                  |     return callback(*args, **kwargs)
swh-lister_1                  |   File "/srv/softwareheritage/venv/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
swh-lister_1                  |     return f(get_current_context(), *args, **kwargs)
swh-lister_1                  |   File "/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/lister/cli.py", line 155, in register_task_types
swh-lister_1                  |     mod = import_module(task_module)
swh-lister_1                  |   File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
swh-lister_1                  |     return _bootstrap._gcd_import(name[level:], package, level)
swh-lister_1                  |   File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
swh-lister_1                  |   File "<frozen importlib._bootstrap>", line 983, in _find_and_load
swh-lister_1                  |   File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
swh-lister_1                  |   File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
swh-lister_1                  |   File "<frozen importlib._bootstrap_external>", line 728, in exec_module
swh-lister_1                  |   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
swh-lister_1                  |   File "/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/lister/bitbucket/tasks.py", line 8, in <module>
swh-lister_1                  |     from swh.scheduler.celery_backend.config import app
swh-lister_1                  |   File "/srv/softwareheritage/venv/lib/python3.7/site-packages/swh/scheduler/celery_backend/config.py", line 191, in <module>
swh-lister_1                  |     CONFIG = SWH_CONFIG.get('celery', default={})
swh-lister_1                  | TypeError: get() takes no keyword arguments

I'll open a diff.

ardumont added inline comments.Wed, Oct 2, 7:01 AM
swh/scheduler/celery_backend/config.py
191

I'll open a diff.

There we go D2059 ;)