Skip to content
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

Install Django and DRF stubs with compatible-mypy extra (as per offical recommendation) #4361

Merged

Conversation

browniebroke
Copy link
Member

@browniebroke browniebroke commented May 30, 2023

Description

Django stubs and DRF stubs are by default leting us install any version of mypy as long as it's not too old. The version restriction can be made more constrained with an extra require specifier.

Checklist:

  • I've made sure that tests are updated accordingly (especially if adding or updating a template option)
  • I've updated the documentation or confirm that my change doesn't require any updates

Rationale

This might make upgrades more annoying, with the tradeoff that we're more sure to install a compatible version. Overpinning has its drawbacks, especially when the project isn't updated in a timely manner, but these 2 projects are well maintained (at least now). These are optional and could be easily reverted if it's adding too much friction.

@browniebroke browniebroke force-pushed the django-stubs-mypy-compat branch from 0f4f10c to 8a70499 Compare May 30, 2023 15:07
@mpsantos
Copy link
Contributor

This will break with mypy 1.3.0 (#4327)

@browniebroke
Copy link
Member Author

Correct, and that's actually the point. Right now, our build doesn't fail and we might ship with a version of mypy which is incompatible with django-stubs. Incompatibilities wouldn't show up on the vanilla project that we generate, but that doesn't mean that a project generated with Cookiecutter Django won't be impacted shortly after, when features start to be added to it.

# Conflicts:
#	{{cookiecutter.project_slug}}/requirements/local.txt
# Conflicts:
#	{{cookiecutter.project_slug}}/requirements/local.txt
@browniebroke browniebroke changed the title Be stricter with mypy compatibility in Django and DRF stubs Install Django and DRF stubs with mypy compat extra (as per offical recommendation) Aug 14, 2023
@browniebroke browniebroke changed the title Install Django and DRF stubs with mypy compat extra (as per offical recommendation) Install Django and DRF stubs with compatible-mypy extra (as per offical recommendation) Aug 14, 2023
@browniebroke browniebroke merged commit 4e9f9af into cookiecutter:master Aug 14, 2023
@browniebroke browniebroke deleted the django-stubs-mypy-compat branch August 14, 2023 10:59
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