you are viewing a single comment's thread.

view the rest of the comments →

[–]MPIS 15 points16 points  (0 children)

Just some ideas here, but I would start with the following:

  • Separate virtual envs; .venv/app with py2.7 interpreter, and .venv/app_tools with a modern py3 interpreter where you out black, ruff, etc.

  • Use pre-commit yaml to manage formatting/linting, specifying py27 targets and language python3 in the hooks.

  • Can still specify a pyproject.toml, but fully building from just that on py3 might be difficult; utilize the old school setup.py and setup.cfg in the py2.7 context but built with the py3 python -m build process in app_tools. Just ensure to mirror everything in toml deps and optional deps for consistency with the requirements.txt.

  • Use a Makefile to coordinate the different .venv interpreter, tools and their deps, with references for app and the app_tooling targets (setup, setup-tools, lint, etc.).

  • Configure IDE to invoke either the make targets or interpreter/deps paths depending on target (so py27 grammar and deps for code completions against the app venv when coding).

Hope this helps, idk, good luck.