Skip to content

Commit

Permalink
Trying out a polars chip script
Browse files Browse the repository at this point in the history
  • Loading branch information
jcadam14 committed Nov 22, 2024
1 parent cf1f53b commit baf9297
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions polars_chip_install.py
Original file line number Diff line number Diff line change
@@ -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()
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit baf9297

Please sign in to comment.