Skip to content

Migrate build system from setuptools to hatchling - #12

Merged
septatrix merged 1 commit into
masterfrom
claude/optimistic-heisenberg-ds8xsx
Oct 3, 2026
Merged

septatrix merged 1 commit into
masterfrom
claude/optimistic-heisenberg-ds8xsx

Conversation

@septatrix

Copy link
Copy Markdown
Owner

Summary

This PR migrates the project's build system from setuptools to hatchling, a modern Python build backend that provides better performance and simpler configuration.

Key Changes

  • Build backend: Switched from setuptools.build_meta to hatchling.build
  • Build dependencies: Updated from setuptools>=77 to hatchling>=1.27 and hatch-vcs
  • Version management: Changed from static version in pyproject.toml to dynamic versioning via hatch-vcs (version control system integration)
  • Package configuration: Replaced setuptools-specific package discovery and metadata configuration with hatchling equivalents:
    • Removed [tool.setuptools.packages.find] section
    • Removed [tool.setuptools.package-data] section
    • Added [tool.hatch.version] with VCS source
    • Added [tool.hatch.build.targets.wheel] with explicit package list

Implementation Details

  • The project now uses VCS (git) tags for version management instead of maintaining a static version string
  • Package discovery is now explicit (packages = ["moodle"]) rather than pattern-based
  • The py.typed marker file handling is now managed by hatchling's default behavior

https://claude.ai/code/session_01FRuhWudxE4Xsp7CWh1qv85

Replace the setuptools build backend with hatchling and hatch-vcs
so the package version no longer has to be bumped by hand
and cannot drift from the release tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FRuhWudxE4Xsp7CWh1qv85
@septatrix

Copy link
Copy Markdown
Owner Author

The test (3.13) failure is not caused by this PR.
Only the AsyncLoginTest.test_login subtest against the public demo site https://sandbox.moodledemo.net/ failed:
its lib/ajax/service.php endpoint returned a non-JSON response (JSONDecodeError at char 0).
The job ran at 00:01 UTC, right after the hourly reset of the sandbox site,
and the same test passed against the same site on 3.11, 3.12 and 3.14 in the same run.
I have re-run the failed job.


Generated by Claude Code

@septatrix
septatrix merged commit 977c09f into master Oct 3, 2026
9 of 10 checks passed
@septatrix
septatrix deleted the claude/optimistic-heisenberg-ds8xsx branch October 3, 2026 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants