Dagger
Search

deptry

No long description provided.

Installation

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

Entrypoint

Return Type
Deptry !
Arguments
NameTypeDefault ValueDescription
sourceDirectory -Source directory.
Example
dagger -m github.com/typesafe-ai/daggerverse/deptry@1f7e43729a58bc05edd04cfb88750cacc630f94e 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@1f7e43729a58bc05edd04cfb88750cacc630f94e 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 against each project’s own package source (src or the flat package directory). Projects with neither layout — e.g. a uv workspace root that only aggregates members — are skipped. 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@1f7e43729a58bc05edd04cfb88750cacc630f94e 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@1f7e43729a58bc05edd04cfb88750cacc630f94e 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()
}