Skip to content

Commit c0f9a6d

Browse files
committed
move to uv
1 parent 16ff5a4 commit c0f9a6d

File tree

12 files changed

+2713
-422
lines changed

12 files changed

+2713
-422
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,9 @@ permissions:
88
jobs:
99
test:
1010
runs-on: ubuntu-latest
11-
strategy:
12-
matrix:
13-
python-version: [ "3.10", "3.11", "3.12" ]
1411
steps:
15-
- uses: actions/checkout@v4
16-
with:
17-
submodules: recursive
18-
token: ${{ secrets.PAT }}
19-
- name: Set up Python ${{ matrix.python-version }}
20-
uses: actions/setup-python@v5
21-
with:
22-
python-version: ${{ matrix.python-version }}
23-
cache: pip
24-
cache-dependency-path: '**/pyproject.toml'
25-
- name: Install hatch
26-
run: |
27-
pip install hatch
12+
- name: Install uv
13+
uses: astral-sh/setup-uv@v3
2814
- name: Run tests
29-
run: |
30-
hatch run pytest
15+
run: uv sync and uvx pytest
16+

.github/workflows/publish.yml

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,19 @@ name: Publish Python Package
22

33
on:
44
release:
5-
types: [created]
5+
types: [ created ]
66

77
jobs:
8-
test:
9-
runs-on: ubuntu-latest
10-
strategy:
11-
matrix:
12-
python-version: ["3.10", "3.11", "3.12"]
13-
steps:
14-
- uses: actions/checkout@v4
15-
with:
16-
submodules: recursive
17-
token: ${{ secrets.PAT }}
18-
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v5
20-
with:
21-
python-version: ${{ matrix.python-version }}
22-
- name: Install Hatch
23-
uses: pypa/hatch@install
24-
- name: Run tests
25-
run: |
26-
hatch run pytest
278
deploy:
289
runs-on: ubuntu-latest
29-
needs: [test]
3010
environment: release
3111
permissions:
3212
id-token: write
3313
steps:
34-
- uses: actions/checkout@v4
35-
- name: Set up Python
36-
uses: actions/setup-python@v5
37-
with:
38-
python-version: '3.12'
39-
- name: Install Hatch
40-
uses: pypa/hatch@install
41-
- name: Build
42-
run: |
43-
hatch build
44-
- name: Publish
45-
uses: pypa/gh-action-pypi-publish@release/v1
14+
- uses: actions/checkout@v4
15+
- name: Install uv
16+
uses: astral-sh/setup-uv@v3
17+
- name: Build
18+
run: uv build
19+
- name: Publish
20+
uses: pypa/gh-action-pypi-publish@release/v1

.vscode/settings.json

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

justfile

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,27 @@ _default:
33
@just --list
44

55
@install:
6-
hatch run python --version
6+
uv sync
77

88
# Install dependencies
99
@bootstrap:
10-
hatch env create
11-
hatch env create docs
10+
uv sync
1211

1312
@clean:
14-
hatch env prune
15-
16-
# Ugrade dependencies
17-
upgrade:
18-
hatch run hatch-pip-compile --upgrade --all
13+
rm -rf .venv
1914

2015
# Run sphinx autobuild
2116
@docs-serve:
22-
hatch run docs:sphinx-autobuild docs docs/_build/html --port 8002
17+
uv sync --group docs
18+
uv run docs:sphinx-autobuild docs docs/_build/html --port 8002
2319

2420
# Generate demo project
2521
generate-demo *OVERWRITE:
2622
#!/usr/bin/env bash
2723
set -euo pipefail
2824
[[ "{{ OVERWRITE }}" == "--overwrite" ]] && rm -rf demo/myjourney
2925
[[ -d demo/myjourney ]] && { echo "Directory demo/myjourney already exists. Use --overwrite to recreate it."; exit 0; }
30-
hatch run falco start-project myjourney demo -b blueprints/tailwind
26+
uv run falco start-project myjourney demo -b blueprints/tailwind
3127
cd demo/myjourney
3228
just bootstrap
3329
just falco start-app entries
@@ -55,18 +51,18 @@ tree: generate-demo
5551
rm -f tree.txt\'\'
5652

