polars-stats 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- polars_stats-0.0.1/.github/workflows/docs.yml +74 -0
- polars_stats-0.0.1/.github/workflows/publish_to_pypi.yml +243 -0
- polars_stats-0.0.1/.github/workflows/pull-request.yml +237 -0
- polars_stats-0.0.1/.gitignore +54 -0
- polars_stats-0.0.1/.pre-commit-config.yaml +56 -0
- polars_stats-0.0.1/AGENTS.md +154 -0
- polars_stats-0.0.1/Cargo.lock +3808 -0
- polars_stats-0.0.1/Cargo.toml +61 -0
- polars_stats-0.0.1/LICENSE +21 -0
- polars_stats-0.0.1/Makefile +28 -0
- polars_stats-0.0.1/PKG-INFO +181 -0
- polars_stats-0.0.1/README.md +154 -0
- polars_stats-0.0.1/benchmarks/README.md +100 -0
- polars_stats-0.0.1/benchmarks/__init__.py +0 -0
- polars_stats-0.0.1/benchmarks/_harness.py +569 -0
- polars_stats-0.0.1/benchmarks/run.py +99 -0
- polars_stats-0.0.1/docs/assets/logo.svg +1 -0
- polars_stats-0.0.1/docs/contributing.md +243 -0
- polars_stats-0.0.1/docs/explanation/accuracy.md +118 -0
- polars_stats-0.0.1/docs/explanation/architecture.md +121 -0
- polars_stats-0.0.1/docs/explanation/design.md +126 -0
- polars_stats-0.0.1/docs/explanation/index.md +65 -0
- polars_stats-0.0.1/docs/getting-started.md +62 -0
- polars_stats-0.0.1/docs/how-to/column-parameters.md +99 -0
- polars_stats-0.0.1/docs/how-to/index.md +20 -0
- polars_stats-0.0.1/docs/how-to/lazy-pipelines.md +83 -0
- polars_stats-0.0.1/docs/how-to/migrate-from-scipy.md +147 -0
- polars_stats-0.0.1/docs/how-to/nulls-and-errors.md +100 -0
- polars_stats-0.0.1/docs/how-to/sampling.md +78 -0
- polars_stats-0.0.1/docs/index.md +128 -0
- polars_stats-0.0.1/docs/reference/continuous.md +37 -0
- polars_stats-0.0.1/docs/reference/discrete.md +25 -0
- polars_stats-0.0.1/docs/reference/index.md +65 -0
- polars_stats-0.0.1/docs/reference/parameters-and-contracts.md +97 -0
- polars_stats-0.0.1/docs/tutorial.md +167 -0
- polars_stats-0.0.1/polars_stats/__init__.py +24 -0
- polars_stats-0.0.1/polars_stats/_internal.pyi +1 -0
- polars_stats-0.0.1/polars_stats/_lib.py +5 -0
- polars_stats-0.0.1/polars_stats/_typing.py +10 -0
- polars_stats-0.0.1/polars_stats/distributions/__init__.py +0 -0
- polars_stats-0.0.1/polars_stats/distributions/_base.py +508 -0
- polars_stats-0.0.1/polars_stats/distributions/_bernoulli.py +142 -0
- polars_stats-0.0.1/polars_stats/distributions/_beta.py +106 -0
- polars_stats-0.0.1/polars_stats/distributions/_binomial.py +110 -0
- polars_stats-0.0.1/polars_stats/distributions/_exponential.py +173 -0
- polars_stats-0.0.1/polars_stats/distributions/_lognormal.py +155 -0
- polars_stats-0.0.1/polars_stats/distributions/_normal.py +131 -0
- polars_stats-0.0.1/polars_stats/distributions/_uniform.py +197 -0
- polars_stats-0.0.1/polars_stats/py.typed +0 -0
- polars_stats-0.0.1/pyproject.toml +237 -0
- polars_stats-0.0.1/rust-toolchain.toml +8 -0
- polars_stats-0.0.1/rustfmt.toml +3 -0
- polars_stats-0.0.1/src/distributions/bernoulli.rs +98 -0
- polars_stats-0.0.1/src/distributions/beta.rs +261 -0
- polars_stats-0.0.1/src/distributions/binomial.rs +322 -0
- polars_stats-0.0.1/src/distributions/exponential.rs +110 -0
- polars_stats-0.0.1/src/distributions/lognormal.rs +265 -0
- polars_stats-0.0.1/src/distributions/mod.rs +260 -0
- polars_stats-0.0.1/src/distributions/normal.rs +303 -0
- polars_stats-0.0.1/src/distributions/uniform.rs +157 -0
- polars_stats-0.0.1/src/lib.rs +14 -0
- polars_stats-0.0.1/src/rng.rs +489 -0
- polars_stats-0.0.1/tests/README.md +49 -0
- polars_stats-0.0.1/tests/__init__.py +0 -0
- polars_stats-0.0.1/tests/_polars_compat.py +122 -0
- polars_stats-0.0.1/tests/distributions/__init__.py +0 -0
- polars_stats-0.0.1/tests/distributions/bernoulli/__init__.py +0 -0
- polars_stats-0.0.1/tests/distributions/bernoulli/cdf_test.py +62 -0
- polars_stats-0.0.1/tests/distributions/bernoulli/conftest.py +49 -0
- polars_stats-0.0.1/tests/distributions/bernoulli/construct_test.py +11 -0
- polars_stats-0.0.1/tests/distributions/bernoulli/entropy_test.py +44 -0
- polars_stats-0.0.1/tests/distributions/bernoulli/isf_test.py +39 -0
- polars_stats-0.0.1/tests/distributions/bernoulli/log_cdf_test.py +52 -0
- polars_stats-0.0.1/tests/distributions/bernoulli/log_pmf_test.py +52 -0
- polars_stats-0.0.1/tests/distributions/bernoulli/log_sf_test.py +52 -0
- polars_stats-0.0.1/tests/distributions/bernoulli/mean_test.py +27 -0
- polars_stats-0.0.1/tests/distributions/bernoulli/median_test.py +20 -0
- polars_stats-0.0.1/tests/distributions/bernoulli/pmf_test.py +63 -0
- polars_stats-0.0.1/tests/distributions/bernoulli/ppf_test.py +48 -0
- polars_stats-0.0.1/tests/distributions/bernoulli/sample_test.py +264 -0
- polars_stats-0.0.1/tests/distributions/bernoulli/samples_test.py +73 -0
- polars_stats-0.0.1/tests/distributions/bernoulli/sf_test.py +27 -0
- polars_stats-0.0.1/tests/distributions/bernoulli/std_test.py +21 -0
- polars_stats-0.0.1/tests/distributions/bernoulli/validation_test.py +48 -0
- polars_stats-0.0.1/tests/distributions/bernoulli/variance_test.py +27 -0
- polars_stats-0.0.1/tests/distributions/beta/__init__.py +0 -0
- polars_stats-0.0.1/tests/distributions/beta/cdf_test.py +42 -0
- polars_stats-0.0.1/tests/distributions/beta/conftest.py +51 -0
- polars_stats-0.0.1/tests/distributions/beta/construct_test.py +35 -0
- polars_stats-0.0.1/tests/distributions/beta/entropy_test.py +30 -0
- polars_stats-0.0.1/tests/distributions/beta/isf_test.py +29 -0
- polars_stats-0.0.1/tests/distributions/beta/log_cdf_test.py +22 -0
- polars_stats-0.0.1/tests/distributions/beta/log_pdf_test.py +44 -0
- polars_stats-0.0.1/tests/distributions/beta/log_sf_test.py +22 -0
- polars_stats-0.0.1/tests/distributions/beta/mean_test.py +21 -0
- polars_stats-0.0.1/tests/distributions/beta/median_test.py +30 -0
- polars_stats-0.0.1/tests/distributions/beta/pdf_test.py +43 -0
- polars_stats-0.0.1/tests/distributions/beta/ppf_test.py +43 -0
- polars_stats-0.0.1/tests/distributions/beta/sample_test.py +128 -0
- polars_stats-0.0.1/tests/distributions/beta/samples_test.py +77 -0
- polars_stats-0.0.1/tests/distributions/beta/sf_test.py +35 -0
- polars_stats-0.0.1/tests/distributions/beta/std_test.py +23 -0
- polars_stats-0.0.1/tests/distributions/beta/symmetry_test.py +16 -0
- polars_stats-0.0.1/tests/distributions/beta/uniform_equivalence_test.py +40 -0
- polars_stats-0.0.1/tests/distributions/beta/validation_test.py +63 -0
- polars_stats-0.0.1/tests/distributions/beta/variance_test.py +22 -0
- polars_stats-0.0.1/tests/distributions/binomial/__init__.py +0 -0
- polars_stats-0.0.1/tests/distributions/binomial/bernoulli_equivalence_test.py +38 -0
- polars_stats-0.0.1/tests/distributions/binomial/cdf_test.py +43 -0
- polars_stats-0.0.1/tests/distributions/binomial/conftest.py +56 -0
- polars_stats-0.0.1/tests/distributions/binomial/construct_test.py +24 -0
- polars_stats-0.0.1/tests/distributions/binomial/entropy_test.py +27 -0
- polars_stats-0.0.1/tests/distributions/binomial/isf_test.py +33 -0
- polars_stats-0.0.1/tests/distributions/binomial/log_cdf_test.py +30 -0
- polars_stats-0.0.1/tests/distributions/binomial/log_pmf_test.py +39 -0
- polars_stats-0.0.1/tests/distributions/binomial/log_sf_test.py +33 -0
- polars_stats-0.0.1/tests/distributions/binomial/mean_test.py +27 -0
- polars_stats-0.0.1/tests/distributions/binomial/median_test.py +29 -0
- polars_stats-0.0.1/tests/distributions/binomial/pmf_test.py +55 -0
- polars_stats-0.0.1/tests/distributions/binomial/ppf_test.py +51 -0
- polars_stats-0.0.1/tests/distributions/binomial/sample_test.py +112 -0
- polars_stats-0.0.1/tests/distributions/binomial/samples_test.py +60 -0
- polars_stats-0.0.1/tests/distributions/binomial/sf_test.py +38 -0
- polars_stats-0.0.1/tests/distributions/binomial/std_test.py +22 -0
- polars_stats-0.0.1/tests/distributions/binomial/validation_test.py +56 -0
- polars_stats-0.0.1/tests/distributions/binomial/variance_test.py +27 -0
- polars_stats-0.0.1/tests/distributions/exponential/__init__.py +0 -0
- polars_stats-0.0.1/tests/distributions/exponential/cdf_test.py +30 -0
- polars_stats-0.0.1/tests/distributions/exponential/conftest.py +60 -0
- polars_stats-0.0.1/tests/distributions/exponential/construct_test.py +29 -0
- polars_stats-0.0.1/tests/distributions/exponential/entropy_test.py +15 -0
- polars_stats-0.0.1/tests/distributions/exponential/isf_test.py +23 -0
- polars_stats-0.0.1/tests/distributions/exponential/log_cdf_test.py +32 -0
- polars_stats-0.0.1/tests/distributions/exponential/log_pdf_test.py +30 -0
- polars_stats-0.0.1/tests/distributions/exponential/log_sf_test.py +29 -0
- polars_stats-0.0.1/tests/distributions/exponential/mean_test.py +13 -0
- polars_stats-0.0.1/tests/distributions/exponential/median_test.py +15 -0
- polars_stats-0.0.1/tests/distributions/exponential/memoryless_test.py +30 -0
- polars_stats-0.0.1/tests/distributions/exponential/null_params_test.py +50 -0
- polars_stats-0.0.1/tests/distributions/exponential/pdf_test.py +40 -0
- polars_stats-0.0.1/tests/distributions/exponential/ppf_test.py +38 -0
- polars_stats-0.0.1/tests/distributions/exponential/sample_test.py +119 -0
- polars_stats-0.0.1/tests/distributions/exponential/samples_test.py +69 -0
- polars_stats-0.0.1/tests/distributions/exponential/sf_test.py +35 -0
- polars_stats-0.0.1/tests/distributions/exponential/std_test.py +16 -0
- polars_stats-0.0.1/tests/distributions/exponential/validation_test.py +56 -0
- polars_stats-0.0.1/tests/distributions/exponential/variance_test.py +13 -0
- polars_stats-0.0.1/tests/distributions/lognormal/__init__.py +0 -0
- polars_stats-0.0.1/tests/distributions/lognormal/cdf_test.py +45 -0
- polars_stats-0.0.1/tests/distributions/lognormal/conftest.py +60 -0
- polars_stats-0.0.1/tests/distributions/lognormal/construct_test.py +39 -0
- polars_stats-0.0.1/tests/distributions/lognormal/entropy_test.py +31 -0
- polars_stats-0.0.1/tests/distributions/lognormal/isf_test.py +30 -0
- polars_stats-0.0.1/tests/distributions/lognormal/log_cdf_test.py +39 -0
- polars_stats-0.0.1/tests/distributions/lognormal/log_pdf_test.py +28 -0
- polars_stats-0.0.1/tests/distributions/lognormal/log_sf_test.py +39 -0
- polars_stats-0.0.1/tests/distributions/lognormal/mean_test.py +26 -0
- polars_stats-0.0.1/tests/distributions/lognormal/median_test.py +25 -0
- polars_stats-0.0.1/tests/distributions/lognormal/pdf_test.py +38 -0
- polars_stats-0.0.1/tests/distributions/lognormal/ppf_test.py +46 -0
- polars_stats-0.0.1/tests/distributions/lognormal/sample_test.py +126 -0
- polars_stats-0.0.1/tests/distributions/lognormal/samples_test.py +69 -0
- polars_stats-0.0.1/tests/distributions/lognormal/sf_test.py +36 -0
- polars_stats-0.0.1/tests/distributions/lognormal/std_test.py +30 -0
- polars_stats-0.0.1/tests/distributions/lognormal/support_test.py +33 -0
- polars_stats-0.0.1/tests/distributions/lognormal/validation_test.py +48 -0
- polars_stats-0.0.1/tests/distributions/lognormal/variance_test.py +30 -0
- polars_stats-0.0.1/tests/distributions/moment_fast_path_test.py +160 -0
- polars_stats-0.0.1/tests/distributions/normal/__init__.py +0 -0
- polars_stats-0.0.1/tests/distributions/normal/cdf_test.py +42 -0
- polars_stats-0.0.1/tests/distributions/normal/conftest.py +54 -0
- polars_stats-0.0.1/tests/distributions/normal/construct_test.py +39 -0
- polars_stats-0.0.1/tests/distributions/normal/entropy_test.py +27 -0
- polars_stats-0.0.1/tests/distributions/normal/isf_test.py +29 -0
- polars_stats-0.0.1/tests/distributions/normal/log_cdf_test.py +39 -0
- polars_stats-0.0.1/tests/distributions/normal/log_pdf_test.py +28 -0
- polars_stats-0.0.1/tests/distributions/normal/log_sf_test.py +39 -0
- polars_stats-0.0.1/tests/distributions/normal/mean_test.py +23 -0
- polars_stats-0.0.1/tests/distributions/normal/median_test.py +23 -0
- polars_stats-0.0.1/tests/distributions/normal/pdf_test.py +46 -0
- polars_stats-0.0.1/tests/distributions/normal/ppf_test.py +43 -0
- polars_stats-0.0.1/tests/distributions/normal/sample_test.py +119 -0
- polars_stats-0.0.1/tests/distributions/normal/samples_test.py +69 -0
- polars_stats-0.0.1/tests/distributions/normal/sf_test.py +34 -0
- polars_stats-0.0.1/tests/distributions/normal/std_test.py +23 -0
- polars_stats-0.0.1/tests/distributions/normal/validation_test.py +48 -0
- polars_stats-0.0.1/tests/distributions/normal/variance_test.py +23 -0
- polars_stats-0.0.1/tests/distributions/output_name_test.py +80 -0
- polars_stats-0.0.1/tests/distributions/plugin_nan_test.py +67 -0
- polars_stats-0.0.1/tests/distributions/std_representable_range_test.py +87 -0
- polars_stats-0.0.1/tests/distributions/uniform/__init__.py +0 -0
- polars_stats-0.0.1/tests/distributions/uniform/cdf_test.py +27 -0
- polars_stats-0.0.1/tests/distributions/uniform/conftest.py +61 -0
- polars_stats-0.0.1/tests/distributions/uniform/construct_test.py +33 -0
- polars_stats-0.0.1/tests/distributions/uniform/entropy_test.py +15 -0
- polars_stats-0.0.1/tests/distributions/uniform/isf_test.py +13 -0
- polars_stats-0.0.1/tests/distributions/uniform/log_cdf_test.py +22 -0
- polars_stats-0.0.1/tests/distributions/uniform/log_pdf_test.py +20 -0
- polars_stats-0.0.1/tests/distributions/uniform/log_sf_test.py +22 -0
- polars_stats-0.0.1/tests/distributions/uniform/mean_test.py +13 -0
- polars_stats-0.0.1/tests/distributions/uniform/median_test.py +13 -0
- polars_stats-0.0.1/tests/distributions/uniform/pdf_test.py +31 -0
- polars_stats-0.0.1/tests/distributions/uniform/ppf_test.py +29 -0
- polars_stats-0.0.1/tests/distributions/uniform/sample_test.py +148 -0
- polars_stats-0.0.1/tests/distributions/uniform/samples_test.py +73 -0
- polars_stats-0.0.1/tests/distributions/uniform/sf_test.py +34 -0
- polars_stats-0.0.1/tests/distributions/uniform/std_test.py +17 -0
- polars_stats-0.0.1/tests/distributions/uniform/validation_test.py +68 -0
- polars_stats-0.0.1/tests/distributions/uniform/variance_test.py +13 -0
- polars_stats-0.0.1/tests/distributions/value_arg_str_test.py +72 -0
- polars_stats-0.0.1/tests/distributions/value_keyed_fast_path_test.py +116 -0
- polars_stats-0.0.1/tests/property/__init__.py +0 -0
- polars_stats-0.0.1/tests/property/_specs.py +180 -0
- polars_stats-0.0.1/tests/property/cdf_test.py +62 -0
- polars_stats-0.0.1/tests/property/conftest.py +16 -0
- polars_stats-0.0.1/tests/property/fast_path_context_test.py +133 -0
- polars_stats-0.0.1/tests/property/moment_test.py +50 -0
- polars_stats-0.0.1/tests/property/pdf_test.py +83 -0
- polars_stats-0.0.1/tests/property/ppf_domain_test.py +73 -0
- polars_stats-0.0.1/tests/property/sample_test.py +273 -0
- polars_stats-0.0.1/tests/property/value_dtype_test.py +133 -0
- polars_stats-0.0.1/tests/property/value_keyed_test.py +80 -0
- polars_stats-0.0.1/tests/scipy_parity/__init__.py +0 -0
- polars_stats-0.0.1/tests/scipy_parity/_harness.py +78 -0
- polars_stats-0.0.1/tests/scipy_parity/bernoulli_test.py +119 -0
- polars_stats-0.0.1/tests/scipy_parity/beta_test.py +58 -0
- polars_stats-0.0.1/tests/scipy_parity/binomial_test.py +84 -0
- polars_stats-0.0.1/tests/scipy_parity/exponential_test.py +150 -0
- polars_stats-0.0.1/tests/scipy_parity/lognormal_test.py +188 -0
- polars_stats-0.0.1/tests/scipy_parity/normal_test.py +151 -0
- polars_stats-0.0.1/tests/scipy_parity/uniform_test.py +137 -0
- polars_stats-0.0.1/tools/accuracy_audit.py +1558 -0
- polars_stats-0.0.1/uv.lock +1835 -0
- polars_stats-0.0.1/zensical.toml +173 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Documentation
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
push:
|
|
6
|
+
branches:
|
|
7
|
+
- main
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
pages: write
|
|
11
|
+
id-token: write
|
|
12
|
+
# Pages allows one deployment at a time. Queue rather than cancel, so a merge train
|
|
13
|
+
# does not abort a deploy that is already uploading.
|
|
14
|
+
concurrency:
|
|
15
|
+
group: pages
|
|
16
|
+
cancel-in-progress: false
|
|
17
|
+
jobs:
|
|
18
|
+
deploy:
|
|
19
|
+
environment:
|
|
20
|
+
name: github-pages
|
|
21
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
timeout-minutes: 20
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
|
|
26
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
27
|
+
with:
|
|
28
|
+
persist-credentials: false
|
|
29
|
+
# Wheel cache private to this workflow, keyed on the build sources: a docs-only
|
|
30
|
+
# push to main restores the previous wheel instead of compiling its own. Pull
|
|
31
|
+
# request CI does not read it (docs-strict-build gets its wheel as a job artifact
|
|
32
|
+
# from the build job instead).
|
|
33
|
+
- name: Restore built wheel
|
|
34
|
+
id: wheel-cache
|
|
35
|
+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
36
|
+
with:
|
|
37
|
+
path: dist
|
|
38
|
+
key: >-
|
|
39
|
+
wheel-${{ runner.os }}-${{ hashFiles('src/**', 'polars_stats/**', 'Cargo.toml',
|
|
40
|
+
'Cargo.lock', 'rust-toolchain.toml', 'pyproject.toml') }}
|
|
41
|
+
# rust-toolchain.toml pins the toolchain; rustup picks it up on first cargo call.
|
|
42
|
+
- name: Set up Rust
|
|
43
|
+
if: steps.wheel-cache.outputs.cache-hit != 'true'
|
|
44
|
+
run: rustup show
|
|
45
|
+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
|
|
46
|
+
if: steps.wheel-cache.outputs.cache-hit != 'true'
|
|
47
|
+
with:
|
|
48
|
+
key: build-wheel
|
|
49
|
+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
50
|
+
with:
|
|
51
|
+
python-version: "3.12"
|
|
52
|
+
enable-cache: true
|
|
53
|
+
# markdown_exec executes every `exec="yes"` block at build time, so the compiled
|
|
54
|
+
# extension must be importable.
|
|
55
|
+
#
|
|
56
|
+
# Deliberately a debug build: `[profile.release]` sets `lto = "thin"` and
|
|
57
|
+
# `codegen-units = 1`, which cost minutes of compile time to speed up maths that
|
|
58
|
+
# here runs over example frames of a handful of rows. The PR suite tests a debug
|
|
59
|
+
# wheel too (`maturin build` defaults to debug), so this is the validated profile.
|
|
60
|
+
- name: Build abi3 wheel
|
|
61
|
+
if: steps.wheel-cache.outputs.cache-hit != 'true'
|
|
62
|
+
run: uvx maturin build --out dist
|
|
63
|
+
# Same install path as the `docs-strict-build` pull request check, so what deploys
|
|
64
|
+
# here is what that check validated.
|
|
65
|
+
- name: Sync project dependencies
|
|
66
|
+
run: uv sync --group docs --no-install-project
|
|
67
|
+
- name: Install built wheel
|
|
68
|
+
run: uv pip install dist/*.whl
|
|
69
|
+
- run: uv run --no-sync zensical build --clean
|
|
70
|
+
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
|
|
71
|
+
with:
|
|
72
|
+
path: site
|
|
73
|
+
- uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
|
|
74
|
+
id: deployment
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
---
|
|
2
|
+
# This file is based on the autogenerated one by maturin v1.7.8 with:
|
|
3
|
+
#
|
|
4
|
+
# maturin generate-ci github
|
|
5
|
+
#
|
|
6
|
+
# Differences are:
|
|
7
|
+
# - removed x86, armv7, s390x, ppc64le targets from Linux
|
|
8
|
+
# - removed free-threaded wheels
|
|
9
|
+
# - removed musllinux
|
|
10
|
+
# - have separate linux-just-test and linux-min-versions-just-test jobs running the
|
|
11
|
+
# suite on the exact tagged commit (mirroring pull-request.yml's build/test steps).
|
|
12
|
+
# This is the single test run of a release: pull-request.yml skips its build/test
|
|
13
|
+
# jobs on the `bump-version` branch, so the suite is not paid twice
|
|
14
|
+
# - a `tag-on-main` guard job fails the run early when the tagged commit is not an
|
|
15
|
+
# ancestor of main, so a tag pushed from an unmerged branch cannot publish
|
|
16
|
+
# - add the `RUSTFLAGS: "-Dwarnings"` env variable
|
|
17
|
+
# - `workflow_dispatch` runs the test and build jobs as a dry run; the release job is
|
|
18
|
+
# tag-gated and never runs from a dispatch
|
|
19
|
+
# - release gates on the test jobs, generates GitHub build-provenance attestations, and
|
|
20
|
+
# publishes via PyPI Trusted Publishing (OIDC) with PEP 740 attestations instead of an
|
|
21
|
+
# API token + `maturin upload`
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
name: Publish to PyPI
|
|
25
|
+
|
|
26
|
+
on:
|
|
27
|
+
workflow_dispatch:
|
|
28
|
+
push:
|
|
29
|
+
tags:
|
|
30
|
+
- "v[0-9]+.[0-9]+.[0-9]+*"
|
|
31
|
+
|
|
32
|
+
permissions:
|
|
33
|
+
contents: read
|
|
34
|
+
|
|
35
|
+
# Make sure CI fails on any warning, including Clippy lints
|
|
36
|
+
env:
|
|
37
|
+
RUSTFLAGS: "-Dwarnings"
|
|
38
|
+
|
|
39
|
+
jobs:
|
|
40
|
+
# A release tag must point into main's history: a tag pushed from an unmerged
|
|
41
|
+
# branch would otherwise run the suite, pass, and publish a commit that never
|
|
42
|
+
# lands on main (a squash merge rewrites the SHA, leaving the tag dangling).
|
|
43
|
+
# `rev-parse HEAD^{commit}` peels annotated tags, where the event SHA can be
|
|
44
|
+
# the tag object rather than the commit. On failure: delete the tag, merge the
|
|
45
|
+
# PR, re-tag the merge commit on main.
|
|
46
|
+
tag-on-main:
|
|
47
|
+
runs-on: ubuntu-latest
|
|
48
|
+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
49
|
+
steps:
|
|
50
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
51
|
+
with:
|
|
52
|
+
persist-credentials: false
|
|
53
|
+
fetch-depth: 0
|
|
54
|
+
- name: Verify the tagged commit is an ancestor of main
|
|
55
|
+
run: |
|
|
56
|
+
git fetch --no-tags origin main
|
|
57
|
+
git merge-base --is-ancestor "$(git rev-parse 'HEAD^{commit}')" origin/main
|
|
58
|
+
|
|
59
|
+
linux-just-test:
|
|
60
|
+
runs-on: ubuntu-latest
|
|
61
|
+
strategy:
|
|
62
|
+
fail-fast: false
|
|
63
|
+
matrix:
|
|
64
|
+
python-version: ["3.10", "3.11", "3.13", "3.14"]
|
|
65
|
+
steps:
|
|
66
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
67
|
+
with:
|
|
68
|
+
persist-credentials: false
|
|
69
|
+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
70
|
+
with:
|
|
71
|
+
python-version: ${{ matrix.python-version }}
|
|
72
|
+
enable-cache: true
|
|
73
|
+
- name: Set up Rust
|
|
74
|
+
run: rustup show
|
|
75
|
+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
|
|
76
|
+
- name: Build abi3 wheel
|
|
77
|
+
run: uvx maturin build --out dist
|
|
78
|
+
- name: Sync project dependencies
|
|
79
|
+
run: uv sync --group testing --no-install-project
|
|
80
|
+
- name: Install built wheel
|
|
81
|
+
run: uv pip install dist/*.whl
|
|
82
|
+
- name: Run tests
|
|
83
|
+
run: uv run --no-sync pytest tests
|
|
84
|
+
|
|
85
|
+
linux-min-versions-just-test:
|
|
86
|
+
runs-on: ubuntu-latest
|
|
87
|
+
steps:
|
|
88
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
89
|
+
with:
|
|
90
|
+
persist-credentials: false
|
|
91
|
+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
92
|
+
with:
|
|
93
|
+
# Mirrors pull-request.yml's test-oldest: the polars floor is exercised on the
|
|
94
|
+
# oldest python it publishes wheels for, not on the newest interpreter.
|
|
95
|
+
python-version: "3.12"
|
|
96
|
+
enable-cache: true
|
|
97
|
+
- name: Set up Rust
|
|
98
|
+
run: rustup show
|
|
99
|
+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
|
|
100
|
+
- name: Build abi3 wheel
|
|
101
|
+
run: uvx maturin build --out dist
|
|
102
|
+
- name: Sync project dependencies
|
|
103
|
+
run: uv sync --group testing --no-install-project
|
|
104
|
+
- name: Install built wheel
|
|
105
|
+
run: uv pip install dist/*.whl
|
|
106
|
+
- name: Pin polars to oldest supported version
|
|
107
|
+
run: uv pip install "polars==1.15.0"
|
|
108
|
+
- name: Run tests
|
|
109
|
+
run: uv run --no-sync pytest tests
|
|
110
|
+
|
|
111
|
+
linux:
|
|
112
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
113
|
+
strategy:
|
|
114
|
+
matrix:
|
|
115
|
+
platform:
|
|
116
|
+
- runner: ubuntu-22.04
|
|
117
|
+
target: x86_64
|
|
118
|
+
- runner: ubuntu-22.04
|
|
119
|
+
target: aarch64
|
|
120
|
+
steps:
|
|
121
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
122
|
+
with:
|
|
123
|
+
persist-credentials: false
|
|
124
|
+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
125
|
+
with:
|
|
126
|
+
python-version: 3.x
|
|
127
|
+
- name: Build wheels
|
|
128
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
129
|
+
with:
|
|
130
|
+
target: ${{ matrix.platform.target }}
|
|
131
|
+
args: --release --out dist
|
|
132
|
+
sccache: false
|
|
133
|
+
manylinux: auto
|
|
134
|
+
- name: Upload wheels
|
|
135
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
136
|
+
with:
|
|
137
|
+
name: wheels-linux-${{ matrix.platform.target }}
|
|
138
|
+
path: dist
|
|
139
|
+
|
|
140
|
+
windows:
|
|
141
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
142
|
+
strategy:
|
|
143
|
+
matrix:
|
|
144
|
+
platform:
|
|
145
|
+
- runner: windows-latest
|
|
146
|
+
target: x64
|
|
147
|
+
steps:
|
|
148
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
149
|
+
with:
|
|
150
|
+
persist-credentials: false
|
|
151
|
+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
152
|
+
with:
|
|
153
|
+
python-version: 3.x
|
|
154
|
+
architecture: ${{ matrix.platform.target }}
|
|
155
|
+
- name: Build wheels
|
|
156
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
157
|
+
with:
|
|
158
|
+
target: ${{ matrix.platform.target }}
|
|
159
|
+
args: --release --out dist
|
|
160
|
+
sccache: false
|
|
161
|
+
- name: Upload wheels
|
|
162
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
163
|
+
with:
|
|
164
|
+
name: wheels-windows-${{ matrix.platform.target }}
|
|
165
|
+
path: dist
|
|
166
|
+
|
|
167
|
+
macos:
|
|
168
|
+
runs-on: ${{ matrix.platform.runner }}
|
|
169
|
+
strategy:
|
|
170
|
+
matrix:
|
|
171
|
+
platform:
|
|
172
|
+
- runner: macos-15-intel
|
|
173
|
+
target: x86_64
|
|
174
|
+
- runner: macos-latest
|
|
175
|
+
target: aarch64
|
|
176
|
+
steps:
|
|
177
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
178
|
+
with:
|
|
179
|
+
persist-credentials: false
|
|
180
|
+
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
|
181
|
+
with:
|
|
182
|
+
python-version: 3.x
|
|
183
|
+
- name: Build wheels
|
|
184
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
185
|
+
with:
|
|
186
|
+
target: ${{ matrix.platform.target }}
|
|
187
|
+
args: --release --out dist
|
|
188
|
+
sccache: false
|
|
189
|
+
- name: Upload wheels
|
|
190
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
191
|
+
with:
|
|
192
|
+
name: wheels-macos-${{ matrix.platform.target }}
|
|
193
|
+
path: dist
|
|
194
|
+
|
|
195
|
+
sdist:
|
|
196
|
+
runs-on: ubuntu-latest
|
|
197
|
+
steps:
|
|
198
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
199
|
+
with:
|
|
200
|
+
persist-credentials: false
|
|
201
|
+
- name: Build sdist
|
|
202
|
+
uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1.51.0
|
|
203
|
+
with:
|
|
204
|
+
command: sdist
|
|
205
|
+
args: --out dist
|
|
206
|
+
- name: Upload sdist
|
|
207
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
208
|
+
with:
|
|
209
|
+
name: wheels-sdist
|
|
210
|
+
path: dist
|
|
211
|
+
|
|
212
|
+
release:
|
|
213
|
+
name: Release
|
|
214
|
+
runs-on: ubuntu-latest
|
|
215
|
+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
|
216
|
+
needs: [tag-on-main, linux-just-test, linux-min-versions-just-test, linux, windows, macos, sdist]
|
|
217
|
+
environment:
|
|
218
|
+
name: pypi
|
|
219
|
+
url: https://pypi.org/p/polars-stats
|
|
220
|
+
permissions:
|
|
221
|
+
# Required by attest-build-provenance to read the workflow context
|
|
222
|
+
contents: read
|
|
223
|
+
# Used to sign the attestations (Sigstore) and to mint the OIDC token for
|
|
224
|
+
# PyPI Trusted Publishing, no API token secret involved
|
|
225
|
+
id-token: write
|
|
226
|
+
# Used to persist the GitHub artifact attestation
|
|
227
|
+
attestations: write
|
|
228
|
+
steps:
|
|
229
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
230
|
+
with:
|
|
231
|
+
path: dist
|
|
232
|
+
merge-multiple: true
|
|
233
|
+
- name: Generate artifact attestation
|
|
234
|
+
uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
|
|
235
|
+
with:
|
|
236
|
+
subject-path: 'dist/*'
|
|
237
|
+
- name: Publish to PyPI
|
|
238
|
+
uses: pypa/gh-action-pypi-publish@ba38be9e461d3875417946c167d0b5f3d385a247 # v1.14.1
|
|
239
|
+
with:
|
|
240
|
+
# PEP 740 attestations are generated and uploaded by default with
|
|
241
|
+
# Trusted Publishing; spelled out here so the intent survives upgrades.
|
|
242
|
+
attestations: true
|
|
243
|
+
skip-existing: true
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
---
|
|
2
|
+
|
|
3
|
+
name: Pull Request
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
pull_request:
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
concurrency:
|
|
10
|
+
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }}
|
|
11
|
+
cancel-in-progress: true
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
env:
|
|
17
|
+
RUSTFLAGS: "-Dwarnings"
|
|
18
|
+
CARGO_TERM_COLOR: always
|
|
19
|
+
DEFAULT_PYTHON_VERSION: "3.13"
|
|
20
|
+
PYTHON_VERSIONS_LATEST: '["3.10", "3.11", "3.12", "3.13", "3.14"]'
|
|
21
|
+
PYTHON_VERSIONS_OLDEST: '["3.10", "3.11", "3.12"]'
|
|
22
|
+
POLARS_OLDEST: "1.15.0"
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
# `strategy.matrix` cannot read the workflow-level `env` context, so this
|
|
26
|
+
# job re-publishes the version lists as job outputs. Downstream matrices
|
|
27
|
+
# then read them via `needs.setup.outputs.*`, keeping `env:` above as the
|
|
28
|
+
# single source of truth.
|
|
29
|
+
setup:
|
|
30
|
+
name: setup
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
timeout-minutes: 1
|
|
33
|
+
outputs:
|
|
34
|
+
python-versions-latest: ${{ env.PYTHON_VERSIONS_LATEST }}
|
|
35
|
+
python-versions-oldest: ${{ env.PYTHON_VERSIONS_OLDEST }}
|
|
36
|
+
polars-oldest: ${{ env.POLARS_OLDEST }}
|
|
37
|
+
steps:
|
|
38
|
+
- run: 'true'
|
|
39
|
+
|
|
40
|
+
# NOTE: Rust lints stay in the dedicated `rust-lint` job (toolchain + cache concerns).
|
|
41
|
+
prek:
|
|
42
|
+
name: prek
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
timeout-minutes: 10
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
47
|
+
with:
|
|
48
|
+
persist-credentials: false
|
|
49
|
+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
50
|
+
- name: Cache hook environments
|
|
51
|
+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
52
|
+
with:
|
|
53
|
+
path: ~/.cache/prek
|
|
54
|
+
key: prek-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
|
|
55
|
+
- name: prek run
|
|
56
|
+
run: uvx prek run --all-files --show-diff-on-failure
|
|
57
|
+
env:
|
|
58
|
+
SKIP: no-commit-to-branch
|
|
59
|
+
|
|
60
|
+
# A `bump-version` release PR changes version strings only, so the expensive jobs
|
|
61
|
+
# skip on it (the narwhals pattern): the full suite runs once per release, at tag
|
|
62
|
+
# time, inside publish_to_pypi.yml on the exact release commit. `prek` still runs
|
|
63
|
+
# (it is the cheap job that validates the bump itself: the uv-lock hook and the
|
|
64
|
+
# CHANGELOG lint). Skipped required checks count as passing for branch protection.
|
|
65
|
+
rust-lint:
|
|
66
|
+
name: lint / cargo fmt + clippy
|
|
67
|
+
if: github.head_ref != 'bump-version'
|
|
68
|
+
runs-on: ubuntu-latest
|
|
69
|
+
timeout-minutes: 20
|
|
70
|
+
steps:
|
|
71
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
72
|
+
with:
|
|
73
|
+
persist-credentials: false
|
|
74
|
+
- name: Install pinned Rust toolchain
|
|
75
|
+
run: rustup show
|
|
76
|
+
# fmt runs on nightly (rustfmt.toml uses unstable options); everything else,
|
|
77
|
+
# clippy included, runs on the stable toolchain rust-toolchain.toml pins.
|
|
78
|
+
- name: Install nightly rustfmt
|
|
79
|
+
run: rustup toolchain install nightly --profile minimal --component rustfmt
|
|
80
|
+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
|
|
81
|
+
- name: cargo fmt
|
|
82
|
+
run: cargo +nightly fmt --all -- --check
|
|
83
|
+
- name: cargo clippy
|
|
84
|
+
run: cargo clippy --all-features --all-targets -- -D warnings
|
|
85
|
+
|
|
86
|
+
# Build the extension once as an abi3 wheel. The `abi3-py39` pyo3 feature
|
|
87
|
+
# means a single wheel runs on every CPython >= 3.9, so downstream
|
|
88
|
+
# typing / test jobs just download and pip-install it.
|
|
89
|
+
build:
|
|
90
|
+
name: build wheel
|
|
91
|
+
# Skipping this on `bump-version` also skips everything that needs it
|
|
92
|
+
# (typing, test-latest, test-oldest, docs-strict-build).
|
|
93
|
+
if: github.head_ref != 'bump-version'
|
|
94
|
+
runs-on: ubuntu-latest
|
|
95
|
+
timeout-minutes: 20
|
|
96
|
+
steps:
|
|
97
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
98
|
+
with:
|
|
99
|
+
persist-credentials: false
|
|
100
|
+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
101
|
+
with:
|
|
102
|
+
python-version: "3.10"
|
|
103
|
+
enable-cache: true
|
|
104
|
+
- name: Install pinned Rust toolchain
|
|
105
|
+
run: rustup show
|
|
106
|
+
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
|
|
107
|
+
with:
|
|
108
|
+
key: build-wheel
|
|
109
|
+
- name: Build abi3 wheel
|
|
110
|
+
run: uvx maturin build --out dist
|
|
111
|
+
- name: Upload wheel
|
|
112
|
+
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
113
|
+
with:
|
|
114
|
+
name: wheel
|
|
115
|
+
path: dist/*.whl
|
|
116
|
+
if-no-files-found: error
|
|
117
|
+
retention-days: 1
|
|
118
|
+
|
|
119
|
+
typing:
|
|
120
|
+
name: typing
|
|
121
|
+
needs: build
|
|
122
|
+
runs-on: ubuntu-latest
|
|
123
|
+
timeout-minutes: 20
|
|
124
|
+
steps:
|
|
125
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
126
|
+
with:
|
|
127
|
+
persist-credentials: false
|
|
128
|
+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
129
|
+
with:
|
|
130
|
+
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
|
|
131
|
+
enable-cache: true
|
|
132
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
133
|
+
with:
|
|
134
|
+
name: wheel
|
|
135
|
+
path: dist
|
|
136
|
+
- name: Sync project dependencies
|
|
137
|
+
run: uv sync --group typing --no-install-project
|
|
138
|
+
- name: Install built wheel
|
|
139
|
+
run: uv pip install dist/*.whl
|
|
140
|
+
- name: Show resolved dependencies
|
|
141
|
+
run: uv export --no-annotate --no-hashes --group typing
|
|
142
|
+
- name: pyrefly
|
|
143
|
+
run: uv run --no-sync pyrefly check .
|
|
144
|
+
- name: pyright
|
|
145
|
+
run: uv run --no-sync pyright .
|
|
146
|
+
- name: mypy
|
|
147
|
+
run: uv run --no-sync mypy .
|
|
148
|
+
|
|
149
|
+
test-latest:
|
|
150
|
+
name: test-latest / py${{ matrix.python-version }}
|
|
151
|
+
needs: [setup, build]
|
|
152
|
+
runs-on: ubuntu-latest
|
|
153
|
+
timeout-minutes: 30
|
|
154
|
+
strategy:
|
|
155
|
+
fail-fast: false
|
|
156
|
+
matrix:
|
|
157
|
+
python-version: ${{ fromJSON(needs.setup.outputs.python-versions-latest) }}
|
|
158
|
+
steps:
|
|
159
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
160
|
+
with:
|
|
161
|
+
persist-credentials: false
|
|
162
|
+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
163
|
+
with:
|
|
164
|
+
python-version: ${{ matrix.python-version }}
|
|
165
|
+
enable-cache: true
|
|
166
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
167
|
+
with:
|
|
168
|
+
name: wheel
|
|
169
|
+
path: dist
|
|
170
|
+
- name: Sync project dependencies
|
|
171
|
+
run: uv sync --group testing --no-install-project
|
|
172
|
+
- name: Install built wheel
|
|
173
|
+
run: uv pip install dist/*.whl
|
|
174
|
+
- name: Show resolved dependencies
|
|
175
|
+
run: uv export --no-annotate --no-hashes --group testing
|
|
176
|
+
- name: Run tests
|
|
177
|
+
run: uv run --no-sync pytest tests
|
|
178
|
+
|
|
179
|
+
test-oldest:
|
|
180
|
+
name: test-oldest / py${{ matrix.python-version }} polars-${{ needs.setup.outputs.polars-oldest }}
|
|
181
|
+
needs: [setup, build]
|
|
182
|
+
runs-on: ubuntu-latest
|
|
183
|
+
timeout-minutes: 30
|
|
184
|
+
strategy:
|
|
185
|
+
fail-fast: false
|
|
186
|
+
matrix:
|
|
187
|
+
python-version: ${{ fromJSON(needs.setup.outputs.python-versions-oldest) }}
|
|
188
|
+
steps:
|
|
189
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
190
|
+
with:
|
|
191
|
+
persist-credentials: false
|
|
192
|
+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
193
|
+
with:
|
|
194
|
+
python-version: ${{ matrix.python-version }}
|
|
195
|
+
enable-cache: true
|
|
196
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
197
|
+
with:
|
|
198
|
+
name: wheel
|
|
199
|
+
path: dist
|
|
200
|
+
- name: Sync project dependencies
|
|
201
|
+
run: uv sync --group testing --no-install-project
|
|
202
|
+
- name: Install built wheel
|
|
203
|
+
run: uv pip install dist/*.whl
|
|
204
|
+
- name: Pin polars to oldest supported version
|
|
205
|
+
run: uv pip install "polars==${NEEDS_SETUP_OUTPUTS_POLARS_OLDEST}"
|
|
206
|
+
env:
|
|
207
|
+
NEEDS_SETUP_OUTPUTS_POLARS_OLDEST: ${{ needs.setup.outputs.polars-oldest }}
|
|
208
|
+
- name: Show resolved dependencies
|
|
209
|
+
run: uv export --no-annotate --no-hashes --group testing
|
|
210
|
+
- name: Run tests
|
|
211
|
+
run: uv run --no-sync pytest tests
|
|
212
|
+
|
|
213
|
+
docs-strict-build:
|
|
214
|
+
name: docs-strict-build
|
|
215
|
+
needs: build
|
|
216
|
+
runs-on: ubuntu-latest
|
|
217
|
+
timeout-minutes: 20
|
|
218
|
+
steps:
|
|
219
|
+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
|
|
220
|
+
with:
|
|
221
|
+
persist-credentials: false
|
|
222
|
+
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
|
|
223
|
+
with:
|
|
224
|
+
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
|
|
225
|
+
enable-cache: true
|
|
226
|
+
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
227
|
+
with:
|
|
228
|
+
name: wheel
|
|
229
|
+
path: dist
|
|
230
|
+
- name: Sync project dependencies
|
|
231
|
+
run: uv sync --group docs --no-install-project
|
|
232
|
+
- name: Install built wheel
|
|
233
|
+
run: uv pip install dist/*.whl
|
|
234
|
+
- name: Show resolved dependencies
|
|
235
|
+
run: uv export --no-annotate --no-hashes --group docs
|
|
236
|
+
- name: Zensical strict build
|
|
237
|
+
run: uv run --no-sync zensical build --strict
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
*__pycache__/
|
|
3
|
+
*.pyc
|
|
4
|
+
|
|
5
|
+
# Distribution / packaging
|
|
6
|
+
dist/
|
|
7
|
+
target/
|
|
8
|
+
*.so
|
|
9
|
+
*.dll
|
|
10
|
+
*.pyd
|
|
11
|
+
|
|
12
|
+
# Virtual envs
|
|
13
|
+
venv
|
|
14
|
+
.venv
|
|
15
|
+
|
|
16
|
+
# Testing
|
|
17
|
+
.hypothesis/
|
|
18
|
+
.benchmarks/
|
|
19
|
+
benchmark.json
|
|
20
|
+
# Generated comparison reports (machine-specific timings); publish curated tables in the README/docs.
|
|
21
|
+
benchmarks/results/
|
|
22
|
+
.coverage
|
|
23
|
+
.coverage.*
|
|
24
|
+
coverage.xml
|
|
25
|
+
|
|
26
|
+
# Various tools caches
|
|
27
|
+
.cache/
|
|
28
|
+
.mypy_cache/
|
|
29
|
+
.pytest_cache/
|
|
30
|
+
.ruff_cache/
|
|
31
|
+
.rumdl_cache/
|
|
32
|
+
|
|
33
|
+
# Documentation
|
|
34
|
+
site/
|
|
35
|
+
|
|
36
|
+
# VSCode
|
|
37
|
+
.vscode/
|
|
38
|
+
|
|
39
|
+
# IntelliJ IDEA / PyCharm
|
|
40
|
+
.idea/
|
|
41
|
+
|
|
42
|
+
# MacOS
|
|
43
|
+
.DS_Store
|
|
44
|
+
|
|
45
|
+
# Local planning docs
|
|
46
|
+
tasks/
|
|
47
|
+
plans/
|
|
48
|
+
statrs-issues/
|
|
49
|
+
|
|
50
|
+
# Numerical precision summary
|
|
51
|
+
audit-findings.md
|
|
52
|
+
|
|
53
|
+
# Local clone of the upstream crate, for cross-project work. Never committed.
|
|
54
|
+
statrs/
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
---
|
|
2
|
+
repos:
|
|
3
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
4
|
+
rev: 'v0.15.20'
|
|
5
|
+
hooks:
|
|
6
|
+
- id: ruff-format
|
|
7
|
+
pass_filenames: false
|
|
8
|
+
- id: ruff-check
|
|
9
|
+
pass_filenames: false
|
|
10
|
+
- repo: https://github.com/astral-sh/uv-pre-commit
|
|
11
|
+
rev: 0.11.26
|
|
12
|
+
hooks:
|
|
13
|
+
- id: uv-lock
|
|
14
|
+
- repo: https://github.com/rvben/rumdl-pre-commit
|
|
15
|
+
rev: v0.2.28
|
|
16
|
+
hooks:
|
|
17
|
+
- id: rumdl
|
|
18
|
+
- repo: https://github.com/owenlamont/ryl-pre-commit
|
|
19
|
+
rev: v0.21.0
|
|
20
|
+
hooks:
|
|
21
|
+
- id: ryl
|
|
22
|
+
args: [".", "--strict"]
|
|
23
|
+
- repo: https://github.com/codespell-project/codespell
|
|
24
|
+
rev: 'v2.4.2'
|
|
25
|
+
hooks:
|
|
26
|
+
- id: codespell
|
|
27
|
+
files: \.(py|rst|md)$
|
|
28
|
+
- repo: https://github.com/adhtruong/mirrors-typos
|
|
29
|
+
# Use mirror to avoid autoupdate issue: https://github.com/crate-ci/typos/issues/390
|
|
30
|
+
rev: 'v1.48.0'
|
|
31
|
+
hooks:
|
|
32
|
+
- id: typos
|
|
33
|
+
- repo: https://github.com/adamchainz/blacken-docs
|
|
34
|
+
rev: "1.20.0"
|
|
35
|
+
hooks:
|
|
36
|
+
- id: blacken-docs
|
|
37
|
+
args: [ --skip-errors ]
|
|
38
|
+
additional_dependencies:
|
|
39
|
+
- black==22.12.0
|
|
40
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
41
|
+
rev: v6.0.0
|
|
42
|
+
hooks:
|
|
43
|
+
- id: trailing-whitespace
|
|
44
|
+
- id: name-tests-test
|
|
45
|
+
exclude: |
|
|
46
|
+
(?x)^(
|
|
47
|
+
tests/_polars_compat.py|
|
|
48
|
+
tests/property/_specs.py|
|
|
49
|
+
tests/scipy_parity/_harness.py
|
|
50
|
+
)$
|
|
51
|
+
- id: end-of-file-fixer
|
|
52
|
+
- id: no-commit-to-branch
|
|
53
|
+
- id: check-json
|
|
54
|
+
- id: check-yaml
|
|
55
|
+
- id: check-ast
|
|
56
|
+
- id: check-added-large-files
|