Skip to content

feat(workspace): build an image for a single workspace member - #32

Merged
noirbizarre merged 3 commits into
mainfrom
feat/workspace-members
Aug 1, 2026
Merged

noirbizarre merged 3 commits into
mainfrom
feat/workspace-members

Conversation

@noirbizarre

Copy link
Copy Markdown
Owner

Follow-up to #31, which added workspace support but restricted pdm dockerize to the workspace root.

Running the command from a member, or targeting it with --project, now builds an image for that member only:

$ cd packages/api && pdm dockerize
$ pdm dockerize --project packages/api    # equivalent

The member's own dependencies are installed, including the sibling members it depends on, while the members it does not depend on are left out. Like any dockerized project, the member itself is not installed: its sources are exposed through PYTHONPATH.

The member provides the dependencies, the groups, the scripts, the tool.pdm.dockerize settings and the output directory. The workspace root keeps providing the lock file, the interpreter, the package indexes and the use_uv setting — nothing is inherited in either direction.

Building a single image for the whole workspace, by running the command from the root, is unchanged.

Also fixes an unrelated pre-existing bug: dockerizing a project without any dependency failed with a FileNotFoundError, as the output directory is only created by the installers.

…install

The output directory is only created by the installers, so dockerizing a
project without any dependency to install failed with a `FileNotFoundError`
when writing the entrypoint.
Running `pdm dockerize` from a workspace member, or targeting it with
`--project`, now builds an image for that member only, instead of being
rejected: its own dependencies are installed, including the sibling members
it depends on, and the members it does not depend on are left out.

The member provides the dependencies, the groups, the scripts, the
`tool.pdm.dockerize` settings and the output directory, while the workspace
root keeps providing the lock file, the interpreter, the sources and the
`use_uv` setting.

The environment is deliberately kept rooted at the workspace root: resolving
the interpreter from a member would create a virtualenv inside it, and
expanding `${PROJECT_ROOT}` with its backend would point at paths which do
not exist.
@codecov

codecov Bot commented Aug 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.90%. Comparing base (9e3872d) to head (2bef873).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #32      +/-   ##
==========================================
+ Coverage   94.82%   94.90%   +0.07%     
==========================================
  Files           6        6              
  Lines         464      471       +7     
  Branches       69       69              
==========================================
+ Hits          440      447       +7     
  Misses         21       21              
  Partials        3        3              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@noirbizarre
noirbizarre merged commit 8889daf into main Aug 1, 2026
8 checks passed
@noirbizarre
noirbizarre deleted the feat/workspace-members branch August 1, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant