Skip to content

Commit 28a6dad

Browse files
committed
refactor: Makefile use uv more
Signed-off-by: Jack Cherng <[email protected]>
1 parent b4793fc commit 28a6dad

File tree

8 files changed

+776
-90
lines changed

8 files changed

+776
-90
lines changed

.github/workflows/python.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,20 @@ jobs:
2626
name: ${{ matrix.python-version }}
2727
runs-on: ${{ matrix.os }}
2828

29-
env:
30-
UV_SYSTEM_PYTHON: 1
31-
3229
strategy:
3330
matrix:
3431
os: ['ubuntu-latest']
3532
python-version: ['3.8']
3633

3734
steps:
38-
- uses: actions/checkout@v4
35+
- uses: astral-sh/setup-uv@v6
36+
- uses: actions/checkout@v5
3937
with:
4038
submodules: recursive
41-
4239
- name: Set up Python ${{ matrix.python-version }}
43-
uses: actions/setup-python@v5
40+
uses: actions/setup-python@v6
4441
with:
4542
python-version: ${{ matrix.python-version }}
46-
47-
- name: Install dependencies
48-
run: |
49-
python -m pip install -U uv
50-
make install-dev
51-
5243
- name: Do linting
5344
run: |
5445
make ci-check

Makefile

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,51 @@
1-
UV_INSTALL_FLAGS :=
2-
31
.PHONY: all
42
all:
53

4+
# ---- #
5+
# deps #
6+
# ---- #
7+
8+
.PHONY: install-all
9+
install-all:
10+
uv sync --all-groups
11+
612
.PHONY: install
713
install:
8-
uv pip install $(UV_INSTALL_FLAGS) -r requirements.txt
14+
uv sync --no-dev
915

1016
.PHONY: install-dev
1117
install-dev:
12-
uv pip install $(UV_INSTALL_FLAGS) -r requirements-dev.txt
18+
uv sync --dev
19+
20+
.PHONY: pip-upgrade
21+
pip-upgrade:
22+
uv sync --all-groups --upgrade
1323

14-
.PHONY: pip-compile
15-
pip-compile:
16-
uv pip compile --upgrade requirements.in -o requirements.txt
17-
uv pip compile --upgrade requirements-dev.in -o requirements-dev.txt
24+
# -- #
25+
# CI #
26+
# -- #
27+
28+
ci-base-cmd = uv run --dev
1829

1930
.PHONY: ci-check
2031
ci-check:
2132
@echo "========== check: mypy =========="
22-
mypy -p plugin
33+
$(ci-base-cmd) mypy -p plugin
2334
@echo "========== check: ruff (lint) =========="
24-
ruff check --diff .
35+
$(ci-base-cmd) ruff check --diff .
2536
@echo "========== check: ruff (format) =========="
26-
ruff format --diff .
37+
$(ci-base-cmd) ruff format --diff .
2738

2839
.PHONY: ci-fix
2940
ci-fix:
3041
@echo "========== fix: ruff (lint) =========="
31-
ruff check --fix .
42+
$(ci-base-cmd) ruff check --fix .
43+
@echo "========== fix: ruff (format) =========="
44+
$(ci-base-cmd) ruff format .
45+
46+
.PHONY: ci-fix-unsafe
47+
ci-fix-unsafe:
48+
@echo "========== fix: ruff (lint unsafe) =========="
49+
$(ci-base-cmd) ruff check --fix --unsafe-fixes .
3250
@echo "========== fix: ruff (format) =========="
33-
ruff format .
51+
$(ci-base-cmd) ruff format .

pyproject.toml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,29 @@
1+
[project]
2+
name = "LSP-copilot"
3+
version = "0.0.0"
4+
description = "GitHub Copilot support for Sublime Text LSP plugin provided through Copilot.vim."
5+
readme = "README.md"
6+
requires-python = ">=3.8"
7+
dependencies = [
8+
"Jinja2==3.*",
9+
"jmespath>=1,<2",
10+
"requests>=2,<3",
11+
"typing-extensions>=4.12",
12+
"watchdog>=4,<5",
13+
"wcmatch>=8,<9",
14+
]
15+
16+
[dependency-groups]
17+
dev = [
18+
"mypy>=1.14",
19+
"ruff>=0.13",
20+
"types-jmespath",
21+
"types-requests",
22+
]
23+
24+
[tool.uv]
25+
default-groups = ["dev"]
26+
127
[tool.mypy]
228
# ignore_missing_imports = False
329
check_untyped_defs = true

requirements-dev.in

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

requirements-dev.txt

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

requirements.in

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

requirements.txt

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

uv.lock

Lines changed: 716 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)