Metadata-Version: 2.4
Name: portus-py
Version: 0.1.0
Summary: Docker scaffolding for Python projects. Scans your project and generates a production-ready Dockerfile, .dockerignore, and docker-compose.yaml.
Project-URL: Repository, https://github.com/ucancallmenoy/portus-py
Project-URL: Homepage, https://github.com/ucancallmenoy/portus-py
Project-URL: Issues, https://github.com/ucancallmenoy/portus-py/issues
Author: Patrick Perez
License: MIT License
        
        Copyright (c) 2026 Patrick Perez
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: cli,devops,django,docker,dockerfile,fastapi,flask,python,scaffolding
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.9
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.0.0
Requires-Dist: tomli>=2.0.0; python_version < '3.11'
Requires-Dist: typer>=0.12.0
Description-Content-Type: text/markdown

# portus-py

Docker scaffolding for Python projects. Scans your project and generates a production-ready `Dockerfile`, `.dockerignore`, and `docker-compose.yaml` tailored to what it finds.

For Node.js projects, see [Portus](https://www.npmjs.com/package/portus) instead — the original, npm-published version of this tool.

## Requirements

Python 3.9 or later to run portus-py itself. Docker is required separately to build and run the generated `Dockerfile` and `docker-compose.yaml`.

## Installation

```bash
pip install portus-py
```

## Usage

Preview what portus-py detects without writing any files:

```bash
portus-py scan
```

Generate Docker configuration for the current project:

```bash
portus-py init
```

This scans the repository, prints what was detected, and writes a `Dockerfile`, `.dockerignore`, and `docker-compose.yaml`. If any of these files already exist, you will be prompted before they are overwritten.

Skip overwrite prompts:

```bash
portus-py init --yes
```

## What gets detected

- **Package manager** — resolved from lockfiles, in priority order: `poetry.lock`, `pdm.lock`, `uv.lock`, `Pipfile.lock`, `requirements.txt`, defaulting to plain `pip` if none are found.
- **Python version** — resolved from `pyproject.toml` (`requires-python` or Poetry's `python` dependency), then `.python-version`, then `runtime.txt`, defaulting to 3.12.
- **Framework** — Django, FastAPI, and Flask (all treated as web services), and Celery (treated as a background worker with no HTTP port or healthcheck).

## Framework support

For Django, FastAPI, and Flask, portus-py inspects the actual entry-point file (`manage.py`, `main.py`, `app.py`) to determine the correct module path for the generated `CMD`, rather than guessing. When it can't confirm the app instance with high confidence, it still generates a best-effort `CMD` but prints a warning explaining the assumption made, so nothing fails silently.

Dockerfiles are single-stage for now — Python's packaging story doesn't lend itself to the same clean multi-stage optimization Node projects get, so this keeps the generated output simple and correct rather than fragile.

## License

MIT