mirror of
https://github.com/maplibre/martin.git
synced 2024-12-19 12:51:37 +03:00
Rename martin-mbtiles crate to mbtiles (#976)
This simplifies usage as both a crate and as a tool
This commit is contained in:
parent
76a1b7fb33
commit
47b3106ac6
12
.github/workflows/ci.yml
vendored
12
.github/workflows/ci.yml
vendored
@ -57,8 +57,8 @@ jobs:
|
||||
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
|
||||
- run: cargo fmt --all -- --check
|
||||
- run: cargo clippy --package martin-tile-utils -- -D warnings
|
||||
- run: cargo clippy --package martin-mbtiles --no-default-features -- -D warnings
|
||||
- run: cargo clippy --package martin-mbtiles -- -D warnings
|
||||
- run: cargo clippy --package mbtiles --no-default-features -- -D warnings
|
||||
- run: cargo clippy --package mbtiles -- -D warnings
|
||||
- run: cargo clippy --package martin -- -D warnings
|
||||
- run: cargo clippy --package martin --features bless-tests -- -D warnings
|
||||
- run: cargo doc --no-deps --workspace
|
||||
@ -72,8 +72,8 @@ jobs:
|
||||
run: |
|
||||
set -x
|
||||
cargo test --package martin-tile-utils
|
||||
cargo test --package martin-mbtiles --no-default-features
|
||||
cargo test --package martin-mbtiles
|
||||
cargo test --package mbtiles --no-default-features
|
||||
cargo test --package mbtiles
|
||||
cargo test --package martin
|
||||
cargo test --doc
|
||||
env:
|
||||
@ -144,7 +144,7 @@ jobs:
|
||||
echo "Building $target"
|
||||
|
||||
export "CARGO_TARGET_$(echo $target | tr 'a-z-' 'A-Z_')_RUSTFLAGS"='-C strip=debuginfo'
|
||||
cross build --release --target $target --package martin-mbtiles
|
||||
cross build --release --target $target --package mbtiles
|
||||
cross build --release --target $target --package martin
|
||||
|
||||
mkdir -p target_releases/$target
|
||||
@ -274,7 +274,7 @@ jobs:
|
||||
set -x
|
||||
rustup target add "${{ matrix.target }}"
|
||||
export RUSTFLAGS='-C strip=debuginfo'
|
||||
cargo build --release --target ${{ matrix.target }} --package martin-mbtiles
|
||||
cargo build --release --target ${{ matrix.target }} --package mbtiles
|
||||
cargo build --release --target ${{ matrix.target }} --package martin
|
||||
mkdir -p target_releases
|
||||
mv target/${{ matrix.target }}/release/mbtiles${{ matrix.ext }} target_releases/
|
||||
|
18
Cargo.lock
generated
18
Cargo.lock
generated
@ -471,9 +471,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "brotli-decompressor"
|
||||
version = "2.5.0"
|
||||
version = "2.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da74e2b81409b1b743f8f0c62cc6254afefb8b8e50bbfe3735550f7aeefa3448"
|
||||
checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f"
|
||||
dependencies = [
|
||||
"alloc-no-stdlib",
|
||||
"alloc-stdlib",
|
||||
@ -1752,8 +1752,8 @@ dependencies = [
|
||||
"itertools 0.11.0",
|
||||
"json-patch",
|
||||
"log",
|
||||
"martin-mbtiles",
|
||||
"martin-tile-utils",
|
||||
"mbtiles",
|
||||
"num_cpus",
|
||||
"pbf_font_tools",
|
||||
"pmtiles",
|
||||
@ -1777,8 +1777,12 @@ dependencies = [
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "martin-mbtiles"
|
||||
version = "0.6.0"
|
||||
name = "martin-tile-utils"
|
||||
version = "0.1.3"
|
||||
|
||||
[[package]]
|
||||
name = "mbtiles"
|
||||
version = "0.7.0"
|
||||
dependencies = [
|
||||
"actix-rt",
|
||||
"anyhow",
|
||||
@ -1802,10 +1806,6 @@ dependencies = [
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "martin-tile-utils"
|
||||
version = "0.1.3"
|
||||
|
||||
[[package]]
|
||||
name = "md-5"
|
||||
version = "0.10.6"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[workspace]
|
||||
resolver = "2"
|
||||
members = ["martin", "martin-tile-utils", "martin-mbtiles"]
|
||||
members = ["martin", "martin-tile-utils", "mbtiles"]
|
||||
|
||||
[workspace.package]
|
||||
edition = "2021"
|
||||
@ -33,8 +33,8 @@ insta = "1"
|
||||
itertools = "0.11"
|
||||
json-patch = "1.2"
|
||||
log = "0.4"
|
||||
martin-mbtiles = { path = "./martin-mbtiles", version = "0.6.0", default-features = false }
|
||||
martin-tile-utils = { path = "./martin-tile-utils", version = "0.1.0" }
|
||||
mbtiles = { path = "./mbtiles", version = "0.7.0", default-features = false }
|
||||
num_cpus = "1"
|
||||
pbf_font_tools = { version = "2.5.0", features = ["freetype"] }
|
||||
pmtiles = { version = "0.3", features = ["mmap-async-tokio", "tilejson"] }
|
||||
|
@ -5,7 +5,7 @@ Martin has a few additional tools that can be used to interact with the data.
|
||||
## MBTiles tool
|
||||
A small utility that allows users to interact with the `*.mbtiles` files from the command line. Use `mbtiles --help` to see a list of available commands, and `mbtiles <command> --help` to see help for a specific command.
|
||||
|
||||
This tool can be installed by compiling the latest released version with `cargo install martin-mbtiles`, or by downloading a pre-built binary from the [releases page](https://github.com/maplibre/martin/releases/latest).
|
||||
This tool can be installed by compiling the latest released version with `cargo install mbtiles`, or by downloading a pre-built binary from the [releases page](https://github.com/maplibre/martin/releases/latest).
|
||||
|
||||
### meta-all
|
||||
Print all metadata values to stdout, as well as the results of tile detection. The format of the values printed is not stable, and should only be used for visual inspection.
|
||||
|
8
justfile
8
justfile
@ -148,8 +148,8 @@ bless: restart clean-test bless-insta-martin bless-insta-mbtiles
|
||||
|
||||
# Run integration tests and save its output as the new expected output
|
||||
bless-insta-mbtiles *ARGS: (cargo-install "cargo-insta")
|
||||
#rm -rf martin-mbtiles/tests/snapshots
|
||||
cargo insta test --accept --unreferenced=auto -p martin-mbtiles {{ ARGS }}
|
||||
#rm -rf mbtiles/tests/snapshots
|
||||
cargo insta test --accept --unreferenced=auto -p mbtiles {{ ARGS }}
|
||||
|
||||
# Run integration tests and save its output as the new expected output
|
||||
bless-insta-martin *ARGS: (cargo-install "cargo-insta")
|
||||
@ -256,8 +256,8 @@ git-pre-push: stop start
|
||||
|
||||
# Update sqlite database schema.
|
||||
prepare-sqlite: install-sqlx
|
||||
mkdir -p martin-mbtiles/.sqlx
|
||||
cd martin-mbtiles && cargo sqlx prepare --database-url sqlite://$PWD/../tests/fixtures/mbtiles/world_cities.mbtiles -- --lib --tests
|
||||
mkdir -p mbtiles/.sqlx
|
||||
cd mbtiles && cargo sqlx prepare --database-url sqlite://$PWD/../tests/fixtures/mbtiles/world_cities.mbtiles -- --lib --tests
|
||||
|
||||
# Install SQLX cli if not already installed.
|
||||
[private]
|
||||
|
@ -66,8 +66,8 @@ futures.workspace = true
|
||||
itertools.workspace = true
|
||||
json-patch.workspace = true
|
||||
log.workspace = true
|
||||
martin-mbtiles.workspace = true
|
||||
martin-tile-utils.workspace = true
|
||||
mbtiles.workspace = true
|
||||
num_cpus.workspace = true
|
||||
pbf_font_tools.workspace = true
|
||||
pmtiles.workspace = true
|
||||
|
@ -5,8 +5,8 @@ use std::sync::Arc;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use log::trace;
|
||||
use martin_mbtiles::MbtilesPool;
|
||||
use martin_tile_utils::TileInfo;
|
||||
use mbtiles::MbtilesPool;
|
||||
use tilejson::TileJSON;
|
||||
|
||||
use crate::file_config::FileError;
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "martin-mbtiles"
|
||||
version = "0.6.0"
|
||||
name = "mbtiles"
|
||||
version = "0.7.0"
|
||||
authors = ["Yuri Astrakhan <YuriAstrakhan@gmail.com>", "MapLibre contributors"]
|
||||
description = "A simple low-level MbTiles access and processing library, with some tile format detection and other relevant heuristics."
|
||||
keywords = ["mbtiles", "maps", "tiles", "mvt", "tilejson"]
|
@ -1,11 +1,11 @@
|
||||
# martin-mbtiles
|
||||
# mbtiles
|
||||
|
||||
[![Book](https://img.shields.io/badge/docs-Book-informational)](https://maplibre.org/martin/50-tools.html)
|
||||
[![docs.rs docs](https://docs.rs/martin-mbtiles/badge.svg)](https://docs.rs/martin-mbtiles)
|
||||
[![docs.rs docs](https://docs.rs/mbtiles/badge.svg)](https://docs.rs/mbtiles)
|
||||
[![Slack chat](https://img.shields.io/badge/Chat-on%20Slack-blueviolet)](https://slack.openstreetmap.us/)
|
||||
[![GitHub](https://img.shields.io/badge/github-maplibre/martin-8da0cb?logo=github)](https://github.com/maplibre/martin)
|
||||
[![crates.io version](https://img.shields.io/crates/v/martin-mbtiles.svg)](https://crates.io/crates/martin-mbtiles)
|
||||
[![CI build](https://github.com/maplibre/martin/workflows/CI/badge.svg)](https://github.com/maplibre/martin-mbtiles/actions)
|
||||
[![crates.io version](https://img.shields.io/crates/v/mbtiles.svg)](https://crates.io/crates/mbtiles)
|
||||
[![CI build](https://github.com/maplibre/martin/workflows/CI/badge.svg)](https://github.com/maplibre/martin/actions)
|
||||
|
||||
A library to help tile servers like [Martin](https://maplibre.org/martin) work with [MBTiles](https://github.com/mapbox/mbtiles-spec) files. When using as a lib, you may want to disable default features (i.e. the unused "cli" feature).
|
||||
|
@ -2,7 +2,7 @@ use std::path::{Path, PathBuf};
|
||||
|
||||
use clap::{Parser, Subcommand};
|
||||
use log::error;
|
||||
use martin_mbtiles::{apply_patch, IntegrityCheckType, MbtResult, Mbtiles, MbtilesCopier};
|
||||
use mbtiles::{apply_patch, IntegrityCheckType, MbtResult, Mbtiles, MbtilesCopier};
|
||||
|
||||
#[derive(Parser, PartialEq, Eq, Debug)]
|
||||
#[command(
|
||||
@ -148,7 +148,7 @@ mod tests {
|
||||
|
||||
use clap::error::ErrorKind;
|
||||
use clap::Parser;
|
||||
use martin_mbtiles::{CopyDuplicateMode, MbtilesCopier};
|
||||
use mbtiles::{CopyDuplicateMode, MbtilesCopier};
|
||||
|
||||
use crate::Commands::{ApplyPatch, Copy, MetaGetValue, MetaSetValue, Validate};
|
||||
use crate::{Args, IntegrityCheckType};
|
@ -5,11 +5,9 @@ use std::str::from_utf8;
|
||||
use ctor::ctor;
|
||||
use insta::{allow_duplicates, assert_display_snapshot};
|
||||
use log::info;
|
||||
use martin_mbtiles::IntegrityCheckType::Off;
|
||||
use martin_mbtiles::MbtTypeCli::{Flat, FlatWithHash, Normalized};
|
||||
use martin_mbtiles::{
|
||||
apply_patch, create_flat_tables, MbtResult, MbtTypeCli, Mbtiles, MbtilesCopier,
|
||||
};
|
||||
use mbtiles::IntegrityCheckType::Off;
|
||||
use mbtiles::MbtTypeCli::{Flat, FlatWithHash, Normalized};
|
||||
use mbtiles::{apply_patch, create_flat_tables, MbtResult, MbtTypeCli, Mbtiles, MbtilesCopier};
|
||||
use pretty_assertions::assert_eq as pretty_assert_eq;
|
||||
use rstest::{fixture, rstest};
|
||||
use serde::Serialize;
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
source: martin-mbtiles/tests/mbtiles.rs
|
||||
source: mbtiles/tests/mbtiles.rs
|
||||
expression: actual_value
|
||||
---
|
||||
[[]]
|
@ -10,7 +10,7 @@ MARTIN_URL="http://localhost:${MARTIN_PORT}"
|
||||
MARTIN_ARGS="${MARTIN_ARGS:---listen-addresses localhost:${MARTIN_PORT}}"
|
||||
MARTIN_BIN="${MARTIN_BIN:-cargo run --} ${MARTIN_ARGS}"
|
||||
|
||||
MBTILES_BUILD="${MBTILES_BUILD:-cargo build -p martin-mbtiles}"
|
||||
MBTILES_BUILD="${MBTILES_BUILD:-cargo build -p mbtiles}"
|
||||
MBTILES_BIN="${MBTILES_BIN:-target/debug/mbtiles}"
|
||||
|
||||
LOG_DIR="${LOG_DIR:-target/test_logs}"
|
||||
|
Loading…
Reference in New Issue
Block a user