Skip to content

Commit

Permalink
Allow there to be no Django apps. (#22005)
Browse files Browse the repository at this point in the history
The code clearly intended this, due to the early
return check, but the glob did not admit a non-match.
  • Loading branch information
benjyw authored Feb 26, 2025
1 parent bdecc47 commit 5e7123a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/notes/2.26.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 5e7123a

Please sign in to comment.