Skip to content

Commit

Permalink
use uv in building env
Browse files Browse the repository at this point in the history
  • Loading branch information
abstractqqq committed Feb 28, 2024
1 parent 0a0e456 commit c008202
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 23 deletions.
6 changes: 5 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ For all feature related work, it would be great to ask yourself the following qu

## Remember to run these before committing:
1. pre-commit. We use ruff.
2. cargo fmt
2. cargo fmt

## How to get started?

Take a look at the Makefile.
3 changes: 1 addition & 2 deletions Cargo.lock

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

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "polars_ds"
version = "0.3.3"
version = "0.3.4"
edition = "2021"

[lib]
Expand All @@ -16,10 +16,10 @@ polars = {version = "0.37", features = ["performant", "lazy", "dtype-array", "ar
num = "0.4.1"
faer = {version = "0.16", features = ["ndarray", "nightly"]}
serde = {version = "*", features=["derive"]}
ndarray = {version="0.15.6", features=["rayon"]}
ndarray = {version="0.15.6"}
hashbrown = {version = "0.14.2", features=["nightly"]}
itertools = "0.12.0"
rand = {version = "0.8.5"} # Simd support feature seems to be broken atm
rand = {version = "0.8.5"}
rand_distr = "0.4.3"
realfft = "3.3.0"
rapidfuzz = "0.5.0"
Expand Down
34 changes: 20 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,29 @@
SHELL=/bin/bash

venv: ## Set up virtual environment
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
VENV=.venv

install: venv
unset CONDA_PREFIX && \
source .venv/bin/activate && maturin develop -m Cargo.toml
ifeq ($(OS),Windows_NT)
VENV_BIN=$(VENV)/Scripts
else
VENV_BIN=$(VENV)/bin
endif

.venv:
python3 -m venv $(VENV)
$(MAKE) dev-requirements

requirements: .venv
@unset CONDA_PREFIX \
&& $(VENV_BIN)/python -m pip install --upgrade uv \
&& $(VENV_BIN)/uv pip install --upgrade -r requirements.txt \
&& $(VENV_BIN)/uv pip install --upgrade -r requirements.txt \
&& $(VENV_BIN)/uv pip install --upgrade -r tests/requirements-test.txt \
&& $(VENV_BIN)/uv pip install --upgrade -r docs/requirements-docs.txt \

dev-release: venv
dev-release: .venv
unset CONDA_PREFIX && \
source .venv/bin/activate && maturin develop --release -m Cargo.toml

pre-commit: venv
pre-commit: .venv
cargo fmt
pre-commit run --all-files

# run: install
# source .venv/bin/activate && python run.py

# run-release: install-release
# source venv/bin/activate && python run.py
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "maturin"
[project]
name = "polars_ds"
requires-python = ">=3.8"
version = "0.3.3"
version = "0.3.4"

license = {file = "LICENSE.txt"}
classifiers = [
Expand Down
2 changes: 1 addition & 1 deletion python/polars_ds/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from polars_ds.metrics import MetricExt # noqa: E402
from polars_ds.graph import GraphExt # noqa: E402

__version__ = "0.3.3"
__version__ = "0.3.4"
__all__ = ["NumExt", "StrExt", "StatsExt", "ComplexExt", "MetricExt", "GraphExt"]


Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
maturin[patchelf]
polars
pre-commit
1 change: 0 additions & 1 deletion src/graph/degree.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use petgraph::{
stable_graph::NodeIndex,
visit::GetAdjacencyMatrix,
Direction::{Incoming, Outgoing},
};
use polars::prelude::*;
Expand Down

0 comments on commit c008202

Please sign in to comment.