5753
@test:
58-
hatch run pytest
54+
uv run pytest
5955

6056
# Run all formatters
6157
@fmt:
6258
just --fmt --unstable
63-
hatch fmt --formatter
64-
hatch run pyproject-fmt pyproject.toml
65-
hatch run pre-commit run reorder-python-imports -a
59+
uvx ruff format
60+
uv run pyproject-fmt pyproject.toml
61+
uv run pre-commit run reorder-python-imports -a
6662

6763
# Bump project version and update changelog
6864
@bumpver version:
69-
hatch run bump-my-version bump {{ version }}
65+
uvx bump-my-version bump {{ version }}
7066
git push
7167
git push --tags
7268

pyproject.toml

Lines changed: 8 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ requires = [
77
[project]
88
name = "falco-cli"
99
description = "Enhance your Django developer experience: CLI and Guides for the Modern Developer."
10+
version = "0.27.0a6"
1011
readme = "README.md"
1112
keywords = [
1213
"cookiecutter",
@@ -37,22 +38,16 @@ classifiers = [
3738
"Programming Language :: Python :: Implementation :: CPython",
3839
"Programming Language :: Python :: Implementation :: PyPy",
3940
]
40-
dynamic = [
41-
"version",
42-
]
4341
dependencies = [
44-
"autoflake",
45-
"black",
4642
"cappa",
4743
"cookiecutter",
4844
"cruft",
4945
"djlint",
5046
"httpx",
51-
"isort",
5247
"rich",
5348
"tomlkit",
49+
"ruff-api<=0.1.0",
5450
]
55-
optional-dependencies = { just = [ "just-bin" ], hatch = [ "hatch" ] }
5651

5752
urls.Documentation = "https://falco.oluwatobi.dev/"
5853
urls.Homepage = "https://falco.oluwatobi.dev/"
@@ -61,25 +56,8 @@ urls.Source = "https://github.com/tobi-de/falco"
6156

6257
scripts.falco = "falco_cli.__main__:main"
6358

64-
[tool.hatch.build.targets.wheel]
65-
packages = [
66-
"src/falco_cli",
67-
]
68-
69-
[tool.hatch.env]
70-
requires = [
71-
"hatch-pip-compile>=1.11.2",
72-
]
73-
74-
[[tool.hatch.envs.all.matrix]]
75-
python = [
76-
"3.10",
77-
"3.11",
78-
"3.12",
79-
]
80-
81-
[tool.hatch.envs.default]
82-
dependencies = [
59+
[dependency-groups]
60+
dev = [
8361
"coverage[toml]>=6.5",
8462
"pytest",
8563
"ipython",
@@ -93,14 +71,7 @@ dependencies = [
9371
"pytest-xdist",
9472
"pyproject-fmt",
9573
]
96-
pip-compile-constraint = "default"
97-
pip-compile-installer = "uv"
98-
pip-compile-resolver = "uv"
99-
type = "pip-compile"
100-
lock-filename = "requirements.txt"
101-
102-
[tool.hatch.envs.docs]
103-
dependencies = [
74+
docs = [
10475
"sphinx",
10576
"sphinx-autobuild",
10677
"myst-parser",
@@ -115,13 +86,6 @@ dependencies = [
11586
"sphinx-github-changelog",
11687
"sphinx-docsearch",
11788
]
118-
lock-filename = "docs/requirements.txt"
119-
120-
[tool.hatch.metadata]
121-
allow-direct-references = true
122-
123-
[tool.hatch.version]
124-
path = "src/falco_cli/__about__.py"
12589

12690
[tool.ruff]
12791
exclude = [
@@ -225,6 +189,6 @@ tag_message = "Bump version: {current_version} → {new_version}"
225189
tag_name = "v{new_version}"
226190

227191
[[tool.bumpversion.files]]
228-
filename = "src/falco_cli/__about__.py"
229-
replace = '__version__ = "{new_version}"'
230-
search = '__version__ = "{current_version}"'
192+
filename = "pyproject.toml"
193+
replace = 'version = "{new_version}"'
194+
search = 'version = "{current_version}"'

0 commit comments

Comments
 (0)