clusterkit 0.2.6 → 0.3.1.pre.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 82e58cc0e1f7e5b5d918b67b015ca766f43c7977bce8675cccc55db718d6b9f0
4
- data.tar.gz: 5461afea288ab1801b77f04dc0b360c2c6a70665d533ce81d433207f8aadd2e3
3
+ metadata.gz: 912a056ca7672bd2817381a5ad88d0c1e30db9d6b12be545f36b42abc6d725eb
4
+ data.tar.gz: 12cc9f11080f4621f316fbf76a707df0808b50e18dff06117938de029db7c042
5
5
  SHA512:
6
- metadata.gz: 934c99e049dc701134d666d172fbbd9fa7807c4be1f84bb2116167633e3f0f12f1a409f05ea5d847c3e06fe6d6a0c7281c5a91852454d4be599001c4f09284a7
7
- data.tar.gz: 3cc3420b3a73b5e4df364f9a67fe39b1f4ee20545ca3a86776d5be9a47d19fcdcc43e4ed32cf9216c727723bd9f8a23c54719df25f01ea38cfcb5cf0b354406c
6
+ metadata.gz: 9db521f6cc552ca876f9e90f76e1c3bc8399a1e3ba21d0460f5b3a4a8dde7007b433d259a4b76319b671f66f8937993e104a1876a4e04580838a46a793d7fc97
7
+ data.tar.gz: f0b05b6c11792f583040acd038969be71adc56685c6aa181845bfe16b0fdd94cf3596aa4812e162748f535570326f1b5450aab25a40a5ae26761cdf5052e87b6
data/Cargo.lock CHANGED
@@ -247,16 +247,14 @@ dependencies = [
247
247
 
248
248
  [[package]]
249
249
  name = "bindgen"
250
- version = "0.69.5"
250
+ version = "0.72.1"
251
251
  source = "registry+https://github.com/rust-lang/crates.io-index"
252
- checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088"
252
+ checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895"
253
253
  dependencies = [
254
254
  "bitflags 2.9.2",
255
255
  "cexpr",
256
256
  "clang-sys",
257
257
  "itertools",
258
- "lazy_static",
259
- "lazycell",
260
258
  "proc-macro2",
261
259
  "quote",
262
260
  "regex",
@@ -1304,12 +1302,6 @@ version = "1.5.0"
1304
1302
  source = "registry+https://github.com/rust-lang/crates.io-index"
1305
1303
  checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
1306
1304
 
1307
- [[package]]
1308
- name = "lazycell"
1309
- version = "1.3.0"
1310
- source = "registry+https://github.com/rust-lang/crates.io-index"
1311
- checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
1312
-
1313
1305
  [[package]]
1314
1306
  name = "libc"
1315
1307
  version = "0.2.175"
@@ -1323,7 +1315,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1323
1315
  checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667"
1324
1316
  dependencies = [
1325
1317
  "cfg-if",
1326
- "windows-targets 0.48.5",
1318
+ "windows-targets 0.52.6",
1327
1319
  ]
1328
1320
 
1329
1321
  [[package]]
@@ -1970,18 +1962,18 @@ dependencies = [
1970
1962
 
1971
1963
  [[package]]
1972
1964
  name = "rb-sys"
1973
- version = "0.9.124"
1965
+ version = "0.9.128"
1974
1966
  source = "registry+https://github.com/rust-lang/crates.io-index"
1975
- checksum = "c85c4188462601e2aa1469def389c17228566f82ea72f137ed096f21591bc489"
1967
+ checksum = "45ca28513560e56cfb79a62b1fce363c73af170a182024ce880c77ee9429920a"
1976
1968
  dependencies = [
1977
1969
  "rb-sys-build",
1978
1970
  ]
1979
1971
 
1980
1972
  [[package]]
1981
1973
  name = "rb-sys-build"
1982
- version = "0.9.124"
1974
+ version = "0.9.128"
1983
1975
  source = "registry+https://github.com/rust-lang/crates.io-index"
1984
- checksum = "568068db4102230882e6d4ae8de6632e224ca75fe5970f6e026a04e91ed635d3"
1976
+ checksum = "ce04b2c55eff3a21aaa623fcc655d94373238e72cac6b3e1a3641ff31649f99a"
1985
1977
  dependencies = [
1986
1978
  "bindgen",
1987
1979
  "lazy_static",
@@ -2074,9 +2066,9 @@ dependencies = [
2074
2066
 
2075
2067
  [[package]]
2076
2068
  name = "rustc-hash"
2077
- version = "1.1.0"
2069
+ version = "2.1.2"
2078
2070
  source = "registry+https://github.com/rust-lang/crates.io-index"
2079
- checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
2071
+ checksum = "94300abf3f1ae2e2b8ffb7b58043de3d399c73fa6f4b73826402a5c457614dbe"
2080
2072
 
2081
2073
  [[package]]
2082
2074
  name = "rustix"
data/Rakefile CHANGED
@@ -1,17 +1,31 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rake/extensiontask"
3
- require "rspec/core/rake_task"
4
3
 
5
- # RSpec test task
6
- RSpec::Core::RakeTask.new(:spec)
4
+ # rspec is a DEVELOPMENT-only dependency. The cross-compile build container
5
+ # (rb-sys-dock, via scientist-labs/rust-gem-release) installs the runtime bundle
6
+ # only, so this require would raise LoadError and abort `rake` before the native
7
+ # build task can run. Guard it so this Rakefile always loads; the spec task simply
8
+ # isn't available in a build-only environment.
9
+ begin
10
+ require "rspec/core/rake_task"
11
+ RSpec::Core::RakeTask.new(:spec)
12
+ rescue LoadError
13
+ desc "run specs (rspec unavailable in this environment)"
14
+ task(:spec) { abort "rspec is a development dependency and is not installed here" }
15
+ end
7
16
 
8
- # Define the Rust extension
9
- spec = Gem::Specification.load("clusterkit.gemspec")
10
- Rake::ExtensionTask.new("clusterkit", spec) do |ext|
17
+ # Define the Rust extension. Passing the loaded gemspec to ExtensionTask makes
18
+ # rake-compiler expose the `native:<platform>` tasks rb-sys-dock invokes for each
19
+ # precompiled leg; without it the cross build fails with "Don't know how to build task".
20
+ GEMSPEC = Gem::Specification.load("clusterkit.gemspec")
21
+ Rake::ExtensionTask.new("clusterkit", GEMSPEC) do |ext|
11
22
  ext.lib_dir = "lib/clusterkit"
12
23
  ext.source_pattern = "*.{rs,toml}"
13
24
  ext.cross_compile = true
14
- ext.cross_platform = %w[x86-mingw32 x64-mingw32 x86-linux x86_64-linux x86_64-darwin arm64-darwin]
25
+ # Union of the precompiled targets this gem ships: both glibc linux arches
26
+ # (assembled by oxidize-rb cross-gem in rb-sys-dock) plus Apple Silicon
27
+ # (built natively on a macOS runner).
28
+ ext.cross_platform = %w[x86_64-linux aarch64-linux arm64-darwin]
15
29
  end
16
30
 
17
31
  task default: [:compile, :spec]
@@ -7,8 +7,7 @@ edition = "2021"
7
7
  crate-type = ["cdylib"]
8
8
 
9
9
  [dependencies]
10
- magnus = { version = "0.8", features = ["embed"] }
11
- annembed = { git = "https://github.com/scientist-labs/annembed", tag = "clusterkit-0.2.6" }
10
+ magnus = "0.8"annembed = { git = "https://github.com/scientist-labs/annembed", tag = "clusterkit-0.2.6" }
12
11
  hnsw_rs = { git = "https://github.com/scientist-labs/hnswlib-rs", tag = "clusterkit-0.1.0" }
13
12
  hdbscan = "0.11"
14
13
  ndarray = "0.16"
@@ -3,10 +3,21 @@ require "rb_sys/mkmf"
3
3
 
4
4
  create_rust_makefile("clusterkit/clusterkit") do |r|
5
5
  if ENV["CLUSTERKIT_FEATURES"]
6
+ # Explicit override wins (set CLUSTERKIT_FEATURES=openblas-static,... to force a backend).
6
7
  r.extra_cargo_args += ["--no-default-features"]
7
8
  r.features = ENV["CLUSTERKIT_FEATURES"].split(",")
8
9
  elsif RUBY_PLATFORM =~ /darwin/
10
+ # macOS links the system Accelerate framework — no OpenBLAS build needed.
9
11
  r.extra_cargo_args += ["--no-default-features"]
10
12
  r.features = ["macos-accelerate"]
13
+ elsif RUBY_PLATFORM =~ /linux/
14
+ # Linux: link the SYSTEM OpenBLAS/LAPACK (apt: libopenblas-dev liblapack-dev
15
+ # gfortran, provided by the rust-gem-cross image) instead of the default
16
+ # `openblas-static` feature, which compiles OpenBLAS from C+Fortran source.
17
+ # rb-sys-dock does NOT forward host env to extconf and a .cargo/config.toml
18
+ # [env] only reaches cargo-spawned procs (not mkmf), so this backend choice
19
+ # must live in committed code — it cannot be passed via a workflow input.
20
+ r.extra_cargo_args += ["--no-default-features"]
21
+ r.features = ["openblas-system"]
11
22
  end
12
23
  end
@@ -1,9 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Load the compiled Rust extension. Precompiled (platform) gems install it into a
4
+ # Ruby-ABI-versioned subdir (lib/clusterkit/<major.minor>/clusterkit.{so,bundle}) so a
5
+ # single fat gem can carry a binary per Ruby version; source/dev builds place it flat at
6
+ # lib/clusterkit/clusterkit.{so,bundle}. Try the versioned path first, fall back to the
7
+ # flat one. Resolution goes through $LOAD_PATH (`require`, never `require_relative`)
8
+ # because RubyGems installs native extensions outside the gem's lib/ dir.
3
9
  begin
4
- # Try to load the compiled extension
5
- require_relative "clusterkit.bundle"
10
+ RUBY_VERSION =~ /(\d+\.\d+)/
11
+ require "clusterkit/#{Regexp.last_match(1)}/clusterkit"
6
12
  rescue LoadError
7
- # If that fails, try the .so extension (Linux)
8
- require_relative "clusterkit.so"
9
- end
13
+ require "clusterkit/clusterkit"
14
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ClusterKit
4
- VERSION = "0.2.6"
4
+ VERSION = "0.3.1.pre.1"
5
5
  end
data/lib/clusterkit.rb CHANGED
@@ -1,7 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative "clusterkit/version"
4
- require "clusterkit/clusterkit"
4
+
5
+ # Load the native extension. Precompiled platform gems install one .so/.bundle per
6
+ # Ruby ABI under lib/clusterkit/<major.minor>/, while a source build (and the native
7
+ # darwin gem) produce the flat lib/clusterkit/clusterkit.{so,bundle}. Try the
8
+ # versioned path first, then fall back to flat. Use `require` (not
9
+ # `require_relative`) so RubyGems can resolve the extension through $LOAD_PATH when
10
+ # it installs native artifacts outside lib/.
11
+ begin
12
+ RUBY_VERSION =~ /(\d+\.\d+)/
13
+ require "clusterkit/#{Regexp.last_match(1)}/clusterkit"
14
+ rescue LoadError
15
+ require "clusterkit/clusterkit"
16
+ end
17
+
5
18
  require_relative "clusterkit/configuration"
6
19
 
7
20
  # Main module for ClusterKit gem
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clusterkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.3.1.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Petersen
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2026-03-26 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rb_sys
@@ -192,7 +191,6 @@ metadata:
192
191
  homepage_uri: https://github.com/scientist-labs/clusterkit
193
192
  source_code_uri: https://github.com/scientist-labs/clusterkit
194
193
  changelog_uri: https://github.com/scientist-labs/clusterkit/blob/main/CHANGELOG.md
195
- post_install_message:
196
194
  rdoc_options: []
197
195
  require_paths:
198
196
  - lib
@@ -207,8 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
205
  - !ruby/object:Gem::Version
208
206
  version: '0'
209
207
  requirements: []
210
- rubygems_version: 3.5.22
211
- signing_key:
208
+ rubygems_version: 3.6.9
212
209
  specification_version: 4
213
210
  summary: High-performance clustering and dimensionality reduction for Ruby
214
211
  test_files: []