Skip to content

Commit c94fa27

Browse files
committed
simplify setup with uv
1 parent ef9dd34 commit c94fa27

File tree

9 files changed

+943
-2615
lines changed

9 files changed

+943
-2615
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: CI
3+
4+
on:
5+
pull_request:
6+
branches:
7+
- main
8+
9+
jobs:
10+
deploy:
11+
runs-on: ubuntu-24.04
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v5
17+
18+
- name: Set Locale
19+
run: |
20+
sudo apt-get update && sudo apt-get install tzdata locales -y
21+
sudo locale-gen es_ES.UTF-8
22+
sudo localectl set-locale LANG="es_ES.UTF-8"
23+
export LANG="es_ES.UTF-8"
24+
export LANGUAGE="es_ES.UTF-8"
25+
sudo update-locale
26+
locale -a
27+
locale
28+
locale -c -k LC_NUMERIC
29+
localectl status
30+
31+
- name: Install Dependencies
32+
run: |
33+
uv sync
34+
35+
- name: Build Blog
36+
run: |
37+
uv run ablog build
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Deploy Blog to GitHub Pages
1+
name: Deploy Python Perú's Blog to GitHub Pages
22

33
on:
44
push:
@@ -10,12 +10,13 @@ permissions:
1010

1111
jobs:
1212
deploy:
13-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-24.04
1414
steps:
1515
- uses: actions/checkout@v4
16-
- uses: actions/setup-python@v5
17-
with:
18-
python-version: '3.13'
16+
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v5
19+
1920
- name: Set Locale
2021
run: |
2122
sudo apt-get update && sudo apt-get install tzdata locales -y && sudo locale-gen es_ES.UTF-8
@@ -27,12 +28,15 @@ jobs:
2728
locale
2829
locale -c -k LC_NUMERIC
2930
localectl status
31+
3032
- name: Install Dependencies
3133
run: |
32-
pip install -r requirements.txt
34+
uv sync
35+
3336
- name: Build Blog
3437
run: |
35-
ablog build
38+
uv run ablog build
39+
3640
- name: Publish to GitHub Pages
3741
uses: peaceiris/actions-gh-pages@v4
3842
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
# Python Peru's Blog
22

33

4-
To build, make sure you have Python 3.12 installed. Then install `poetry`:
4+
Install `uv`, follow the instructions in their documentation
5+
https://docs.astral.sh/uv/getting-started/installation/, `uv` will handle all
6+
the dependencies and the python installation as well. So we don't need to
7+
install `python` separately.
58

6-
```sh
7-
pip install -U poetry
8-
```
9-
10-
Then install all the necessary packages (make sure to change to the root directory of the project):
9+
Then install all the necessary packages (make sure to change to the root
10+
directory of the project):
1111

1212
```sh
13-
poetry install
13+
uv sync
1414
```
1515

1616
You can build the html files of the blog by running the following command:
1717

1818
```sh
19-
poetry run ablog build
19+
uv run ablog build
2020
```
2121

2222
Then you can serve the files locally using this command:
2323
```sh
24-
poetry run ablog serve
24+
uv run ablog serve
2525
```
2626

2727
## Notice
2828

29-
Any contribution you make should be placed in the `blog/` directory and you could choose between reStructuredText (.rst) or Markdown (.md).
29+
Any contribution you make should be placed in the `blog/` directory and you
30+
could choose between reStructuredText (.rst) or Markdown (.md).

blog/como-redactar-posts.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,32 +164,31 @@ Español los posts.
164164

165165
### Instalación
166166

167-
1. Instalemos poetry:
168-
169-
```sh
170-
pip install -U poetry
171-
```
167+
1. Instalamos `uv`, sigue las instrucciones en su documentación
168+
https://docs.astral.sh/uv/getting-started/installation/, `uv` manejarátodas
169+
las dependencias y también la instalación de python. De forma tal que no
170+
necesitamos instalar `python` de manera separada.
172171

173172
2. Estando en la raíz del repositorio, instalemos las dependencias del Blog:
174173

175174
```sh
176-
poetry install
175+
uv sync
177176
```
178177

179178
### Construcción de las Páginas HTML
180179

181180
Estando en la raíz del repositorio:
182181

183182
```sh
184-
poetry run ablog build
183+
uv run ablog build
185184
```
186185

187186
### Ejecución del Blog
188187

189188
Estando en la raíz del repositorio:
190189

191190
```sh
192-
poetry run ablog serve
191+
uv run ablog serve
193192
```
194193

195194
```{admonition} Nota
@@ -242,3 +241,7 @@ y luego seleccionando el tab "Pull Requests" como muestra en la imágen.
242241
```{admonition} Nota
243242
Nuevo post que explica como hacer lo mismo pero con forks [aquí](/blog/como-redactar-posts-con-fork.md)
244243
```
244+
245+
```{admonition} Nota
246+
Actualizado al 16/03/2025 para hacer uso de `uv` en lugar de `poetry`
247+
```

conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@
286286
"github_submodule/*",
287287
"LICENSE.md",
288288
"README.md",
289+
".venv/*",
289290
]
290291

291292
# The reST default role (used for this markup: `text`) to use for all

poetry.lock

Lines changed: 0 additions & 1714 deletions
This file was deleted.

pyproject.toml

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
1-
[tool.poetry]
1+
[project]
2+
authors = [
3+
{name = "Ider Delzo", email = "soloidx@gmail.com"},
4+
{name = "Jean-Pierre Chauvel", email = "jean.pierre@chauvel.org"},
5+
]
6+
license = {text = "Apache License, Version 2.0"}
7+
requires-python = "<4.0,>=3.13"
8+
dependencies = [
9+
"Sphinx<8.0.0,>=7.2.6",
10+
"ablog<1.0.0,>=0.11.6",
11+
"pydata-sphinx-theme<1.0.0,>=0.15.2",
12+
"myst-parser[linkify]<3.0.0,>=2.0.0",
13+
"sphinxcontrib-youtube<2.0.0,>=1.4.1",
14+
"sphinx-sitemap<3.0.0,>=2.5.1",
15+
"sphinxext-opengraph<1.0.0,>=0.9.1",
16+
"matplotlib<4.0.0,>=3.8.4",
17+
]
218
name = "pythonpe-blog"
319
version = "0.1.0"
420
description = ""
5-
authors = ["Ider Delzo <soloidx@gmail.com>", "Jean-Pierre Chauvel <jean.pierre@chauvel.org>"]
6-
license = "Apache License, Version 2.0"
721
readme = "README.md"
822
package-mode = false
923

10-
[tool.poetry.dependencies]
11-
python = "^3.13"
12-
Sphinx = "^7.2.6"
13-
ablog = "^0.11.6"
14-
pydata-sphinx-theme = "^0.15.2"
15-
myst-parser = {extras = ["linkify"], version = "^2.0.0"}
16-
sphinxcontrib-youtube = "^1.4.1"
17-
sphinx-sitemap = "^2.5.1"
18-
sphinxext-opengraph = "^0.9.1"
19-
matplotlib = "^3.8.4"
20-
21-
22-
[tool.poetry.group.dev.dependencies]
23-
isort = "^6.0.1"
24-
black = "^25.1.0"
25-
26-
[tool.poetry.requires-plugins]
27-
poetry-plugin-export = ">=1.8"
24+
[dependency-groups]
25+
dev = [
26+
"isort<7.0.0,>=6.0.1",
27+
"black<26.0.0,>=25.1.0",
28+
]
2829

2930
[tool.black]
3031
line-length = 79
31-
32-
[build-system]
33-
requires = ["poetry-core"]
34-
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)