Skip to content

Commit 50941d1

Browse files
committed
Overhaul javascript.yml and python.yml.
* Use uv in pipelines * Add path for more fine-controlled executions fixes #39 * Change parent project to uv * Update metadata
1 parent f9a647c commit 50941d1

File tree

5 files changed

+46
-37
lines changed

5 files changed

+46
-37
lines changed

.github/workflows/javascript.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
name: JavaScript Tests
33

44
on:
5-
pull_request: ~
5+
pull_request:
6+
branches: [ main ]
7+
paths:
8+
- cratedb_sqlparse_js
69
push:
710
branches: [ main ]
11+
paths:
12+
- cratedb_sqlparse_js
813

914
# Allow job to be triggered manually.
1015
workflow_dispatch:
@@ -24,15 +29,13 @@ defaults:
2429
working-directory: cratedb_sqlparse_js
2530

2631
jobs:
27-
2832
tests:
29-
3033
runs-on: ${{ matrix.os }}
3134
strategy:
3235
fail-fast: false
3336
matrix:
3437
os: ["ubuntu-latest"]
35-
node-version: ["18", "20", "22"]
38+
node-version: ["20", "22", "23"]
3639

3740
env:
3841
OS: ${{ matrix.os }}

.github/workflows/python.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22
name: Python Tests
33

44
on:
5-
pull_request: ~
5+
pull_request:
6+
branches: [ main ]
7+
paths:
8+
- cratedb_sqlparse_py
69
push:
710
branches: [ main ]
11+
paths:
12+
- cratedb_sqlparse_py
13+
814

915
# Allow job to be triggered manually.
1016
workflow_dispatch:
@@ -24,9 +30,7 @@ defaults:
2430
working-directory: cratedb_sqlparse_py
2531

2632
jobs:
27-
2833
tests:
29-
3034
runs-on: ${{ matrix.os }}
3135
strategy:
3236
fail-fast: false
@@ -49,22 +53,17 @@ jobs:
4953
with:
5054
python-version: ${{ matrix.python-version }}
5155
architecture: x64
52-
cache: 'pip'
53-
cache-dependency-path: 'pyproject.toml'
56+
57+
- name: Install uv
58+
uses: astral-sh/setup-uv@v5
5459

5560
- name: Set up project
5661
run: |
57-
58-
# `setuptools 0.64.0` adds support for editable install hooks (PEP 660).
59-
# https://github.com/pypa/setuptools/blob/main/CHANGES.rst#v6400
60-
pip install "setuptools>=64" --upgrade
61-
62-
# Install package in editable mode.
63-
pip install --use-pep517 --prefer-binary --editable='.[develop,generate,test]'
62+
uv sync --all-groups
6463
6564
- name: Run linter and software tests
6665
run: |
67-
poe check
66+
uv run poe check
6867
6968
- name: Upload coverage to Codecov
7069
uses: codecov/codecov-action@v5

cratedb_sqlparse_py/pyproject.toml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ license = { text = "Apache License 2.0" }
2323
authors = [
2424
{ name = "Ivan Sanchez Valencia", email = "[email protected]" },
2525
]
26-
requires-python = ">=3.8"
26+
requires-python = ">=3.9"
2727
classifiers = [
2828
"Development Status :: 3 - Alpha",
2929
"Environment :: Console",
@@ -67,30 +67,34 @@ dynamic = [
6767
dependencies = [
6868
"antlr4-python3-runtime<4.14",
6969
]
70-
optional-dependencies.develop = [
70+
71+
[dependency-groups]
72+
dev = [
7173
"mypy<1.16",
7274
"packaging",
7375
"poethepoet<1",
7476
"pyproject-fmt<2.6",
7577
"ruff<0.12",
7678
"validate-pyproject<0.25",
79+
"pytest<9",
80+
"pytest-cov<7",
7781
]
78-
optional-dependencies.generate = [
82+
generate = [
7983
"antlr4-tools<0.3",
8084
"requests<3",
8185
]
82-
optional-dependencies.release = [
86+
87+
release = [
8388
"build<2",
8489
"twine<7",
8590
]
86-
optional-dependencies.test = [
87-
"pytest<9",
88-
"pytest-cov<7",
89-
]
90-
urls.changelog = "https://github.com/crate/cratedb-sqlparse/blob/main/CHANGES.md"
91-
urls.documentation = "https://github.com/crate/cratedb-sqlparse"
92-
urls.homepage = "https://github.com/crate/cratedb-sqlparse"
93-
urls.repository = "https://github.com/crate/cratedb-sqlparse"
91+
92+
[project.urls]
93+
Homepage = "https://github.com/crate/cratedb-sqlparse"
94+
Documentation = "https://github.com/crate/cratedb-sqlparse"
95+
Repository = "https://github.com/crate/cratedb-sqlparse"
96+
Changelog = "https://github.com/crate/cratedb-sqlparse/releases"
97+
9498

9599
[tool.setuptools.packages.find]
96100
namespaces = false
@@ -152,8 +156,7 @@ testpaths = [
152156
"tests",
153157
]
154158
xfail_strict = true
155-
markers = [
156-
]
159+
markers = []
157160

158161
[tool.coverage.run]
159162
branch = false

pyproject.toml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
[tool.poe.tasks]
2-
3-
generate = [
4-
{ cmd = "python setup_grammar.py python" },
5-
{ cmd = "python setup_grammar.py javascript" },
1+
[project]
2+
name = "cratedb-sqlparse-generator"
3+
version = "0.0.1"
4+
description = "Dependencies to build and generate cratedb-sqlparse parsers; same for all target languages"
5+
readme = "README.md"
6+
requires-python = ">=3.12"
7+
dependencies = [
8+
"antlr4-tools>=0.2.1",
9+
"requests>=2.32.3",
610
]
11+
tool.uv.package = false

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
antlr4-tools<0.3
2-
poethepoet<1
32
requests<3

0 commit comments

Comments
 (0)