Scaffolding a project
warning
This feature is considered in a preview stage and is under active development. It can change significantly, or be removed completely. It is not considered ready for production use.
A Dagster code
location
is a deployable collection of Dagster definitions. Code locations are defined
in a Python package. dg
provides support for scaffolding a special type of
Python package, called a project, that defines a code location.
Scaffolding a project is very simple:
dg scaffold project my-project
Creating a Dagster project at /.../my-project.
Scaffolded files for Dagster project at /.../my-project.
...
This will generate a new directory called my-project
. This is a standard
python package structure with some extra details:
tree
.
└── my-project
├── my_project
│ ├── __init__.py
│ ├── definitions.py
│ ├── defs
│ │ └── __init__.py
│ └── lib
│ └── __init__.py
├── my_project_tests
│ └── __init__.py
├── pyproject.toml
└── uv.lock
6 directories, 7 files
- The top-level package
my_project
contains the deployable code that defines your Dagster pipelines. my_project/defs
is where your Dagster definitions will go.my_project/lib
is where you will define custom component types, and optionally other code you wish to share across Dagster definitions.my_project/definitions.py
is the entry point that Dagster will load when deploying your code location. It is set up to load all definitions frommy_project/defs
. You should not need to modify this file.my_project_tests
contains tests for the code inmy_project
.pyproject.toml
is a standard Python package configuration file. In addition to the regular Python package metadata, it contains atool.dg
section fordg
-specific settings.uv.lock
is the lockfile for Python package manageruv
.dg
projects useuv
by default.