diff --git a/poetry.lock b/poetry.lock index 4f7df20..fa569ee 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2667,4 +2667,4 @@ propcache = ">=0.2.0" [metadata] lock-version = "2.0" python-versions = ">=3.12,<4" -content-hash = "5f0fc280f2f3b2d03370fe4c9d36ed50690531a63e36bbe7b16ab25fa42fc9bf" +content-hash = "cb0b1644c46f0d08fe5d4b8b6f517b2e760a56572250a4d87165905c1307e981" diff --git a/polars_chip_install.py b/polars_chip_install.py new file mode 100644 index 0000000..fd6543e --- /dev/null +++ b/polars_chip_install.py @@ -0,0 +1,17 @@ +import platform +import subprocess +import sys + +def is_rosetta(): + return platform.machine() == "x86_64" + +def install_polars(): + if is_rosetta(): + print("Installing Rosetta compliant polars") + subprocess.run(["poetry", "add", "polars-lts-cpu"]) + else: + print("Installing regular polars") + subprocess.run(["poetry", "add", "polars"]) + +if __name__ == "__main__": + install_polars() \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 631ced8..96d540a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ fsspec = "^2024.6.1" pyarrow = "^18.0.0" boto3 = "~1.34.0" s3fs = "^2024.9.0" +polars = "^1.14.0" [tool.poetry.group.polars] optional=true @@ -54,6 +55,7 @@ typer = "^0.13.1" [tool.poetry.scripts] cfpb-val = 'regtech_data_validator.cli:app' +install-polars = 'polars_chip_install:install_polars' # Black formatting [tool.black]