From c0082023f4453269947d283454e97c2643f6cf73 Mon Sep 17 00:00:00 2001 From: abstractqqq Date: Tue, 27 Feb 2024 20:19:43 -0500 Subject: [PATCH] use uv in building env --- CONTRIBUTING.md | 6 +++++- Cargo.lock | 3 +-- Cargo.toml | 6 +++--- Makefile | 34 ++++++++++++++++++++-------------- pyproject.toml | 2 +- python/polars_ds/__init__.py | 2 +- requirements.txt | 1 + src/graph/degree.rs | 1 - 8 files changed, 32 insertions(+), 23 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index da96199..83f04d1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 \ No newline at end of file +2. cargo fmt + +## How to get started? + +Take a look at the Makefile. \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index eaa990d..0b0a026 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1055,7 +1055,6 @@ dependencies = [ "num-integer", "num-traits", "rawpointer", - "rayon", ] [[package]] @@ -1620,7 +1619,7 @@ dependencies = [ [[package]] name = "polars_ds" -version = "0.3.3" +version = "0.3.4" dependencies = [ "faer", "hashbrown", diff --git a/Cargo.toml b/Cargo.toml index 5ab9965..5693965 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "polars_ds" -version = "0.3.3" +version = "0.3.4" edition = "2021" [lib] @@ -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" diff --git a/Makefile b/Makefile index d7a777a..0050cdd 100644 --- a/Makefile +++ b/Makefile @@ -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 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 951bf89..d14450f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [ diff --git a/python/polars_ds/__init__.py b/python/polars_ds/__init__.py index ea3be71..6da985b 100644 --- a/python/polars_ds/__init__.py +++ b/python/polars_ds/__init__.py @@ -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"] diff --git a/requirements.txt b/requirements.txt index 50b2ba2..7d79aca 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ maturin[patchelf] polars +pre-commit \ No newline at end of file diff --git a/src/graph/degree.rs b/src/graph/degree.rs index b008362..2641bd8 100644 --- a/src/graph/degree.rs +++ b/src/graph/degree.rs @@ -1,6 +1,5 @@ use petgraph::{ stable_graph::NodeIndex, - visit::GetAdjacencyMatrix, Direction::{Incoming, Outgoing}, }; use polars::prelude::*;