feat: pip package deployment mode for python type#16
Merged
Conversation
When `requirement` is set in deploy.yml, the python type skips git cloning and instead creates the instance directory, sets up a venv, and installs the package via `uv pip install`. Update upgrades it with `--upgrade`. `requirement` and `repo_url` are mutually exclusive. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Uses EnvironmentFile=- so the unit starts normally even when .env does not exist. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Accepts either a single string or a YAML list. All values are passed to uv pip install / uv pip install --upgrade in one invocation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
hi @hailangvn I have a vague memory that we decided against 7bf3346 at some point but I can't remember why, do you? |
Collaborator
No, I don't remember that we discuss about it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pythontype now supports deploying directly from a pip package instead of cloning a repo — controlled by therequirementskey indeploy.ymlrequirementsandrepo_urlare mutually exclusive; a list or single string are both acceptedconfigurecreates the instance directory, sets up a venv, and runsuv pip installupdaterunsuv pip install --upgradeinstead of git pullpython.service.j2now includesEnvironmentFile=-<instance_path>/.envso a.envis loaded automatically if presentExample config
Test plan
configurewithrequirements→ creates dir, venv, installs packages, registers systemd unitconfigurewithrepo_url→ existing clone behaviour unchangedconfigurewith bothrequirementsandrepo_url→ errorupdatewithrequirements→ upgrades packages and restarts serviceupdatewithrepo_url→ git pull behaviour unchanged.envwhen present; starts normally when absent🤖 Generated with Claude Code