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
9 changes: 6 additions & 3 deletions bindings/python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@
# specific language governing permissions and limitations
# under the License.


install:
uv sync --group dev --no-install-project
.PHONY: build install test

build:
uv run maturin develop

# uv sync may remove local editable pyiceberg-core, so install rebuilds it afterwards.
install:
uv sync --group dev --no-install-project
$(MAKE) build

test:
uv run --no-sync pytest
5 changes: 5 additions & 0 deletions bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ include = [
[tool.ruff.lint]
ignore = ["F403", "F405"]

[tool.pytest.ini_options]
filterwarnings = [
"error",
]

[dependency-groups]
dev = [
"maturin>=1.0,<2.0",
Expand Down
15 changes: 15 additions & 0 deletions bindings/python/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

import pytest
from pydantic_core import to_json
from pyiceberg.utils.config import Config

from pyiceberg.partitioning import PartitionField, PartitionSpec
from pyiceberg.schema import Schema
Expand All @@ -36,6 +37,20 @@
)


@pytest.fixture(scope="session", autouse=True)
def isolate_pyiceberg_config() -> Generator[None, None, None]:
monkeypatch = pytest.MonkeyPatch()
with TemporaryDirectory() as empty_home_dir:
monkeypatch.setenv("HOME", empty_home_dir)
monkeypatch.setenv("PYICEBERG_HOME", empty_home_dir)

import pyiceberg.catalog as catalog

monkeypatch.setattr(catalog, "_ENV_CONFIG", Config())
yield
monkeypatch.undo()


@pytest.fixture(scope="session")
def avro_schema_manifest_entry() -> Dict[str, Any]:
return {
Expand Down
4 changes: 2 additions & 2 deletions bindings/python/tests/test_datafusion_table_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def test_register_iceberg_table_provider(
)

ctx = SessionContext()
ctx.register_table_provider("test", iceberg_table_provider)
ctx.register_table("test", iceberg_table_provider)

datafusion_table = ctx.table("test")
assert datafusion_table is not None
Expand Down Expand Up @@ -154,7 +154,7 @@ def __datafusion_table_provider__(self):
)

ctx = SessionContext()
ctx.register_table_provider("test", iceberg_table)
ctx.register_table("test", iceberg_table)

datafusion_table = ctx.table("test")
assert datafusion_table is not None
Loading