Skip to content

feat: pip package deployment mode for python type#16

Merged
hailangvn merged 3 commits intomainfrom
feat/python-package-deploy
Apr 16, 2026
Merged

feat: pip package deployment mode for python type#16
hailangvn merged 3 commits intomainfrom
feat/python-package-deploy

Conversation

@nilshamerlinck
Copy link
Copy Markdown
Contributor

Summary

  • python type now supports deploying directly from a pip package instead of cloning a repo — controlled by the requirements key in deploy.yml
  • requirements and repo_url are mutually exclusive; a list or single string are both accepted
  • configure creates the instance directory, sets up a venv, and runs uv pip install
  • update runs uv pip install --upgrade instead of git pull
  • python.service.j2 now includes EnvironmentFile=-<instance_path>/.env so a .env is loaded automatically if present

Example config

service-myapp-production:
  type: python
  ssh_host: myserver.example.com
  requirements:
    - "myapp==1.2.3"
    - "some-dep>=2.0"
  exec_start: "myapp serve"

Test plan

  • configure with requirements → creates dir, venv, installs packages, registers systemd unit
  • configure with repo_url → existing clone behaviour unchanged
  • configure with both requirements and repo_url → error
  • update with requirements → upgrades packages and restarts service
  • update with repo_url → git pull behaviour unchanged
  • Service picks up .env when present; starts normally when absent

🤖 Generated with Claude Code

nilshamerlinck and others added 3 commits April 16, 2026 11:41
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>
@nilshamerlinck
Copy link
Copy Markdown
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?

Copy link
Copy Markdown
Collaborator

@hailangvn hailangvn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thank you.

@hailangvn hailangvn merged commit 722b610 into main Apr 16, 2026
5 checks passed
@hailangvn hailangvn deleted the feat/python-package-deploy branch April 16, 2026 09:11
@hailangvn hailangvn restored the feat/python-package-deploy branch April 16, 2026 09:11
@hailangvn
Copy link
Copy Markdown
Collaborator

hi @hailangvn I have a vague memory that we decided against 7bf3346 at some point but I can't remember why, do you?

No, I don't remember that we discuss about it.

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.

2 participants