Skip to content

Commit

Permalink
The first version
Browse files Browse the repository at this point in the history
  • Loading branch information
habedi committed Feb 12, 2025
1 parent cc25589 commit 1d8a6ad
Show file tree
Hide file tree
Showing 39 changed files with 1,361 additions and 840 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/build_linux.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/build_macos.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/build_windows.yml

This file was deleted.

134 changes: 0 additions & 134 deletions .github/workflows/release.yml

This file was deleted.

32 changes: 20 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
[package]
name = "template-rust-project"
version = "0.2.3"
description = "A template for Rust projects"
repository = "https://github.com/habedi/template-rust-project"
name = "vq"
version = "0.1.0"
description = "A vector quantization library for Rust"
repository = "https://github.com/habedi/vq"
license = "MIT OR Apache-2.0"
readme = "README.md"
keywords = ["project-template", "rust", "library", "application"]
keywords = ["vq", "vector-quantization", "clustering", "nearest-neighbor", "data-compression"]
authors = ["Hassan Abedi <hassan.abedi.t@gmail.com>"]
homepage = "https://github.com/habedi/template-rust-project"
documentation = "https://docs.rs/template-rust-project"
homepage = "https://github.com/habedi/vq"
documentation = "https://docs.rs/vq"
#categories = ["development-tools"]
edition = "2021"

[lib]
name = "template_rust_project"
name = "vq"
path = "src/lib.rs"

[[bin]]
name = "template-rust-project"
name = "vq"
path = "src/main.rs"

[dependencies]
clap = "4.5.27"
log = "0.4.25"
tracing = "0.1.41"
tracing-subscriber = "0.3.19"
ctor = "0.2.9"
rand = "0.9.0"
half = "2.4.1"
nalgebra = "0.33.2"

[dev-dependencies]
[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }

[[bench]]
name = "my_benchmarks"
harness = false
27 changes: 20 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Variables
PKG = github.com/habedi/template-rust-project
PKG = github.com/habedi/vq
BINARY_NAME = $(or $(PROJ_BINARY), $(notdir $(PKG)))
BINARY = target/release/$(BINARY_NAME)
PATH := /snap/bin:$(PATH)
CARGO_TERM_COLOR = always
DEBUG_VQ = 0

# Default target
.DEFAULT_GOAL := help
Expand All @@ -19,22 +21,22 @@ format: ## Format Rust files
.PHONY: test
test: format ## Run tests
@echo "Running tests..."
cargo test -- --nocapture
DEBUG_VQ=$(DEBUG_VQ) cargo test -- --nocapture

.PHONY: coverage
coverage: format ## Generate test coverage report
@echo "Generating test coverage report..."
cargo tarpaulin --out Xml --out Html
DEBUG_VQ=$(DEBUG_VQ) cargo tarpaulin --out Xml --out Html

.PHONY: build
build: format ## Build the binary for the current platform
@echo "Building the project..."
cargo build --release
DEBUG_VQ=$(DEBUG_VQ) cargo build --release

.PHONY: run
run: build ## Build and run the binary
@echo "Running the $(BINARY) binary..."
./$(BINARY)
DEBUG_VQ=$(DEBUG_VQ) ./$(BINARY)

.PHONY: clean
clean: ## Remove generated and temporary files
Expand All @@ -54,13 +56,24 @@ install-deps: install-snap ## Install development dependencies
@echo "Installing dependencies..."
rustup component add rustfmt clippy
cargo install cargo-tarpaulin
cargo install cargo-audit

.PHONY: lint
lint: format ## Run linters on Rust files
@echo "Linting Rust files..."
cargo clippy -- -D warnings
DEBUG_VQ=$(DEBUG_VQ) cargo clippy -- -D warnings

.PHONY: publish
publish: ## Publish the package to crates.io (requires CARGO_REGISTRY_TOKEN to be set)
@echo "Publishing the package to Cargo registry..."
cargo publish --token $(CARGO_REGISTRY_TOKEN)
cargo publish --token $(CARGO_REGISTRY_TOKEN)

.PHONY: bench
bench: ## Run benchmarks
@echo "Running benchmarks..."
DEBUG_VQ=$(DEBUG_VQ) cargo bench

.PHONY: audit
audit: ## Run security audit on Rust dependencies
@echo "Running security audit..."
cargo audit
Loading

0 comments on commit 1d8a6ad

Please sign in to comment.