diff --git a/docs/notes/2.26.x.md b/docs/notes/2.26.x.md index 74d80c1d25a..3f742af9643 100644 --- a/docs/notes/2.26.x.md +++ b/docs/notes/2.26.x.md @@ -82,6 +82,8 @@ The Pants repo now uses Ruff format in lieu of Black. This was not a drop-in rep `@rule` decorators have been re-typed, which should allow better call site return-type visibility (fewer `Unknown`s and `Any`s). Decorator factories of the form `@rule(desc=..., level=..., ...)` have also been strongly typed. This may cause typechecking errors for plugin authors, if the plugin is using incorrect types. However, this likely would have manifested as a runtime crash, otherwise. +A bug in the Django backend has been fixed so that a repo may have no Django apps without error. + [Pytype](https://www.pantsbuild.org/stable/reference/subsystems/pytype) was updated to version 2024.9.13 - which is the [last to support Python 3.8 and Python 3.9](https://github.com/google/pytype/blob/main/CHANGELOG). #### Shell diff --git a/src/python/pants/backend/python/framework/django/detect_apps.py b/src/python/pants/backend/python/framework/django/detect_apps.py index b90149a4cec..3a536c54f31 100644 --- a/src/python/pants/backend/python/framework/django/detect_apps.py +++ b/src/python/pants/backend/python/framework/django/detect_apps.py @@ -11,6 +11,7 @@ from pants.backend.python.target_types import InterpreterConstraintsField from pants.backend.python.util_rules.interpreter_constraints import InterpreterConstraints from pants.backend.python.util_rules.pex_environment import PythonExecutable +from pants.base.glob_match_error_behavior import GlobMatchErrorBehavior from pants.base.specs import FileGlobSpec, RawSpecs from pants.engine.fs import AddPrefix, CreateDigest, Digest, FileContent, MergeDigests from pants.engine.internals.selectors import Get, MultiGet @@ -88,7 +89,9 @@ async def detect_django_apps(python_setup: PythonSetup) -> DjangoApps: Targets, RawSpecs, RawSpecs.create( - specs=[FileGlobSpec("**/apps.py")], description_of_origin="Django app detection" + specs=[FileGlobSpec("**/apps.py")], + description_of_origin="Django app detection", + unmatched_glob_behavior=GlobMatchErrorBehavior.ignore, ), ) if not targets: