Skip to content

Commit

Permalink
Update other code
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Feb 8, 2023
1 parent ee4ce2b commit 4d02a93
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 55 deletions.
36 changes: 16 additions & 20 deletions .github/workflows/benchmark.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths:
- "polars/**"
- "Cargo.toml"
- "py-polars/tests/db-benchmark/**"
- "py-polars/tests/benchmark/**"
- ".github/workflows/benchmark.yaml"

concurrency:
Expand All @@ -21,9 +21,9 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
cache-dependency-path: "py-polars/requirements-dev.txt"
python-version: '3.11'
cache: pip
cache-dependency-path: py-polars/requirements-dev.txt

- name: Create virtual environment
working-directory: py-polars
Expand All @@ -43,9 +43,9 @@ jobs:
r-version: "3.5.3"

- name: Generate data
working-directory: py-polars/tests/db-benchmark
working-directory: py-polars/tests/benchmark
run: |
Rscript -e 'install.packages("data.table",repos = "https://cloud.r-project.org")'
Rscript -e 'install.packages("data.table", repos="https://cloud.r-project.org")'
Rscript groupby-datagen.R 1e7 1e2 5 0
- name: Set up Rust
Expand All @@ -58,26 +58,22 @@ jobs:
with:
workspaces: py-polars

- name: Install Polars
- name: Install Polars release build
env:
RUSTFLAGS: -C embed-bitcode
working-directory: py-polars
run: |
source activate
maturin develop --release -- -C codegen-units=8 -C lto=thin -C target-cpu=native
- name: Run benchmark tests - lazy versus eager
working-directory: py-polars/tests/db-benchmark
run: python lazy_vs_eager.py
- name: Run H2O AI benchmark - on strings
working-directory: py-polars/tests/benchmark
run: python run_h2oai_benchmark.py on_strings

- name: Run benchmark tests - various
working-directory: py-polars/tests/db-benchmark
run: python various.py
- name: Run H2O AI benchmark - on categoricals
working-directory: py-polars/tests/benchmark
run: python run_h2oai_benchmark.py

- name: Run benchmark tests - on strings
working-directory: py-polars/tests/db-benchmark
run: python main.py on_strings

- name: Run benchmark tests - on categoricals
working-directory: py-polars/tests/db-benchmark
run: python main.py
- name: Run various benchmark tests
working-directory: py-polars
run: pytest -m benchmark --durations 0
6 changes: 3 additions & 3 deletions .github/workflows/test-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ jobs:
maturin develop
- name: Run tests and report coverage
run: pytest --cov -n auto -m "slow or not slow"
run: pytest --cov -n auto -m "not benchmark"

- name: Run doctests
run: python tests/docs/run_doc_examples.py
run: python tests/docs/run_doctest.py

- name: Check import without optional dependencies
run: |
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
pip install target/wheels/polars-*.whl
- name: Run tests
run: pytest -n auto -m "slow or not slow"
run: pytest -n auto -m "not benchmark"

- name: Check import without optional dependencies
run: |
Expand Down
6 changes: 3 additions & 3 deletions py-polars/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ test: venv build ## Run fast unittests

.PHONY: doctest
doctest: venv build ## Run doctests
$(VENV_BIN)/python tests/docs/run_doc_examples.py
$(VENV_BIN)/python tests/docs/run_doctest.py

.PHONY: test-all
test-all: venv build ## Run all tests
$(VENV_BIN)/pytest -n auto -m "slow or not slow"
$(VENV_BIN)/python tests/docs/run_doc_examples.py
$(VENV_BIN)/python tests/docs/run_doctest.py

.PHONY: coverage
coverage: venv build ## Run tests and report coverage
$(VENV_BIN)/pytest --cov -n auto -m "slow or not slow"
$(VENV_BIN)/pytest --cov -n auto -m "not benchmark"

.PHONY: clean
clean: ## Clean up caches and build artifacts
Expand Down
57 changes: 28 additions & 29 deletions py-polars/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,31 +95,6 @@ module = ["polars.*"]
# thin wrapper around the PyO3 api to start with.
warn_return_any = false

[tool.pytest.ini_options]
addopts = [
"--import-mode=importlib",
"-m not slow and not hypothesis", # Default to running fast tests only. To run ALL tests, run: pytest -m ""
]
markers = [
"slow: Tests with a longer than average runtime.",
]

[tool.coverage.run]
source = ["polars"]
branch = true

[tool.coverage.report]
fail_under = 85
skip_covered = true
show_missing = true
exclude_lines = [
"pragma: no cover",
"@overload",
"except ImportError",
"if TYPE_CHECKING:",
"from typing_extensions import ",
]

[tool.ruff]
target-version = "py37"
line-length = 88
Expand Down Expand Up @@ -178,7 +153,31 @@ ban-relative-imports = "all"

[tool.ruff.per-file-ignores]
"polars/datatypes.py" = ["B019"]
"tests/*/*.py" = ["D100", "D103"]
"tests/docs/run_doc_examples.py" = ["D101", "D102", "D103"]
"tests/parametric/__init__.py" = ["D104"]
"tests/slow/__init__.py" = ["D104"]
"tests/**/*.py" = ["D100", "D103"]

[tool.pytest.ini_options]
addopts = [
"--import-mode=importlib",
# Default to running fast tests only. To run ALL tests, run: pytest -m ""
"-m not slow and not hypothesis and not benchmark",
]
markers = [
"slow: Tests with a longer than average runtime.",
"benchmark: Tests that should be run on a Polars release build.",
]

[tool.coverage.run]
source = ["polars"]
branch = true

[tool.coverage.report]
fail_under = 85
skip_covered = true
show_missing = true
exclude_lines = [
"pragma: no cover",
"@overload",
"except ImportError",
"if TYPE_CHECKING:",
"from typing_extensions import ",
]

0 comments on commit 4d02a93

Please sign in to comment.