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-stubs
package: Provide type annotations for Django CMS without modifying the core codebase, following the example ofdjango-stubs
.mypy
to enforce type correctness in the project.Proposal Details
1. Creating
django-cms-stubs
Key Deliverables:
django-cms-stubs
package 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
mypy
as a mandatory step in the CI pipeline to ensure type correctness.mypy
to work seamlessly with thedjango-cms-stubs
package and the Django CMS core.Key Deliverables:
Implementation Plan
Phase 1: Research and Planning (TBD)
django-stubs
to understand its structure and implementation.django-cms-stubs
and incrementally typing the core.Phase 2: Initial Development (TBD)
django-cms-stubs
package with type annotations for key modules.mypy
in the CI pipeline with initial configuration.Phase 3: Community Engagement and Rollout (TBD)
django-cms-stubs
package 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-stubs
package, 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