Skip to content

Commit cabf9cf

Browse files
author
CJ Steiner
committed
consolidate requirements and setup into pyproject toml - use uv for builds
1 parent e29d2df commit cabf9cf

File tree

7 files changed

+31
-24
lines changed

7 files changed

+31
-24
lines changed

.github/workflows/deploy.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ jobs:
1212
pr:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v3
16-
- uses: actions/setup-python@v4
15+
- uses: actions/checkout@v4
16+
- uses: astral-sh/setup-uv@v5
1717
with:
1818
python-version: 3.x
19-
- run: pip install virtualenv
19+
enable-cache: true
2020
- run: make
2121
- run: make push
2222
env:

Makefile

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
all: install-hooks build/main_bs5.css index.html hooks.html
22

33
.PHONY: install-hooks
4-
install-hooks: venv
5-
venv/bin/pre-commit install
4+
install-hooks:
5+
uv run pre-commit install
66

77
build/main_bs5.css: node_modules build scss/main_bs5.scss scss/_variables.scss
88
node_modules/.bin/sass --style=compressed --load-path=. scss/main_bs5.scss build/main_bs5.css
99

10-
index.html hooks.html: venv base.mako index.mako hooks.mako make_templates.py template_lib.py sections/*.md
11-
venv/bin/python make_templates.py
12-
13-
venv: requirements-dev.txt Makefile
14-
rm -rf venv
15-
virtualenv venv -ppython3
16-
venv/bin/pip install -r requirements-dev.txt
10+
index.html hooks.html: base.mako index.mako hooks.mako make_templates.py template_lib.py sections/*.md
11+
uv run python make_templates.py
1712

1813
node_modules: package.json
1914
( \
@@ -22,13 +17,13 @@ node_modules: package.json
2217
touch $@ \
2318
) || touch $@ --reference $^ --date '1 day ago'
2419

25-
push: venv
26-
venv/bin/markdown-to-presentation push \
20+
push:
21+
uv run markdown-to-presentation push \
2722
.nojekyll README.md CNAME \
2823
build assets *.html *.png *.svg favicon.ico
2924

3025
clean:
31-
rm -rf venv build node_modules *.html
26+
rm -rf build node_modules *.html
3227

3328
build:
3429
mkdir -p build

pyproject.toml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[project]
2+
name = "pre-commit.com"
3+
version = "0.1.0"
4+
description = "This powers https://pre-commit.com"
5+
readme = "README.md"
6+
requires-python = ">=3.7"
7+
dependencies = []
8+
9+
[dependency-groups]
10+
dev = [
11+
"mako>=1.2.4",
12+
"markdown-code-blocks>=3.0.0",
13+
"markdown-to-presentation>=0.0.12",
14+
"pre-commit>=1.21.0",
15+
"pygments-pre-commit>=1.4.0",
16+
]
17+
18+
[tool.mypy]
19+
disallow_untyped_defs = true

requirements-dev.txt

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

sections/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Here are some sample invocations using this `.pre-commit-config.yaml`:
2929
```yaml
3030
repos:
3131
- repo: https://github.com/pre-commit/pre-commit-hooks
32-
rev: v2.1.0
32+
rev: v5.0.0
3333
hooks:
3434
- id: trailing-whitespace
3535
- repo: https://github.com/asottile/pyupgrade

sections/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ pre-commit --version
4646
```yaml
4747
repos:
4848
- repo: https://github.com/pre-commit/pre-commit-hooks
49-
rev: v2.3.0
49+
rev: v5.0.0
5050
hooks:
5151
- id: check-yaml
5252
- id: end-of-file-fixer

setup.cfg

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

0 commit comments

Comments
 (0)