Skip to content
Open
Show file tree
Hide file tree
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
54 changes: 54 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Python cache files
__pycache__/
*.py[cod]
*$py.class
*.so
.Python

# Virtual environments
.venv/
venv/
ENV/
env/

# Testing
.pytest_cache/
.coverage
htmlcov/
.tox/

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# Git
.git/
.gitignore
.gitattributes

# CI/CD
.github/

# Documentation
*.md
docs/

# Build artifacts
build/
dist/
*.egg-info/

# Linting
.ruff_cache/
.mypy_cache/

# Pre-commit
.pre-commit-config.yaml

# Other
Makefile
TODO.md
LICENSE
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@mrhallak
52 changes: 44 additions & 8 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,52 @@
version: 2

updates:
- package-ecosystem: pip
# Enable version updates for pip (Python dependencies)
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: weekly
interval: "weekly"
day: "monday"
open-pull-requests-limit: 10
reviewers:
- "mrhallak"
allow:
- dependency-type: direct
labels:
- "dependencies"
- "python"
commit-message:
prefix: "deps"
prefix-development: "deps(dev)"
groups:
# Group all development dependencies together
dev-dependencies:
dependency-type: "development"
update-types:
- "minor"
- "patch"
# Optionally group production dependencies
production-dependencies:
dependency-type: "production"
update-types:
- "minor"
- "patch"

# Optional: Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
labels:
- "dependencies"
- "github-actions"
commit-message:
prefix: "ci"

# Enable version updates for Docker
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: weekly
interval: "weekly"
day: "monday"
labels:
- "dependencies"
- "docker"
commit-message:
prefix: "docker"
26 changes: 0 additions & 26 deletions .github/workflows/cicd.yml

This file was deleted.

88 changes: 71 additions & 17 deletions {{ cookiecutter.project_slug }}/.gitignore → .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*.py[codz]
*$py.class

# C extensions
Expand All @@ -27,8 +27,8 @@ share/python-wheels/
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

Expand All @@ -46,7 +46,7 @@ htmlcov/
nosetests.xml
coverage.xml
*.cover
*.py,cover
*.py.cover
.hypothesis/
.pytest_cache/
cover/
Expand Down Expand Up @@ -92,22 +92,37 @@ ipython_config.py
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# Pipfile.lock

# UV
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# uv.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# poetry.lock
# poetry.toml

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
# https://pdm-project.org/en/latest/usage/project/#working-with-version-control
# pdm.lock
# pdm.toml
.pdm-python
.pdm-build/

# pixi
# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
# pixi.lock
# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
# in the .venv directory. It is recommended not to include this directory in version control.
.pixi

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
Expand All @@ -116,11 +131,25 @@ __pypackages__/
celerybeat-schedule
celerybeat.pid

# Redis
*.rdb
*.aof
*.pid

# RabbitMQ
mnesia/
rabbitmq/
rabbitmq-data/

# ActiveMQ
activemq-data/

# SageMath parsed files
*.sage.py

# Environments
.env
.envrc
.venv
env/
venv/
Expand Down Expand Up @@ -153,10 +182,35 @@ dmypy.json
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
# .idea/

# Abstra
# Abstra is an AI-powered process automation framework.
# Ignore directories containing user credentials, local state, and settings.
# Learn more at https://abstra.io/docs
.abstra/

# Visual Studio Code
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
# and can be added to the global gitignore or merged into this file. However, if you prefer,
# you could uncomment the following to ignore the entire vscode folder
# .vscode/

# Ruff stuff:
.ruff_cache/

# PyPI configuration file
.pypirc

# Marimo
marimo/_static/
marimo/_lsp/
__marimo__/

# Streamlit
.streamlit/secrets.toml
22 changes: 21 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.14.3
hooks:
# Run the linter.
- id: ruff-check
types_or: [python, pyi]
args: [--fix, --config=pyproject.toml]
# Run the formatter.
- id: ruff-format
types_or: [python, pyi]
args: [--config=pyproject.toml]

- repo: https://github.com/astral-sh/uv-pre-commit
# uv version.
rev: 0.9.7
hooks:
# Update the uv lockfile
- id: uv-lock
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
rev: "v6.0.0"
hooks:
- id: check-case-conflict
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Use the slimmest official Python 3.13 image
FROM python:3.13-slim-bookworm AS base

# Set working directory
WORKDIR /app

# Install uv (fast Python package installer)
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

# Set environment variables for Python
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
UV_SYSTEM_PYTHON=1

# Copy only dependency files first (for better caching)
COPY pyproject.toml uv.lock ./

# Install production dependencies only
RUN uv sync --frozen --no-dev --no-cache

# Copy application code
COPY project/ ./project/

# Create non-root user for security
RUN useradd -m -u 1000 appuser && \
chown -R appuser:appuser /app

USER appuser

# Run the application
CMD ["python", "-m", "project.main"]
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.PHONY: clean install install-dev

# Default Python
PYTHON := python3

clean: ## Remove Python cache files and virtual environment
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type d -name ".ruff_cache" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete 2>/dev/null || true
find . -type f -name "*.pyo" -delete 2>/dev/null || true
rm -rf .venv/ 2>/dev/null || true
@echo "✓ Cleaned cache files and virtual environment"

install: ## Install uv and production dependencies
$(PYTHON) -m pip install uv
uv venv
uv sync --no-dev
@echo "✓ Production dependencies installed"

install-dev: ## Install uv and all dependencies including dev
$(PYTHON) -m pip install uv
uv venv
uv sync
uv run pre-commit install
@echo "✓ All dependencies installed (including dev)"
@echo "✓ Pre-commit hooks installed"
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
![compatiblepy](https://img.shields.io/pypi/pyversions/cookiecutter)
[![GitHub](https://img.shields.io/github/license/mrhallak/pycutter)](https://github.com/mrhallak/pycutter)

# Pycutter

Pycutter is designed to streamline the setup process for Python projects. By leveraging the power of [Cookiecutter](https://github.com/cookiecutter/cookiecutter), it provides a standardized project structure and pre-configured settings, allowing developers to focus on coding rather than project setup.

## Documentation
* [Setup](./docs/SETUP.md)
Loading