Metadata-Version: 2.5
Name: youca-setup
Version: 0.1.1
Summary: One command to scaffold, run and manage Odoo development environments (Docker + PostgreSQL).
Project-URL: Homepage, https://github.com/Fitiafenohaja/youca-setup
Project-URL: Repository, https://github.com/Fitiafenohaja/youca-setup
Project-URL: Source, https://github.com/Fitiafenohaja/youca-setup
Project-URL: Documentation, https://github.com/Fitiafenohaja/youca-setup/blob/main/docs/index.md
Project-URL: Changelog, https://github.com/Fitiafenohaja/youca-setup/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/Fitiafenohaja/youca-setup/issues
Author: Youca Setup contributors
License-Expression: MIT
License-File: LICENSE
Keywords: automation,cli,developer-tools,development-environment,docker,docker-compose,odoo,postgres,postgresql,scaffold,templating
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
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 :: Build Tools
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Systems Administration
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: docker>=7.0
Requires-Dist: jinja2>=3.1
Requires-Dist: psutil>=5.9
Requires-Dist: psycopg[binary]>=3.1
Requires-Dist: pydantic>=2.6
Requires-Dist: python-dotenv>=1.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.7
Requires-Dist: typer>=0.12
Provides-Extra: dev
Requires-Dist: mypy>=1.9; extra == 'dev'
Requires-Dist: pre-commit>=3.6; extra == 'dev'
Requires-Dist: pytest-cov>=4.1; extra == 'dev'
Requires-Dist: pytest-mock>=3.12; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Requires-Dist: testcontainers>=4.0; extra == 'dev'
Requires-Dist: types-pyyaml>=6.0; extra == 'dev'
Description-Content-Type: text/markdown

# Youca Setup for Odoo

[![CI](https://github.com/Fitiafenohaja/youca-setup/actions/workflows/ci.yml/badge.svg)](https://github.com/Fitiafenohaja/youca-setup/actions/workflows/ci.yml)
[![PyPI version](https://img.shields.io/pypi/v/youca-setup.svg)](https://pypi.org/project/youca-setup/)
[![Python versions](https://img.shields.io/pypi/pyversions/youca-setup.svg)](https://pypi.org/project/youca-setup/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**Youca Setup for Odoo** is a command-line tool that creates, configures and
manages **Odoo development environments**. Backed by Docker and PostgreSQL, it
turns a blank machine into a working Odoo project in one command — and keeps
the day-to-day workflow (`start`, `status`, `logs`, `shell`, `backup`,
`export`, …) in a single, consistent interface.

It is a thin orchestration layer over proven tools: you keep full control of
your toolchain, while the repetitive setup is fully automated.

- **Scaffold** a complete project: `docker-compose.yml`, `odoo.conf`, `.env`,
  addons directories, git repository, validated `youca-setup.yaml` config.
- **Manage** the lifecycle with Docker Compose: `start`, `stop`, `restart`,
  `status`, `logs`.
- **Develop**: scaffold Odoo modules (`module create`), open interactive
  shells (`shell`), diagnose the environment (`doctor`).
- **Protect data**: timestamps backups and restores of database + filestore +
  configuration (`backup` / `restore`).
- **Move around**: portable environment snapshots (`export` / `import`) and
  multi-project management (`projects`, `info`, `remove`).

## Features

- `youca-setup init` — full project scaffold with sensible defaults; pick the
  Odoo and PostgreSQL majors (`--odoo-version`, `--postgres-version`), the
  PostgreSQL backend (`docker` or `system`), extra addons directories
  (`--addons`), a custom Jinja2 template directory (`--template`) and git
  initialisation (on by default, `--no-git`). Interactive and fully scriptable
  (`--no-interactive`) modes.
- `youca-setup start` / `stop` / `restart` — environment lifecycle via Docker
  Compose, with automatic handling of an occupied HTTP port.
- `youca-setup status` — running state, ports and health at a glance
  (`--verbose` for details).
- `youca-setup logs` — container logs without touching Docker directly.
- `youca-setup shell` — interactive shell (`/bin/bash`) or database console
  (`psql` with credentials from `.env`) inside a container.
- `youca-setup doctor` — diagnose Python, Docker, PostgreSQL, ports and
  configuration; `--fix` applies corrections (destructive ones confirm).
- `youca-setup module create` — scaffold Odoo addon modules, optionally with a
  full model skeleton (`--model`).
- `youca-setup backup` / `restore` — database + filestore + configuration
  archives, restored with mandatory confirmation (`--yes` to force).
- `youca-setup export` / `import` — portable environment snapshots
  (config + `.env` + addons), sharing secrets with your team.
- `youca-setup info` / `projects` / `remove` — inspect, list or unregister
  known projects.

## Requirements

- Python 3.10+
- [Docker Engine](https://docs.docker.com/engine/install/) with Docker
  Compose v2 (for the `docker` PostgreSQL backend)
- [PostgreSQL](https://www.postgresql.org/download/) 14+ (only for the
  `system` PostgreSQL backend)

## Installation

```bash
pip install youca-setup
```

or with [`uv`](https://docs.astral.sh/uv/):

```bash
uv tool install youca-setup
```

## Quick start

```bash
# Create a project (Odoo 18, PostgreSQL 16, a custom addons directory)
youca-setup init school --odoo-version 18 --postgres-version 16 --postgres docker --addons custom-addons

# Run the environment
cd school
youca-setup start        # → http://localhost:8069

# Scaffold a module with a base model
youca-setup module create school_management --model student

# Check that everything is healthy
youca-setup doctor
```

The generated project looks like this:

```
school/
├── youca-setup.yaml          # validated project configuration
├── .env                 # local secrets (gitignored by default)
├── .gitignore
├── README.md
├── docker-compose.yml   # Odoo + PostgreSQL services
├── config/odoo.conf     # server configuration
├── addons/              # default addons mount
├── custom-addons/       # one directory per `--addons` entry
├── data/                # scratch data
└── backups/             # backup archives
```

## Commands

| Command | Purpose |
|---|---|
| `youca-setup init` | Create a new Odoo project (interactive or scripted) |
| `youca-setup start` | Start the environment via Docker Compose |
| `youca-setup stop` | Stop the environment |
| `youca-setup restart` | Restart the environment |
| `youca-setup status` | Show service state and host ports |
| `youca-setup logs` | Show service logs |
| `youca-setup info` | Show details of the current project |
| `youca-setup projects` | List all known projects |
| `youca-setup remove` | Unregister (and optionally delete) a project |
| `youca-setup doctor` | Diagnose and (optionally) fix the environment |
| `youca-setup module create` | Scaffold an Odoo addon module |
| `youca-setup backup` | Create a database + filestore + config archive |
| `youca-setup restore` | Restore from a backup archive |
| `youca-setup shell` | Open an interactive shell in a container |
| `youca-setup export` | Export the environment to a portable `.tar.gz` |
| `youca-setup import` | Import an environment archive into a new project |

## Documentation

- [Full documentation (user + developer guides)](docs/index.md)
- [Release notes](CHANGELOG.md)
- [Issues and support](https://github.com/Fitiafenohaja/youca-setup/issues)

## Development

```bash
pip install -e ".[dev]"
pre-commit install
ruff check .
mypy src/youca_setup
pytest
```

The test suite is split into fast unit tests (mocked Docker and psycopg, no
network) and integration tests (marked `integration`, require a running Docker
daemon):

```bash
pytest -m "not integration"   # unit tests only
pytest -m integration         # real Docker
```

## License

Distributed under the [MIT License](LICENSE).