Modernize packaging, tooling and drop Python 2 support#43
Open
jotelha wants to merge 1 commit into
Open
Conversation
Re-applies the PR #43 modernization on top of the current master, which has since adopted the flit_scm build system (PR #42). Keeps flit; layers on the source/tooling cleanups that master does not yet have. Bugs: - write_config_value_to_file set 0o700 permissions despite documenting 0o600; now sets 0o600 via stat constants - migrate deprecated datetime.utcnow()/utcfromtimestamp() (including the new freeze_with_manifest code) to timezone-aware equivalents; utils.timestamp() treats naive datetimes as UTC and accepts aware ones Removals: - Python 2 import shims (urlparse, importlib_metadata fallbacks) - redundant requirements.txt (tox.ini no longer references it) Tooling: - replace flake8 with ruff (config in pyproject, lint extra, .pre-commit-config.yaml); rewrite raise(Error()) -> raise Error() throughout, including the raise() added by PR #42 - update tox (py39..py314, lint) and the GitHub Actions workflow (ruff step, .[test,lint] install) - super(Cls, self) -> super(); drop (object) base classes - refresh README supported-versions, CHANGELOG, .gitignore; add CLAUDE.md Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b084b4b to
8cfe782
Compare
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.
Summary
Drops Python 2 / legacy compatibility shims, modernizes packaging metadata, switches linting from flake8 to ruff, and fixes a few latent bugs surfaced along the way. All six CI matrix versions (3.8–3.13) pass tests + lint; this was validated locally with
actand a successfulpython -m build.Bugs fixed
pyproject.tomllicensereferenced a nonexistentLICENSEfile (the file isLICENSE.rst), which could break source builds / metadata. Now bundled correctly into built artifacts.write_config_value_to_fileset0o700permissions (the magic int33216) despite documenting "600 permissions"; now sets0o600viastatconstants.datetime.utcnow()/datetime.utcfromtimestamp()to timezone-aware equivalents.utils.timestamp()now treats naive datetimes as UTC and accepts timezone-aware datetimes (behavior preserved).Removals
urlparse,importlib_metadata,pkg_resourcesfallbacks).setuptools— version discovery now uses stdlibimportlib.metadata, restoring the dependency-free promise..travis.yml,appveyor.yml), redundantrequirements.txtandsetup.cfg.Tooling / packaging
requires-python = ">=3.8"; moved pytest config intopyproject.toml.pyproject.toml,lintoptional-deps group,.pre-commit-config.yaml); rewrote 40×raise(Error())→raise Error().tox.ini(py38–py313, lint) and the GitHub Actions test workflow (ruff step,.[test,lint]install).[Unreleased]),.gitignore, andCLAUDE.md.Notes
CLAUDE.md(repo guidance file); happy to drop it if out of scope.py.typedwere intentionally left for a separate, focused PR.🤖 Generated with Claude Code