Page MenuHomeSoftware Heritage

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

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

Diff Detail

Repository
rDSCH Scheduling utilities
Branch
feature/typing
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 7933
Build 11425: tox-on-jenkinsJenkins
Build 11424: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Sep 24 2019, 1:50 PM
  • tox.ini: add mypy section
  • init.py: switch to documented way of extending path
  • 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.

swh/scheduler/celery_backend/config.py
191

I'll open a diff.

There we go D2059 ;)