Skip to content

Commit

Permalink
Change crate names to be more idiomatic
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed May 30, 2024
1 parent 16af91d commit 7f2ab45
Show file tree
Hide file tree
Showing 37 changed files with 42 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ jobs:
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist --manifest-path crates/pymic2/Cargo.toml
args: --out dist --manifest-path crates/mic2-py/Cargo.toml
- name: Upload sdist
uses: actions/upload-artifact@v4
with:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Rust
name: Rust & C

on:
push:
Expand Down Expand Up @@ -97,15 +97,16 @@ jobs:
--package mic2 -vv
${{ matrix.cargo }} test \
--target ${{ matrix.target }} \
--package libmic2 -vv
--package mic2-c -vv
shell: bash
if: '!matrix.notest'

- name: Test python package (native only)
if: matrix.cargo == 'cargo'
run: >
${{ matrix.cargo }} test \
--target ${{ matrix.target }} \
--package mic2_python
--package mic2-py
fmt:
name: formatting
Expand Down
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ build_sfml/
*.a
*.la
*.lo
*.rlib

# Shared objects (inc. Windows DLLs)
*.dll
Expand Down Expand Up @@ -130,6 +131,14 @@ share/python-wheels/
*.egg
MANIFEST

# CMake files
CMakeFiles/
CMakeCache.txt
CTestTestfile.cmake
.rustc_info.json
cmake_install.cmake
crates/mic2-c/release/

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
Expand Down Expand Up @@ -261,4 +270,4 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
#.idea/
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project(libmic2 LANGUAGES C CXX)

enable_testing()

add_subdirectory(crates/libmic2)
add_subdirectory(crates/mic2-c)

option(BUILD_EXAMPLES "Build examples" OFF)

Expand Down
24 changes: 12 additions & 12 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,9 +1,9 @@
[workspace]
resolver = "2"
members = [
"crates/mic2_rs",
"crates/pymic2",
"crates/libmic2",
"crates/mic2",
"crates/mic2-c",
"crates/mic2-py",
]
exclude = [
"examples/rust/find",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ endif()
set(LIBMIC2_LIB "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_DIR}/${LIBMIC2_LIB_NAME}")
set(LIBMIC2_STATIC_LIB "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_DIR}/${LIBMIC2_STATIC_LIB_NAME}")
set(LIBMIC2_HEADER_PATH "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_DIR}/mic2.h")
set(LIBMIC2_CXX_HEADER_PATH "${CMAKE_SOURCE_DIR}/crates/libmic2/src/mic2.hpp")
set(LIBMIC2_CXX_SRC_PATH "${CMAKE_SOURCE_DIR}/crates/libmic2/src/mic2.cpp")
set(LIBMIC2_CXX_HEADER_PATH "${CMAKE_SOURCE_DIR}/crates/mic2-c/src/mic2.hpp")
set(LIBMIC2_CXX_SRC_PATH "${CMAKE_SOURCE_DIR}/crates/mic2-c/src/mic2.cpp")


# Build libmic2
Expand Down
9 changes: 5 additions & 4 deletions crates/libmic2/Cargo.toml → crates/mic2-c/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
[package]
name = "libmic2"
name = "mic2-c"
version = "0.1.0"
edition = "2021"
publish = false

[lib]
name = "mic2"
crate-type = ["cdylib", "staticlib"]
doc = false

[dependencies]
mic2 = { path = "../mic2" }

[build-dependencies]
cbindgen = "0.26.0"
path-clean = "1.0.1"
cc = "1.0.98"
cmake = "0.1.50"

[dependencies.mic2]
path = "../mic2_rs"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 3 additions & 5 deletions crates/pymic2/Cargo.toml → crates/mic2-py/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
[package]
name = "mic2_python"
name = "mic2-py"
version = "0.1.0"
edition = "2021"
publish = false

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
name = "pymic2"
crate-type = ["cdylib"]

[dependencies]
chrono = "0.4.38"
pyo3 = { version = "0.21.2", features = ["chrono", "extension-module"] }

[dependencies.mic2]
path = "../mic2_rs"
mic2 = { path = "../mic2" }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 0 additions & 3 deletions crates/mic2_rs/Cargo.toml → crates/mic2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ readme = "README.md"
description = "Rust API for neoVI MIC2"
keywords = ["neoVI", "MIC2", "Intrepid", "ICS"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html


[features]
default = ["gps", "io", "audio"]
gps = ["dep:nmea-parser", "dep:serialport"]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/rust/find/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ edition = "2021"


[dependencies.mic2]
path = "../../../crates/mic2_rs"
path = "../../../crates/mic2"

0 comments on commit 7f2ab45

Please sign in to comment.