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
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "monthly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
21 changes: 10 additions & 11 deletions .github/workflows/deploy-aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ name: Deploy to AWS S3 + CloudFront

on:
push:
branches: [ main ]
branches: [main]

permissions:
contents: read
id-token: write # Required for AWS OIDC authentication


jobs:
commit_lint:
name: Validate Commit Messages
Expand Down Expand Up @@ -37,19 +36,19 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
- name: Set up Python and UV
uses: astral-sh/setup-uv@v7
with:
python-version: '3.11'
cache: 'pip'
version: latest
enable-cache: true
activate-environment: true
python-version: "3.13"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
run: uv sync --all-extras

- name: Build MkDocs site
run: mkdocs build --strict --use-directory-urls
run: uv run mkdocs build --strict --use-directory-urls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -85,7 +84,7 @@ jobs:
needs: build-and-deploy
runs-on: ubuntu-latest
environment:
name: aws-stag
name: aws-stag
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
Expand Down
22 changes: 10 additions & 12 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,27 @@ name: Deploy to Staging (AWS S3 + CloudFront)

on:
push:
branches: [ staging ]
branches: [staging]

permissions:
contents: read
id-token: write # Required for AWS OIDC authentication


jobs:

commit_lint:
name: Validate Commit Messages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Validate PR Title
uses: wagoid/commitlint-github-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
configFile: .commitlintrc.json

build-and-deploy-staging:
name: Build and Deploy to Staging
needs: commit_lint
Expand All @@ -37,19 +35,19 @@ jobs:
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v5
- name: Set up Python and UV
uses: astral-sh/setup-uv@v7
with:
python-version: '3.11'
cache: 'pip'
version: latest
enable-cache: true
activate-environment: true
python-version: "3.13"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
run: uv sync --all-extras

- name: Build MkDocs site
run: mkdocs build --strict --use-directory-urls
run: uv run mkdocs build --strict --use-directory-urls
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -274,3 +274,5 @@ Thumbs.db

# Generated files
broken_links.json

.python-version
33 changes: 20 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,29 +262,36 @@ Crea archivos en `docs/meetups/YYYY/mes-YYYY.md` siguiendo la plantilla y metada

### Prerrequisitos

- Python 3.8+
- Python 3.11+
- Git
- [uv](https://docs.astral.sh/uv/) (gestor de paquetes y proyectos Python - recomendado) o pip
- Editor de código (VS Code, PyCharm, etc.)

### Fork y Setup Inicial

1. Haz un fork del repositorio en Github
2. Clona tu fork usando `git clone https://github.com/${TU_USUARIO}/pythonCDMX.git`, haciéndolo de esta manera, se registrarán automáticamente `origin` y `upstream`

#### Ejecutar usando UV (Recomendado)

```bash
# 1. Haz fork del repositorio en GitHub
# 2. Clona tu fork
git clone https://github.com/TU-USUARIO/pythonCDMX.git
cd pythonCDMX
# Para instalar las dependencias
uv sync
# Ejecuta el programa con
uv run mkdocs serve
```

# 3. Configura el repositorio original como upstream
git remote add upstream https://github.com/PythonMexico/pythonCDMX.git
#### Ejecutar usando Pip+Venv (Tradicional)

# 4. Crear entorno virtual
```bash
# Crea el entorno virtual
python -m venv .venv
source .venv/bin/activate # En Windows: .venv\Scripts\activate

# 5. Instalar dependencias
# Instalar dependencias
pip install -r requirements.txt

# 6. Ejecutar servidor de desarrollo
# Ejecutar servidor de desarrollo
mkdocs serve
```

Expand Down Expand Up @@ -374,13 +381,13 @@ git push origin nombre-de-tu-rama

```bash
# Construir sitio
mkdocs build
uv run mkdocs build

# Servir sitio localmente
mkdocs serve
uv run mkdocs serve

# Validar configuración
mkdocs build --strict
uv run mkdocs build --strict

# Limpiar build
rm -rf site/
Expand Down
34 changes: 18 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# Dockerfile para Python CDMX Charlas
# Basado en Python 3.11 slim para optimizar el tamaño

FROM python:3.11-slim
FROM python:3.13-slim

# Establecer variables de entorno
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
PYTHONDONTWRITEBYTECODE=1 \
UV_COMPILE_BYTECODE=1 \
UV_LINK_MODE=copy \
UV_PROJECT_ENVIRONMENT=/app/.venv

# Instalar dependencias del sistema
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
curl \
build-essential \
&& rm -rf /var/lib/apt/lists/*
&& apt-get install -y --no-install-recommends \
git \
curl \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*

# Crear usuario no-root para seguridad
RUN groupadd -r mkdocs && useradd -r -g mkdocs mkdocs
Expand All @@ -24,10 +25,11 @@ RUN groupadd -r mkdocs && useradd -r -g mkdocs mkdocs
WORKDIR /app

# Copiar archivos de dependencias
COPY requirements.txt .
COPY pyproject.toml uv.lock ./

# Instalar dependencias de Python
RUN pip install --no-cache-dir -r requirements.txt
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev

# Copiar código fuente
COPY . .
Expand All @@ -43,13 +45,13 @@ EXPOSE 8000

# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8000/ || exit 1
CMD curl -f http://localhost:8000/ || exit 1

# Comando por defecto
CMD ["mkdocs", "serve", "--dev-addr=0.0.0.0:8000"]
CMD ["uv", "run", "mkdocs", "serve", "--dev-addr=0.0.0.0:8000"]

# Etiquetas de metadatos
LABEL maintainer="Python CDMX <info@pythoncdmx.org>" \
description="Sitio web oficial de Python CDMX Charlas" \
version="1.0.0" \
org.opencontainers.image.source="https://github.com/PythonMexico/pythonCDMX"
description="Sitio web oficial de Python CDMX Charlas" \
version="1.0.0" \
org.opencontainers.image.source="https://github.com/PythonMexico/pythonCDMX"
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,21 @@ git clone https://github.com/PythonMexico/pythonCDMX.git
cd pythonCDMX

# Instalar dependencias
pip install -r requirements.txt
uv sync
```

### Desarrollo Local

```bash
# Servidor de desarrollo con recarga automática
mkdocs serve

# El sitio estará disponible en:
# http://localhost:8000
uv run mkdocs serve
```

### Construcción para Producción

```bash
# Generar sitio estático
mkdocs build

uv run mkdocs build
# Los archivos se generan en la carpeta site/
```

Expand Down Expand Up @@ -82,7 +78,7 @@ python-cdmx-charlas/
│ └── metadata_json/ # Datos de meetups
├── .github/workflows/ # CI/CD con GitHub Actions
├── mkdocs.yml # Configuración de MkDocs
├── requirements.txt # Dependencias Python
├── pyproject.toml # Dependencias Python
└── README.md # Este archivo
```

Expand Down
24 changes: 24 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[project]
name = "python-cdmx"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"jinja2>=3.1.6",
"mkdocs>=1.6.1",
"mkdocs-awesome-nav>=3.3.0",
"mkdocs-git-revision-date-localized-plugin>=1.5.0",
"mkdocs-material>=9.7.1",
"mkdocs-minify-plugin>=0.8.0",
"pymdown-extensions>=10.19.1",
"requests>=2.32.5",
]

[dependency-groups]
dev = [
"pre-commit>=4.5.1",
"pytest>=9.0.2",
"ruff>=0.14.10",
"tqdm>=4.67.1",
]
Loading