edgartools icon indicating copy to clipboard operation
edgartools copied to clipboard

6.0: source-tree and test-layout reorganization — announced landing windows

Open dgunning opened this issue 4 months ago • 5 comments

Why

The 6.0 program includes reorganizing the source tree and the test layout (clearer package boundaries, tests organized by kind so contributors know exactly where a regression test goes). Tree moves are cheap for the repo and expensive for everyone with an open fork branch — so the commitment here is about how they land, not just what moves.

The commitment

  1. Every structural move is announced in advance in a pinned issue, with the landing window stated.
  2. The moving PR includes an old → new path map, so a fork branch (or the AI tool regenerating it) can rebase mechanically.
  3. Moves land in short, compressed windows — not dribbled across weeks of small renames.
  4. Public import paths keep working via back-compat shims with DeprecationWarning through 6.x; only genuinely internal paths move without shims.

Acceptance

  • No structural move lands without its announcement and path map.
  • Public imports verified working post-move via the shim layer (tested).
  • The test-layout reorg ships with an updated "where does my test go" section in CONTRIBUTING.

dgunning avatar Jul 31 '26 19:07 dgunning

Status update — the first structural move landed in 5.52.0, and it's a good test of the commitments above.

edgar/settings.py now exists (PR #1075). Connection settings and SEC identity — the access modes NORMAL/CAUTION/CRAWL, EdgarSettings, set_identity, get_identity, get_edgar_data_directory — moved out of edgar.core, where they had been sharing a 697-line module with quarter math, HTML sniffing, a pager, thread helpers and the logger. Only about a third of that module was settings, and essentially everything you're told to configure was in that third.

Nothing breaks today. edgar.core re-exports every moved name, and they are the same objects — is comparisons and isinstance checks behave identically. from edgar import set_identity, CAUTION is unaffected. The edgar.core re-exports are removed in 6.0.

Scoring this against the four commitments in the issue body, honestly:

  • (2) old → new path map — done, as a section in docs/upgrade/6.0.md, plus five documented lines repointed across docs/configuration.md and docs/guides/local-storage.md.
  • (3) short, compressed — done; one PR, plus #1078 repointing the one internal call site so the library doesn't emit deprecation warnings at itself.
  • (4) shims keep public imports working — done, and tested.
  • (1) announced in advance, with the landing window stated — not done. This issue had no comment before the move landed. It's the least disruptive move on the list, so the cost was near zero, but the commitment was made here and the first move didn't honor it. Flagging it rather than letting it pass, because the moves still ahead are the ones where advance notice actually matters.

Why this move was scoped down. The original plan was a core.py → settings.py rename. Measurement (AST-resolved, not grepped) said don't: 71 files import from edgar.core, and 26 of the 33 names in core.__all__ are reachable only via the module path, so the path can't simply vanish. Two useful findings from that pass — all 71 call sites are from edgar.core import <name> with zero import edgar.core or attribute access, so a re-export shim covers 100% of them; and the earlier "77 files" figure was a grep artifact, since four other core.py modules exist in the tree and relative imports have to be resolved against the importing module's package.

Still ahead under this issue, and these are the ones needing real landing windows: the loose single-form parsers, the three-way markdown name collision, wheel excludes, and ownership-family naming — plus the test-layout reorg, which is the one most likely to hit an open fork branch.

Verification on the move that landed: 5,384 fast tests and 2,577 regression tests pass, ruff unchanged on touched files.

dgunning avatar Aug 23 '26 00:08 dgunning

Progress update — the first moves shipped in 5.55.0 (2026-08-31).

Two single-form parsers moved to the subpackages their subject belongs to, each with a shim on the old path:

Was Now
edgar.effect edgar.offerings.effect — a notice of effectiveness is a registration-lifecycle document, so it sits with the S-1/S-3/S-4, 424B and Form C/D parsers
edgar.form144 edgar.ownership.form144 — Form 144 is an affiliate's notice of a proposed sale, so it sits with the Forms 3/4/5 parsers

Neither name was in edgar.__all__ nor re-exported at the top level, so the module path was their entire public surface.

The old paths still work and warn. 6.0 removes them. filing.obj() routes to the new paths, so ordinary use never triggers the warning — this only affects code importing the module directly.

Object identity is preserved, which is the part worth knowing if you are planning a migration. The shims forward by attribute (PEP 562) rather than re-exporting a fixed list, so edgar.effect.Effect is edgar.offerings.effect.Effect holds. isinstance checks written against either path agree, and you can migrate one call site at a time without a mixed-import bug. Verified in the wheel from PyPI, not just in the repo.

edgar.muniadvisors also became a package in the same release. Its import path is unchanged and all 19 of its public names still resolve — nothing for callers to do. Worth recording the hazard, since it is the inverse of the shim problem: __all__ named only MunicipalAdvisorForm while 18 other public names were reachable by attribute access, so a package __init__ that re-exported __all__ would have dropped 18 names while looking correct.

Also in this release

  • Four dead packages deleted — edgar/tools/, edgar/analysis/, edgar/xbrl/analysis/, and the reference/financials.py stub. No references anywhere.
  • The wheel stops shipping development tooling: ai/evaluation/, ai/examples/, entity/training/ and thirteenf/demo_comparison.py, about 8,900 lines that every install was downloading through an unrestricted edgar/**/*.py glob. ai/exporters/ stays, since export_skill is public API. The gate is a test asserting no shipped module imports an excluded path — an exclusion whose code is imported breaks installs only on user machines, so the property matters more than the exclusion.

Still to come: the three-way markdown module consolidation, the _filings.py / _party.py renames, and the core.py → settings.py question (77 files, 109 imports, and edgar.core is documented as public — that one needs an explicit decision rather than a ride-along).

Upgrade guidance, including a mechanical rewrite for the two moves: https://github.com/dgunning/edgartools/blob/main/docs/upgrade/6.0.md

dgunning avatar Aug 31 '26 23:08 dgunning

6.0 landing windows: what lands when, and when to rebase

5.62.0 is the last 5.x release. It is cut from the 5.62.x branch, which was taken from main on 2026-10-08, and only security and data-correctness hotfixes follow on 5.62.x. From Monday 2026-10-12 releases pause while the breaking changes land on main, and they resume with 6.0.0 on 2026-11-09 (release candidate around 11-02). There is no 6.0 branch: main stays open the whole time and PRs keep being reviewed and merged. Anything merged to main since 2026-10-08 ships in 6.0.0, not 5.62.0.

If you have an open branch or a fork, this is the schedule that affects it.

Week of What lands on main If your branch touches it
10-12 edgar/files/ and ChunkedDocument are deleted. Attachment.text() and 8-K exhibit text render through edgar.documents, so their layout changes (no box-drawn tables). beautifulsoup4 is dropped as a dependency. Rebase after the delete merges. Parse with edgar.documents and lxml, and don't add new bs4 imports, since the dependency is going away. Tests that pin attachment or exhibit text will need re-pinning.
10-19 requires-python becomes >=3.11 and the CI matrix drops 3.10. The six silent-None returns start raising, and the seven deprecated exception names are removed. search_filings() raises on a query EFTS rejects instead of returning 0 results: InvalidDateError for a malformed date, TransportError otherwise. FactQuery.to_dataframe() returns nullable Int64 for preferred_sign and fiscal_year. The HTTP client moves from httpx to httpx2, which verifies TLS against the operating system's certificate store instead of certifi. Tests that assert is None on those six calls need pytest.raises. Catch the ...Error names from edgar.exceptions, not httpx exceptions. Tests that patch httpx.* by name need httpx2.*. In a minimal container with no OS certificates, install the CA package or set SSL_CERT_FILE.
10-26 The import shims that warned through 5.x are removed (path map below). Repoint imports before rebasing; the old paths become ImportError.
10-30 Merge cutoff for 6.0.0. Anything merged later ships in 6.0.1.

The 6.0 upgrade guide already covers the deprecations, the error changes and the moved import paths with before/after code, and each remaining change adds its own section in the PR that lands it. Running your branch on 5.61.1, or 5.62.0 once it ships, with warnings visible, or with EDGARTOOLS_STRICT_ERRORS=1, shows you today what breaks in week two.

Path map for the shim removal

Old path (removed) New path
edgar.effect edgar.offerings.effect
edgar.form144 edgar.ownership.form144
edgar.core settings and identity names (set_identity, get_identity, EdgarSettings, get_edgar_data_directory, ...) edgar.settings, or the top-level edgar
edgar.core date helpers (filing_date_to_year_quarters, current_year_and_quarter, is_start_of_quarter, parse_acceptance_datetime) edgar.dates
edgar.files.* edgar.documents (no one-to-one map; see the guide)

The rest of edgar.core stays where it is.

Tests have already moved. Since September the test tree mirrors the package tree, so a test for edgar/offerings/... goes in tests/offerings/, not at the top of tests/. Regression tests still go in tests/issues/regression/test_issue_NNN.py. A branch cut before then will have tests at paths that no longer exist on main.

Standardized values change across the window. A sequence of standard_concept mapping corrections (merge order in #1494) lands on main between now and 10-30, so many XBRL line items move to a different standard concept. Values users already see change, and each is listed under "Upgrading: value changes" in the 6.0 release notes. If your tests pin standardized concepts or gaap_mappings.json entries, expect to re-pin them after a rebase.

Two things every PR needs now

  • A changelog fragment in changelog.d/<issue>.<section>.md. Please don't edit CHANGELOG.md.
  • If the PR deprecates something or changes what a call returns, a matching entry in docs/upgrade/6.0.md. CI checks for it.

Not in 6.0. The markdown module consolidation, the _filings.py / _party.py renames, the rest of the test-layout work and the dependency diet have all moved to 6.x. Each will be announced on this issue before it lands, with its own path map.

A correction to the commitment above. The issue body says shims stay "through 6.x". Every release note and upgrade-guide entry since 5.52.0 has said the shims are removed in 6.0, and that is what will happen on 10-26. The body should have been updated when that changed.

If your PR is going to be caught by one of these windows and you'd rather it merged first, say so on the PR and it will be reviewed ahead of the window.

dgunning avatar Oct 03 '26 21:10 dgunning

Update, 2026-10-11: the pinned schedule above has been edited. Here's what changed:

  • 5.62.0 is the last 5.x release, not 5.60.0. It is cut from the new 5.62.x branch, and hotfixes follow on 5.62.x.
  • main is already 6.0. Anything merged to main since 2026-10-08 ships in 6.0.0, not 5.62.0. The weekly windows, starting 10-12, are unchanged.
  • The 10-19 row adds search_filings(): a query EFTS rejects now raises (InvalidDateError for a bad date, TransportError otherwise) instead of returning 0 results (#1497).
  • New note: standardized-concept mappings change across the window as the mapping corrections in #1494 land. If your tests pin standardized concepts, expect to re-pin them after a rebase.

The 10-30 cutoff and the 11-09 release date are unchanged.

dgunning avatar Oct 11 '26 11:10 dgunning

Update: the httpx → httpx2 change (#1410) landed on main on 2026-10-13, a week ahead of the week of 10-19 announced here. Details and migration notes are in docs/upgrade/6.0.md.

dgunning avatar Oct 13 '26 16:10 dgunning