Proposal: Enhancing Type Coverage in the Django CMS Project #8119
vinitkumar
started this conversation in
General
Replies: 2 comments
-
|
Please give your opinions: @fsbraun @marksweb @macolo @jrief @mj8arrett |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
This sounds to me like a great idea and a great plan 👍🏼 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Background and Motivation
As Django CMS continues to grow in complexity and adoption, ensuring code quality, maintainability, and developer experience is crucial. Typing in Python has proven to be an invaluable tool for achieving these goals, as it:
The Django ecosystem has benefited greatly from
django-stubs, an external typing package that enriches Django projects without intrusive modifications to the core. This proposal suggests adopting a similar strategy for Django CMS to increase type coverage and improve code quality.Objectives
django-cms-stubspackage: Provide type annotations for Django CMS without modifying the core codebase, following the example ofdjango-stubs.mypyto enforce type correctness in the project.Proposal Details
1. Creating
django-cms-stubsKey Deliverables:
django-cms-stubspackage with coverage for core modules such as CMS pages, plugins, templates, and permissions.2. Incremental Typing in Core Code
Key Deliverables:
3. CI Integration for Static Type Checking
mypyas a mandatory step in the CI pipeline to ensure type correctness.mypyto work seamlessly with thedjango-cms-stubspackage and the Django CMS core.Key Deliverables:
Implementation Plan
Phase 1: Research and Planning (TBD)
django-stubsto understand its structure and implementation.django-cms-stubsand incrementally typing the core.Phase 2: Initial Development (TBD)
django-cms-stubspackage with type annotations for key modules.mypyin the CI pipeline with initial configuration.Phase 3: Community Engagement and Rollout (TBD)
django-cms-stubspackage to the Django CMS community.Phase 4: Scaling and Maintenance (TBD)
Benefits to Django CMS
Conclusion
Adopting a typing strategy for Django CMS is a forward-thinking step that aligns with industry best practices. By creating an external
django-cms-stubspackage, mandating type annotations for new code, and integrating static type checking into CI, we can enhance the quality and maintainability of the project without disrupting existing workflows. This approach ensures a smooth transition while maximizing the benefits of typing.Beta Was this translation helpful? Give feedback.
All reactions