Dagger
Search

deptry

No long description provided.

Installation

dagger install github.com/typesafe-ai/daggerverse/deptry@cc47a1e18c3d3199d7249f2a4cc381f8e47c2d78

Entrypoint

Return Type
Deptry !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -Source directory.
Example
dagger -m github.com/typesafe-ai/daggerverse/deptry@cc47a1e18c3d3199d7249f2a4cc381f8e47c2d78 call \
func (m *MyModule) Example() *dagger.Deptry  {
	return dag.
			Deptry()
}
@function
def example() -> dagger.Deptry:
	return (
		dag.deptry()
	)
@func()
example(): Deptry {
	return dag
		.deptry()
}

Types

Deptry 🔗

Linter for Python dependency issues.

deptry checks a single Python project: it reads the declared dependencies (from a pyproject.toml) and scans that project’s source for imports to find unused, missing, misplaced or transitive dependencies. The check function runs it once per project across the whole source tree, so a single Dagger check covers a monorepo.

Learn more about deptry at https://deptry.com.

source() 🔗

Return Type
Directory !
Example
dagger -m github.com/typesafe-ai/daggerverse/deptry@cc47a1e18c3d3199d7249f2a4cc381f8e47c2d78 call \
 source
func (m *MyModule) Example() *dagger.Directory  {
	return dag.
			Deptry().
			Source()
}
@function
def example() -> dagger.Directory:
	return (
		dag.deptry()
		.source()
	)
@func()
example(): Directory {
	return dag
		.deptry()
		.source()
}

check() 🔗

Run deptry for every Python project in the source tree, in parallel.

Discovers projects by scanning for pyproject.toml files that declare dependencies and runs deptry . in each. A project with no package of its own — e.g. a uv workspace root that only aggregates members in subdirectories — is skipped (so the scan never spills over the rest of the monorepo) unless it declares a [tool.deptry] section, which opts it in explicitly. Exits non-zero when any (non-excluded) project reports dependency issues.

Return Type
Void !
Arguments
NameTypeDefault ValueDescription
versionString !"0.25.1"

deptry version to use (ignored when ctr is set).

ctrContainer null

Container with deptry installed. Defaults to the official ghcr.io/astral-sh/uv image with deptry installed as a uv tool. Overrides version.

args[String ! ] null

Additional arguments to pass to deptry (added before the project root).

exclude[String ! ] null

Glob patterns (source-relative) of project paths to skip, e.g. **/tests/_packages/**.

Example
dagger -m github.com/typesafe-ai/daggerverse/deptry@cc47a1e18c3d3199d7249f2a4cc381f8e47c2d78 call \
 check --version string
func (m *MyModule) Example(ctx context.Context, version string)   {
	return dag.
			Deptry().
			Check(ctx, version)
}
@function
async def example(version: str) -> None:
	return await (
		dag.deptry()
		.check(version)
	)
@func()
async example(version: string): Promise<void> {
	return dag
		.deptry()
		.check(version)
}

projects() 🔗

Every checkable Python project in the source tree.

One entry per pyproject.toml that declares dependencies (see _project_info).

Return Type
[String ! ] !
Example
dagger -m github.com/typesafe-ai/daggerverse/deptry@cc47a1e18c3d3199d7249f2a4cc381f8e47c2d78 call \
 projects
func (m *MyModule) Example(ctx context.Context) []string  {
	return dag.
			Deptry().
			Projects(ctx)
}
@function
async def example() -> List[str]:
	return await (
		dag.deptry()
		.projects()
	)
@func()
async example(): Promise<string[]> {
	return dag
		.deptry()
		.projects()
}