Skip to content

Commit b9aa6af

Browse files
committed
Migración a uv
1 parent 7d41a21 commit b9aa6af

10 files changed

Lines changed: 737 additions & 47 deletions

File tree

‎.github/workflows/actualizar-eventos-meetup.yml‎

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,13 @@ jobs:
1010
if: github.repository_owner == 'PyBAQ'
1111
name: Actualizar eventos meetup
1212
runs-on: ubuntu-latest
13-
environment: meetup-events
1413
steps:
15-
- name: checkout@v4
16-
uses: actions/checkout@v4
17-
18-
- name: setup-python@v5
19-
uses: actions/setup-python@v5
20-
with:
21-
python-version: '3.10'
22-
14+
- uses: actions/checkout@v6
15+
- uses: astral-sh/setup-uv@v7
2316
- name: Instalar requirements
2417
run: |
25-
python -m pip install --upgrade pip setuptools
26-
pip install -r requirements.txt
18+
uv run python -m pip install --upgrade pip setuptools
19+
uv run python -m pip install -r requirements.txt
2720
2821
- name: Ejecutar graphql_api.py
2922
env:
@@ -32,10 +25,10 @@ jobs:
3225
MEETUP_MEMBER_ID: ${{secrets.MEETUP_MEMBER_ID}}
3326
MEETUP_PRIVATE_KEY: ${{secrets.MEETUP_PRIVATE_KEY}}
3427
MEETUP_SIGNING_KEY_ID: ${{secrets.MEETUP_SIGNING_KEY_ID}}
35-
run: python scripts/graphql_api.py
28+
run: uv run python scripts/graphql_api.py
3629

3730
- name: Ejecutar create_events.py
38-
run: python scripts/create_events.py
31+
run: uv run python scripts/create_events.py
3932

4033
- name: Rama actual
4134
run: git branch

‎.github/workflows/deploy.yml‎

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,32 +24,29 @@ env:
2424

2525
jobs:
2626
build:
27-
name: Construir sitio web lektor
27+
name: Construir sitio web
2828
runs-on: ubuntu-latest
2929
steps:
30-
- uses: actions/checkout@v4
31-
- uses: actions/setup-python@v5
32-
with:
33-
python-version: "3.10"
34-
- uses: actions/setup-node@v4
30+
- uses: actions/checkout@v6
31+
- uses: actions/setup-node@v6
3532
with:
3633
node-version: "lts/*"
37-
38-
- name: Instalar Lektor
34+
- uses: astral-sh/setup-uv@v7
35+
- name: Instalar dependencias
3936
run: |
40-
python -m pip install --upgrade pip setuptools
41-
pip install -r requirements.txt
42-
pip install -r test-requirements.txt
37+
uv run pip install --upgrade pip setuptools
38+
uv run pip install -r requirements.txt
39+
uv run pip install -r test-requirements.txt
4340
4441
- name: Verificar Pylint
45-
run: pylint --recursive=y tests scripts
42+
run: uv run pylint --recursive=y tests scripts
4643

4744
- name: Construir pagina pybaq
48-
run: lektor build -O '${{ env.OUTPUT }}'
45+
run: uv run lektor build -O '${{ env.OUTPUT }}'
4946

5047
- name: Desplegar pagina pybaq
5148
if: env.DEPLOY == 'true'
52-
run: lektor deploy -O '${{ env.OUTPUT }}' ghpages-https
49+
run: uv run lektor deploy -O '${{ env.OUTPUT }}' ghpages-https
5350
env:
5451
LEKTOR_DEPLOY_USERNAME: pybaq
5552
LEKTOR_DEPLOY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}

‎.github/workflows/test-e2e.yml‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,9 @@ jobs:
2929

3030
steps:
3131
- uses: actions/checkout@v4
32-
- uses: actions/setup-python@v5
33-
with:
34-
python-version: "3.10"
35-
- run: pip install -r requirements.txt -r test-requirements.txt
36-
- run: python -m pytest
32+
- uses: astral-sh/setup-uv@v7
33+
- run: uv run pip install -r requirements.txt -r test-requirements.txt
34+
- run: uv run python -m pytest
3735
- uses: actions/upload-artifact@v4
3836
if: always()
3937
with:

‎.python-version‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.14

‎django-quilla.lektorproject‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ name = pybaq-web
33
url = https://pybaq.co
44
locale = es_CO
55

6-
[packages]
7-
lektor-disqus-comments = 0.2
8-
lektor-markdown-highlighter = 0.3.2
9-
lektor-markdown-header-anchors = 0.3.1
10-
116
[servers.ghpages]
127
target = ghpages://PyBAQ/website?cname=pybaq.co
138
default = yes

‎pyproject.toml‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[project]
2+
name = "pybaq-website"
3+
version = "0.1.0"
4+
description = "Python Barranquilla website"
5+
readme = "README.md"
6+
7+
requires-python = ">=3.14"
8+
9+
dependencies = [
10+
"lektor~=3.4.0b13",
11+
"lektor-disqus-comments~=0.4.1",
12+
"lektor-markdown-highlighter~=0.3.2",
13+
"lektor-markdown-header-anchors~=0.4.0",
14+
"selenium>=4.46.0",
15+
]

‎requirements.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pylint==3.2.7
2525
python-dotenv==1.0.1
2626
python-slugify==8.0.4
2727
pytz==2023.3.post1
28-
requests==2.32.0
28+
requests==2.34.2
2929
text-unidecode==1.3
3030
tomli==2.0.2
3131
tomlkit==0.13.2

‎runtime.txt‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎tests/conftest.py‎

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
"""
2-
Configuración de test automatizados
3-
"""
4-
51
import os
62
from typing import Generator
73
import pytest
8-
from selenium.webdriver import Remote
4+
from selenium import webdriver
95
from selenium.webdriver.chrome.options import Options as ChromeOptions
106
from selenium.webdriver.firefox.options import Options as FirefoxOptions
117
from dotenv import load_dotenv
@@ -19,8 +15,23 @@ def fixture_driver() -> Generator:
1915
"chrome": ChromeOptions(),
2016
"firefox": FirefoxOptions()
2117
}
22-
browser = os.getenv("TEST_BROWSER", "chrome")
23-
command_executor = os.getenv("TEST_COMMAND_EXECUTOR", "http://127.0.0.1:4444/wd/hub")
18+
19+
browser = os.getenv("TEST_BROWSER", "chrome").lower()
20+
# Si no existe la variable, dejamos None para saber que es local
21+
command_executor = os.getenv("TEST_COMMAND_EXECUTOR")
2422
options = posible_options[browser]
25-
driver = Remote(command_executor=command_executor, options=options)
23+
24+
# 🚀 Si hay una URL configurada, usamos Remote. Si no, abrimos navegador local.
25+
if command_executor:
26+
# Nota: Si usas Selenium 4, quita el '/wd/hub' de tu .env si te da error
27+
driver = webdriver.Remote(command_executor=command_executor, options=options)
28+
else:
29+
if browser == "chrome":
30+
driver = webdriver.Chrome(options=options)
31+
elif browser == "firefox":
32+
driver = webdriver.Firefox(options=options)
33+
else:
34+
raise ValueError(f"Navegador no soportado localmente: {browser}")
35+
2636
yield driver
37+
driver.quit() # 👈 Es una buena práctica cerrar el navegador al terminar cada test

0 commit comments

Comments
 (0)