Repository navigation
release: prepare 3.0.0 so main can pass release.yml (no publish) - #541
Merged
Merged
Conversation
release.yml runs `ruff check .` before it builds. On main that step fails with 112 errors, so no release can pass it. - `ruff check --fix`, then `--unsafe-fixes`. The unsafe fixes here keep behavior: `int(round(x))` to `round(x)`, `zip(..., strict=False)`, and `_` prefixes on unused unpacked names. - Hand fixes for the last 20: ClassVar annotations, loop variables bound in benchmark lambdas, an en dash, and `pytest.raises(FrozenInstanceError)` in place of `pytest.raises(Exception)`. - examples/ may use scikit-learn's `X` name (N803, N806). No change to src/ behavior. mypy is clean. The suite passes.
PyPI has 2.1.0. The README documents the 3.x API on main, so a user who runs `pip install freshdata-cleaner` gets an API the README does not describe. Main cannot release today: - pyproject says 0.4.0, and PyPI already has 0.4.0. - The resolve step reads `__version__` with ast.literal_eval. Main sets it with importlib.metadata, so the step stops with ValueError. - The test job asks for extras that main does not have (ml, docs). Its `pytest -m` names markers that pytest does not know. mkdocs stops on docs/api-reference.md, which names 2.x functions. - The smoke job calls `fd.clean(..., verbose=False)`. 3.x has no `verbose`. Changes: - version 3.0.0, and a 3.0.0 CHANGELOG section that lists the breaking changes from 2.1.0. Entries for 2.x work that never shipped are marked. - pyproject.toml is the one source of the version. The smoke job now checks `fd.__version__` against the resolved version. - A docs extra, registered online/large markers, and an API reference page for the 12 names that 3.x exports. - The pyproject description no longer claims a DuckDB backend. - tests/test_release_workflow.py runs the release scripts offline. This commit does not tag or publish.
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
The 3.0.0 section gets its release date before the tag. The release check compared the version with every dated CHANGELOG entry, so the dated 3.0.0 entry made it fail: assert (3, 0, 0) > (3, 0, 0). The check now compares only with entries for older versions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
Main can now pass every job in
release.ymlup to the publish step. This PR does not tag or publish. A maintainer makes the release decision.Two commits:
style:fixes the 112ruff check .errors that stop the release quality gate. No change tosrc/behavior.release:sets the version to 3.0.0 and fixes the release scripts.pyproject.tomlis the one source of the version. The resolve step no longer parses__version__withast.literal_eval. The smoke job checksfd.__version__against the resolved version.release.ymlandtestpypi.ymlno longer passverbose=False..[dev,migrate,docs]. Main has nomlextra.migratebringslibcst, which mypy andtests/test_migrate_codemod.pyneed.docsextra (same pins as 2.1.0). Theonlineandlargemarkers are registered.docs/api-reference.mdlists the 12 names that 3.x exports.[3.0.0] - Unreleasedsection with the breaking changes from 2.1.0. ANever releasedheading marks the 2.x entries that the 3.0 rewrite removed.Why?
PyPI has 2.1.0. The README documents the 3.x API on main. A new user who runs
pip install freshdata-cleanerand copies the README quickstart gets:The fix is a 3.x release, but main cannot release:
ValueError: malformed node or string on line 15: <ast.Call object ...>0.4.0is already on PyPI (https://pypi.org/pypi/freshdata-cleaner/0.4.0/jsonreturns 200)WARNING: freshdata-cleaner 0.4.0 does not provide the extra 'docs'(and'ml')Found 112 errors.src/freshdata/cli/migrate.py:44: error: Class cannot subclass "VisitorBasedCodemodCommand" (has type "Any")(libcst not installed)ModuleNotFoundError: No module named 'libcst'. With libcst:ERROR: Unknown marker(s) in '-m' expression: large, online.ERROR - mkdocstrings: freshdata.clean_csv could not be foundTypeError: CleanConfig.__init__() got an unexpected keyword argument 'verbose'How was it tested?
New check:
tests/test_release_workflow.py. It reads the scripts out ofrelease.ymland runs them offline.Before (main + the new test file):
After:
The release
testjob, run by hand with Python 3.12 afterpip install -e ".[dev,migrate,docs]" "numpy<2.5":Build,
twine check, and therelease.ymlsmoke script in a new venv with the built wheel:scripts/audit_artifacts.py(the clean-room CI job):CLEANROOM_SMOKE_PASS: pandas and polars (eager and lazy) verified.tests/pytest -m "not online and not large"ruff check .andmypy src/freshdataAny performance impact?
Any compatibility concerns?
The code on main does not change. The release does change behavior for PyPI users: 3.0.0 removes most of the 2.1.0 API. The
[3.0.0]CHANGELOG section lists what goes and points tofreshdata-migrate.Before the tag:
Unreleasedin## [3.0.0] - Unreleasedwith the release date.docs.ymlhas its deploy trigger turned off. This PR does not change that.Documentation updated?
docs/(api-reference.md)CHANGELOG.md