Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/actions/build-prql-python/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ inputs:
runs:
using: composite
steps:
# There's no point caching here, because the maturin action uses a container.
# There's benefit from caching here, because the maturin action uses a container.
- uses: messense/maturin-action@v1
if: inputs.target == 'source'
with:
Expand All @@ -28,12 +28,16 @@ runs:
with:
command: build
args: --release -o target/python -m prqlc/bindings/python/Cargo.toml
- name: Add targets for MacOS universal
if: runner.os == 'macOS' && inputs.target != 'source'
shell: bash
run: rustup target add aarch64-apple-darwin
- uses: messense/maturin-action@v1
if: runner.os == 'macOS' && inputs.target != 'source'
with:
command: build
args:
--release -o target/python --universal2 -m
--release -o target/python --target=universal2-apple-darwin -m
prqlc/bindings/python/Cargo.toml
- name: Upload wheels
uses: actions/upload-artifact@v3
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/test-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
path: target/python
- uses: actions/setup-python@v5
with:
python-version: "3.7"
python-version: "3.8"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
Expand All @@ -42,9 +42,7 @@ jobs:
uses: actions/cache@v3
with:
path: .nox
key:
nox-${{ hashFiles('prql-python/noxfile.py') }}-${{
hashFiles('prql-python/requirements.txt') }}
key: nox-${{ hashFiles('prqlc/bindings/python/pyproject.toml') }}
- name: Run tests and typing
shell: bash
run: nox -s tests typing -f prqlc/bindings/python/noxfile.py
11 changes: 6 additions & 5 deletions prqlc/bindings/python/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from nox.sessions import Session

VERSIONS: List[str] = [
"3.7",
"3.8",
"3.11",
]

Expand All @@ -18,9 +18,12 @@
def _install_prql_python(session: Session) -> None:
session.install(
"-v",
"--no-index",
# We'd like to prevent `prql_python` from being installed from PyPI, but we do
# want to install its dependencies from there, and currently there's no way in
# plain pip of doing that (https://github.com/pypa/pip/issues/11440).
# "--no-index",
f"--find-links={Path('..', '..', '..', 'target', 'python')}",
"prql_python",
"prql_python[test]",
)


Expand All @@ -29,13 +32,11 @@ def tests(session: Session) -> None:
"""Run the test suite with pytest."""
print("CWD", os.getcwd())
_install_prql_python(session)
session.install("-v", "-r", "requirements.txt")
session.run("pytest", str(Path("python", "tests")))


@nox.session(python=VERSIONS) # type: ignore[misc]
def typing(session: Session) -> None:
"""Check types with mypy"""
_install_prql_python(session)
session.install("mypy==1.4.0")
session.run("mypy")
21 changes: 12 additions & 9 deletions prqlc/bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
build-backend = "maturin"
requires = ["maturin>=0.13,<0.14"]
requires = ["maturin>=1.0,<2.0"]

[project]
classifiers = [
Expand All @@ -9,7 +9,7 @@ classifiers = [
"Programming Language :: Python :: Implementation :: PyPy",
]
name = "prql-python"
requires-python = ">=3.7"
requires-python = ">=3.8"

[tool.maturin]
# This is required because of https://github.com/PyO3/pyo3/pull/2135. Instead of
Expand All @@ -21,6 +21,12 @@ requires-python = ">=3.7"

features = ["pyo3/extension-module"]

[project.optional-dependencies]
test = [
"pytest >= 7",
"mypy == 1.8.0",
]

[tool.ruff]
fix = true
ignore = [
Expand All @@ -30,12 +36,6 @@ ignore = [
"E731",
]

[[tool.mypy.overrides]]
ignore_missing_imports = true
module = [
"pytest.*",
]

[tool.mypy]
files = "."
show_error_codes = true
Expand All @@ -44,4 +44,7 @@ warn_unused_ignores = true

[[tool.mypy.overrides]]
ignore_missing_imports = true
module = "nox.*"
module = [
"pytest.*",
"nox.*",
]
3 changes: 0 additions & 3 deletions prqlc/bindings/python/requirements.txt

This file was deleted.