Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 63 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,69 @@ This template equips you with the essentials for creating, testing, and packagin

You have the freedom to structure your `src/` and `tests/` directories according to your preferences. Alternatively, you can draw inspiration from the structure used in the [MLOps Python Package](https://github.com/fmind/mlops-python-package) project for a ready-made implementation.

## Quick Start

1. **Generate your project:**

```bash
# With uv:
uv tool install cookiecutter
# With pip:
# pip install cookiecutter
cookiecutter gh:irod973/python-project-template
```

You'll be prompted for the following variables.

- `user`: Your GitHub username.
- `name`: The name of your project.
- `repository`: The name of your GitHub repository.
- `package`: The name of your Python package.
- `license`: The license for your project (Note: use "NA" until we define a standard licence or omit entirely)
- `version`: The initial version of your project.
- `description`: A brief description of your project.
- `python_version`: The Python version to use (e.g., 3.12).
- `include_fastapi`: Whether to include a sample FastAPI application.
- `include_metaflow`: Whether to include a sample Metaflow application.
- `include_torchvision`: Whether to include a sample Torchvision application.
- `include_package`: Whether to include a sample application for publishing a Python package.

2. **Initialize a git repository:**

```bash
cd {{ cookiecutter.repository }}
git init
# Create remote repo
gh repo create
# Then make first push:
git checkout -b feature/initial-setup
git add .
git commit -m "Initial commit"
git push -u origin feature/initial-setup
```

3. **Explore the generated project:**

- `src/{{cookiecutter.package}}`: Your Python package source code.
- `tests/`: Unit tests for your package.
- `tasks/`: `just` commands for automation.
- `docker/Dockerfile.python`: Configuration for building your Docker image.
- `docker-compose.yml`: Orchestration file for running your project.

4. **Start developing!**

Use the provided `just` commands to manage your development workflow:

- `uv run just check`: Run code quality, type, security, and test checks.
- `uv run just clean`: Clean up generated files.
- `uv run just commit`: Commit changes to your repository.
- `uv run just doc`: Generate API documentation.
- `uv run just docker`: Build and run your Docker image.
- `uv run just format`: Format your code with Ruff.
- `uv run just install`: Install dependencies, pre-commit hooks, and GitHub rulesets.
- `uv run just package`: Build your Python package.
- `uv run just project`: Run the project in the CLI.

## Applications

This template includes a few optional application skeletons. See the nested README for details.
Expand Down Expand Up @@ -88,68 +151,6 @@ The sync tool will:
- A commit is automatically created with all synced changes
- Use `--dry-run` to preview changes before committing

## Quick Start

1. **Generate your project:**

```bash
# With uv:
uv tool install cookiecutter
# With pip:
# pip install cookiecutter
cookiecutter gh:irod973/python-project-template
```

You'll be prompted for the following variables.

- `user`: Your GitHub username.
- `name`: The name of your project.
- `repository`: The name of your GitHub repository.
- `package`: The name of your Python package.
- `license`: The license for your project (Note: use "NA" until we define a standard licence or omit entirely)
- `version`: The initial version of your project.
- `description`: A brief description of your project.
- `python_version`: The Python version to use (e.g., 3.12).
- `include_fastapi`: Whether to include a sample FastAPI application.
- `include_metaflow`: Whether to include a sample Metaflow application.
- `include_torchvision`: Whether to include a sample Torchvision application.
- `include_package`: Whether to include a sample application for publishing a Python package.

2. **Initialize a git repository:**

```bash
cd {{ cookiecutter.repository }}
git init
# Should also create remote repo, e.g. via Github web console
# Then make first push e.g.
# git add .
# git commit -m "Initial commit"
# git remote add origin https://github.com/irod973/{{myproject}}.git
# git push -u origin main
```

3. **Explore the generated project:**

- `src/{{cookiecutter.package}}`: Your Python package source code.
- `tests/`: Unit tests for your package.
- `tasks/`: `just` commands for automation.
- `docker/Dockerfile.python`: Configuration for building your Docker image.
- `docker-compose.yml`: Orchestration file for running your project.

4. **Start developing!**

Use the provided `just` commands to manage your development workflow:

- `uv run just check`: Run code quality, type, security, and test checks.
- `uv run just clean`: Clean up generated files.
- `uv run just commit`: Commit changes to your repository.
- `uv run just doc`: Generate API documentation.
- `uv run just docker`: Build and run your Docker image.
- `uv run just format`: Format your code with Ruff.
- `uv run just install`: Install dependencies, pre-commit hooks, and GitHub rulesets.
- `uv run just package`: Build your Python package.
- `uv run just project`: Run the project in the CLI.

## License

The source material this is adapted from is licensed under the [MIT License](https://opensource.org/license/mit). See the [`LICENSE.txt`](https://github.com/fmind/cookiecutter-mlops-package/blob/main/LICENSE.txt) file for details.