TODO.rst 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. Deferred Modernization Work
  2. ===========================
  3. The packaging migration (setup.py → pyproject.toml, drop six, refresh docs)
  4. landed in commits ``7df4a94``..``HEAD``. The items below were identified
  5. during that sweep but deliberately left out because each is large enough
  6. to warrant its own focused PR.
  7. Mechanical Python idiom updates
  8. -------------------------------
  9. Each of these is a near-mechanical refactor with a wide diff. Best done
  10. one-at-a-time so reviewers can read each change as a single transformation.
  11. * **Drop explicit ``object`` base class.** ``class Foo(object):`` →
  12. ``class Foo:``. No behavior change in Py3.
  13. * **Modernize ``super()`` calls.** ``super(ClassName, self).method(...)`` →
  14. ``super().method(...)``. The arguments are required only in Py2.
  15. * **Adopt f-strings.** ``"x={0}".format(x)`` and ``"x=%s" % x`` →
  16. ``f"x={x}"``. Skip for logging calls — those should keep ``%s``
  17. formatting so the logger can short-circuit when the level is disabled.
  18. * **Switch typing imports to builtins.** ``List[X]`` / ``Dict[K, V]`` /
  19. ``Optional[X]`` → ``list[X]`` / ``dict[K, V]`` / ``X | None`` once a
  20. Python 3.10+ floor is acceptable (we already require 3.13, so this is
  21. safe today).
  22. Lint and tooling
  23. ----------------
  24. * **Fix the ~23 pre-existing flake8 import-order errors.** Run
  25. ``tox -e lint`` to see the list. Mostly ``I100``/``I201``/``I202``
  26. under ``cloudbridge/providers/azure``, ``gcp``, and ``openstack``.
  27. * **Consider replacing flake8 + flake8-import-order with ruff.** Ruff
  28. reads ``pyproject.toml``, runs ~100× faster, and covers import
  29. ordering (``I``) plus most flake8 plugins out of the box.
  30. * **Consider adding mypy / pyright in CI.** The codebase has no type
  31. hints today; this would be a meaningful uplift, not a one-PR task.
  32. Repository hygiene
  33. ------------------
  34. * **Untracked local-dev artifacts at the repo root** — ``azure.txt``,
  35. ``openstack.txt``, ``docs2/``, ``script_test.py``, ``openstack.log``.
  36. Each likely belongs in ``.gitignore`` or in a developer's untracked
  37. workspace; investigate before either committing or deleting.
  38. Integration-test infrastructure
  39. -------------------------------
  40. * **Reap stale ``cb-*`` resources on the OpenStack DevStack target.**
  41. When an integration test fails partway, its cleanup sometimes
  42. doesn't run (e.g., cleanup itself errors), leaving orphan volumes,
  43. servers, floating IPs, and networks named ``cb-<role>-<uuid>`` in
  44. the demo project. They accumulate across CI runs and eventually
  45. trip the project quotas (we hit ``VolumeLimitExceeded`` once
  46. already). Quotas have been raised generously as a stopgap, but the
  47. proper fix is a janitor: a small script that runs at the start of
  48. each ``tox -e py3.13-openstack`` invocation (or as a host-side
  49. systemd timer) and deletes any ``cb-*``-named resource older than
  50. ~1 hour. Candidate hook: a ``setUp``-level fixture in
  51. ``tests/helpers/__init__.py`` that nukes leftovers before the run,
  52. scoped by the cloudbridge naming convention so it can't touch
  53. unrelated tenants.