Pytest fixture params carry their real types from conftest.py fixture
definitions scattered across the tree, not the function signature —
fully annotating every test function's fixture params for marginal
safety on non-public test code (~150 errors, mostly in tools/network
test doubles and repository test suites) isn't worth the churn. src/
stays strict; this is a deliberate, scoped relaxation per package, not
a blanket one.
Also adds the missing tests/__init__.py to flowsint-api — its tests
dir was the only one without it, so its module name never actually
matched the tests.* override glob (mypy silently no-op'd it, flagged
via its own "unused section" note). The other three packages already
had this.
Without known_first_party, isort's own-package detection depends on
which files it's given: sorted alone, a file inside flowsint_enrichers
gets flowsint_enrichers imports grouped separately from flowsint_core/
flowsint_types; sorted together with the rest of the workspace (as
`make lint` and CI do), they collapse into one group. lint-staged only
ever passes the staged subset, so a commit could pass the pre-commit
hook locally and still fail `make lint` in CI — silently, since both
are "isort says it's fine," just about different file sets.
Pin the four packages as known_first_party in all four pyproject.toml
so grouping is the same regardless of invocation scope. The rest of
the diff is isort re-normalizing ~100 files to the now-consistent
order — import statements only, verified against the diff.
Each is a real defect, not style — flake8 just never ran before to
catch them:
- logger.py: bare `except:` around a queue drain swallowed everything
including KeyboardInterrupt/SystemExit instead of just queue.Empty
- dockertool.py: bare `except:` narrowed to Exception
- permissions.py: duplicate `HTTPException` import, dead code
- test_registry.py: `test_get_by_lower_key` was defined twice — the
second definition silently shadowed the first, so only one ever ran
- to_ports.py / test_investigation_repository.py: assigned-but-unused
local variables, dead code
- to_whois.py / to_infos.py: documented pyflakes false positive
(OutputType is a class attr, resolves fine at def-time) — noqa'd
with an explanation instead of restructuring working code
- E712 (`== True`/`== False` → `is True`/`is False`) across 7 test
files, F541 (f-strings with no placeholders) across 5 enrichers,
E402 (import order) noqa'd in 2 files where the order is deliberate
(env vars set before import; documented circular-import workaround)