Improve CmdPythonpath / mypy_path generation #10

Merged
Jan Lindemann merged 4 commits from jan/feature/20260611-feature/20260611-better-mypy-path into master 2026-06-11 12:48:14 +02:00 AGit
Showing only changes of commit f153a990a7 - Show all commits

build.cmds.CmdPythonpathOrig: Remove
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 3m35s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 3m39s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 3m32s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 4m29s
CI / Packaging test (push) Successful in 0s

Remove CmdPythonpathOrig. Its only purpose has ever been to document and try out how cmd_pythonpath_orig() had worked in an ancient application version, that purpose is now served.

Signed-off-by: Jan Lindemann <jan@janware.com>
Jan Lindemann 2026-06-11 12:36:06 +02:00
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61

View file

@ -1,38 +0,0 @@
from __future__ import annotations
import os
from ...App import Scope
from .Cmd import Cmd, Parent
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from argparse import ArgumentParser, Namespace
class CmdPythonpathOrig(Cmd): # export
def __init__(self, parent: Parent) -> None:
super().__init__(parent, 'pythonpath_orig', help = 'pythonpath')
def add_arguments(self, parser: ArgumentParser) -> None:
super().add_arguments(parser)
parser.add_argument('module', nargs = '*', help = 'Modules')
async def _run(self, args: Namespace) -> None:
deps = self.app.get_project_refs(
args.module,
['pkg.requires.jw'],
['run', 'build'],
scope = Scope.Subtree,
add_self = True,
names_only = True,
)
r = ''
for m in deps:
pd = self.app.find_dir(m, pretty = False)
if pd is None:
continue
for subdir in ['src/python', 'tools/python']:
cand = pd + '/' + subdir
if os.path.isdir(cand):
r = r + ':' + cand
print(r[1:])