Add the ignore-without-code error code to the mypy configuration.
This requires all # type: ignore comments to include a specific error
code, improving the precision and maintainability of type ignore
annotations.
Assisted-by: unsloth/Qwen3.6-35B-A3B-GGUF:IQ4_NL and pi.dev 0.81.1
Signed-off-by: Jan Lindemann <jan@janware.com>
Add mypy's explicit-override error code and pyrightconfig's
reportImplicitOverride "error" directive. This requires all methods
that override base class methods to be decorated with @override from
typing. The change complements the previous commit, which added
exactly that decorator to all relevant methods.
Signed-off-by: Jan Lindemann <jan@janware.com>
conf/templates is not installed to /etc/opt/jw-pkg/templates. Fix
that so that other packages including py-topdir.mk can use the
templates.
Signed-off-by: Jan Lindemann <jan@janware.com>
Add a [tool.mypy] section to pyproject.toml with a {mypypath}
template variable. The already existing template generation mechanism
in py-topdir.mk should fill that in with a path pointing to all
Python modules managed by jw-pkg:
[tool.mypy]
{mypypath}
Signed-off-by: Jan Lindemann <jan@janware.com>
pyproject.toml is currently copied unchanged from conf/topdir to the
toplevel directory. Set up machinery in py-topdir.mk to render it
from a template in conf/templates instead, replacing {mypypath} in
the process.
Signed-off-by: Jan Lindemann <jan@janware.com>
Add $(TOPDIR)/conf/templates as a location for templates, i.e. input
files to the CmdCreateFile template rendering command.
Signed-off-by: Jan Lindemann <jan@janware.com>
Add new ruff rules and fix their fallout:
future-annotations = true
select = [
"TC", # type-checking import placement rules
"FA", # future annotations rules
]
This comprises:
- Streamline imports and exports in cmds.xxx.Cmd
- Import base class as "Base"
- Export types Cmd and Parent via __all__
- Move all types imported only for annotation below TYPE_CHECKING
- Use "from __future__ import annotations" all over the place
Signed-off-by: Jan Lindemann <jan@janware.com>
In order to produce make check output digestable by vim, ruff's
output format needs to be set to "concise", so do that.
Signed-off-by: Jan Lindemann <jan@janware.com>
py-topdir.mk: Use ruff and yapf
- Use pyright for the target py-check-syntax
- Generate a $(TOPDIR)/pyrightconfig.json for that
- Add pyrightconfig-base.json because it's used by
pyrightconfig.json
- Add python3-pyright to pkg.requires.release, anticipating the use
of the py-syntax-check target by CI
Signed-off-by: Jan Lindemann <jan@janware.com>
- Use ruff and yapf for the targets py-check-syntax, py-format and
py-check-format.
- Add a pyproject.toml for those. It also includes configuration
for isort, albeit not being directly used in the linter targets.
- Make .gitignore igore that in newly created projects.
- Add ruff, yapf and isort to pkg.requires.release, anticipating
their use by CI.
Signed-off-by: Jan Lindemann <jan@janware.com>
Add generic machinery to dynamically create files in $(TOPDIR). The
need arises because version controlled configuration files for
linters are going to be introduced.
For that, this commit introduces a variable $(TD_GENERATE_FILES),
which target all depends on, and which topdir.clean removes.
It defaults to another variable also introduced by this commit,
$(TD_COPY_FILES), which in turn defaults to $(TOPDIR)/conf/topdir.
This commit also adds support for JW_PKG_TOPDIR_COPY_PATH. It
supports a PATH-style syntax, which allows pointing to multiple
directories to be checked for source files. If they exist, they will
be appended to the files found in $(TOPDIR)/conf/topdir after
copying. Defining arbitray files to copy is not supported before
security implications during CI runs are better understood.
Having the copy prerequisites work comes at the cost of having to add
.SECONDEXPANSION. Since it's limited to the toplevel Makefile, I
suppose that's acceptable.
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit removes everything not strictly necessary for running
"make clean all" inside jw-build.
packaging jw-devtest. This cuts the repo down from 24077 to 4725
lines of code.
The idea is to
1) Further remove bloat from the remaining bits
2) Re-add what's necessary to build and package other essential repos.
The decision should be based on whether or not jw-build can also be
useful in a non-janware context.
Signed-off-by: Jan Lindemann <jan@janware.com>
/usr/bin/hostname often returns nonsense, especially during early phases
of installation. Rely on the contents of /etc/hostname for determining
jcs_dir
Signed-off-by: Jan Lindemann <jan@janware.com>
This target runs ssh -l root $(TARGET_HOST), with TARGET_HOST typically defined in
$(MODDIR)/make/local.mk. Seems a bit out-of-place, everything, but anyway.
Signed-off-by: Jan Lindemann <jan@janware.com>