-
Notifications
You must be signed in to change notification settings - Fork 4.2k
feanil/pyproject toml #37911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feanil/pyproject toml #37911
Conversation
Adds initial pyproject.toml with build system configuration using setuptools>=61.0 (PEP 621 compatible). No functional changes yet - setup.py remains fully functional. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrates package metadata from setup.py including version, dependencies, and package definitions. Changes package name from "Open edX" to "openedx-platform" to comply with PEP 508 (no spaces allowed). This is safe as the package is not published and dependents rely on entry points, not the package name. Simplifies setup.py to contain only entry_points, which will be migrated in subsequent commits. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrates 30 xblock.v1 entry points from setup.py. Removes XBLOCKS constant as it's no longer needed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrates 1 xblock_asides.v1 entry point from setup.py. Removes XBLOCKS_ASIDES constant as it's no longer needed. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrates 19 openedx.course_tab entry points from setup.py. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrates 11 openedx.course_app entry points from setup.py. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrates 4 openedx.course_tool entry points from setup.py. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrates 17 lms.djangoapp entry points from setup.py. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrates 14 cms.djangoapp entry points from setup.py. Preserves important comment explaining why discussion app (from LMS) is imported into Studio process. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrates 17 openedx.block_structure_transformer entry points from setup.py. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrates final 6 entry point groups from setup.py (user_partition_scheme, ace.policy, call_to_action, learning_context, dynamic_partition_generator, console_scripts). Simplifies setup.py to just call setup() with no arguments - all entry points now defined in pyproject.toml. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Migrates pytest configuration from setup.cfg, preserving all settings and comments including warning filters and test discovery patterns. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
ee11757 to
6153d91
Compare
Migrates complete importlinter configuration from setup.cfg, preserving all 4 contracts, ignore_imports with explanatory comments, and GitHub issue references. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Removes setup.py as all configuration has been migrated to pyproject.toml (PEP 621). Verification confirms: - Package installs correctly with pip install -e . - All 142 entry points discoverable via importlib.metadata - All tool configurations (pytest, pycodestyle, isort, importlinter) working - Django checks pass for both LMS and CMS Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
6153d91 to
87302cd
Compare
|
There are quite a few place that still reference |
Update documentation, comments, and docstrings throughout the codebase to reflect the migration from setup.py to pyproject.toml: - Transformer class docstrings: changed to reference "entry point name in the package configuration" for better future-proofing - Block structure module docs: updated to reference pyproject.toml - Test file comments: updated entry point references - Config files (tox.ini, pytest.ini): updated references - Documentation (extension_points.rst, course apps ADRs): updated to reference pyproject.toml with inclusive language for external packages - Requirements documentation (github.in): updated with inclusive language - edxmako README: modernized install command to use pip install Historical ADRs and references to external packages that may still use setup.py were intentionally left unchanged or updated with inclusive language acknowledging both pyproject.toml and setup.py. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Done. |
bmtcril
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, but I think will break Tutor's ability to run openedx-platform mounted (since it seems to explicitly look for setup.py). Given that, I suspect other downstream systems and deployment tools will have similar problems and we should probably make this a DEPR (fast track?) to at least increase visibility and give Tutor maintainers a heads up before merging.
This PR migrates edx-platform to use the modern pyproject.toml settnigs file instead of setup.py and setup.cfg.
Switching to this should help us make other future switches of tools more easily as a lot of the docs and capabilities of the new tools require putting config in a pyproject.toml.
We could have just added the pyproject.toml file without removing/relocating everything else but that seemed like it would just be taking on debt that we don't need to. Instead, with the help of Claude Code, I've migrated all the existing settings to the new file.
This PR is best reviewed on a commit by commit basis as that will make it easier to review the diffs more easily in smaller chunks.
For entrypoint validation, I used this script before and after each commit to verify that the entrypoints did not get screwed up in any of this:
verify_entrypoints.py