Skip to content

Commit 4531203

Browse files
authored
ci: Use taplo to replace cargo-sort (#1186)
## Which issue does this PR close? None ## What changes are included in this PR? Use taplo to replace cargo-sort entirely. taplo covers all features that cargo-sort have. ## Are these changes tested? Better toml handling. Signed-off-by: Xuanwo <[email protected]>
1 parent 5b62549 commit 4531203

File tree

19 files changed

+126
-92
lines changed

19 files changed

+126
-92
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,6 @@ jobs:
6565
- name: Cargo clippy
6666
run: make check-clippy
6767

68-
- name: Install cargo-sort
69-
uses: taiki-e/install-action@v2
70-
with:
71-
72-
- name: Cargo sort
73-
run: cargo sort -c -w
74-
7568
- name: Install cargo-machete
7669
uses: taiki-e/install-action@v2
7770
with:

.taplo.toml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
include = ["Cargo.toml", "**/*.toml"]
19+
20+
[formatting]
21+
# Align consecutive entries vertically.
22+
align_entries = false
23+
# Append trailing commas for multi-line arrays.
24+
array_trailing_comma = true
25+
# Expand arrays to multiple lines that exceed the maximum column width.
26+
array_auto_expand = true
27+
# Collapse arrays that don't exceed the maximum column width and don't contain comments.
28+
array_auto_collapse = true
29+
# Omit white space padding from single-line arrays
30+
compact_arrays = true
31+
# Omit white space padding from the start and end of inline tables.
32+
compact_inline_tables = false
33+
# Maximum column width in characters, affects array expansion and collapse, this doesn't take whitespace into account.
34+
# Note that this is not set in stone, and works on a best-effort basis.
35+
column_width = 80
36+
# Indent based on tables and arrays of tables and their subtables, subtables out of order are not indented.
37+
indent_tables = false
38+
# The substring that is used for indentation, should be tabs or spaces (but technically can be anything).
39+
indent_string = ' '
40+
# Add trailing newline at the end of the file if not present.
41+
trailing_newline = true
42+
# Alphabetically reorder keys that are not separated by empty lines.
43+
reorder_keys = true
44+
# Maximum amount of allowed consecutive blank lines. This does not affect the whitespace at the end of the document, as it is always stripped.
45+
allowed_blank_lines = 1
46+
# Use CRLF for line endings.
47+
crlf = false

Cargo.toml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,25 @@
1616
# under the License.
1717

1818
[workspace]
19-
resolver = "2"
19+
exclude = ["bindings/python"]
2020
members = [
21-
"crates/catalog/*",
22-
"crates/examples",
23-
"crates/iceberg",
24-
"crates/integration_tests",
25-
"crates/integrations/*",
26-
"crates/sqllogictest",
27-
"crates/test_utils",
21+
"crates/catalog/*",
22+
"crates/examples",
23+
"crates/iceberg",
24+
"crates/integration_tests",
25+
"crates/integrations/*",
26+
"crates/sqllogictest",
27+
"crates/test_utils",
2828
]
29-
exclude = ["bindings/python"]
29+
resolver = "2"
3030

3131
[workspace.package]
32-
version = "0.4.0"
3332
edition = "2021"
3433
homepage = "https://rust.iceberg.apache.org/"
34+
version = "0.4.0"
3535

36-
repository = "https://github.com/apache/iceberg-rust"
3736
license = "Apache-2.0"
37+
repository = "https://github.com/apache/iceberg-rust"
3838
# Check the MSRV policy in README.md before changing this
3939
rust-version = "1.84"
4040

@@ -50,8 +50,8 @@ arrow-ord = { version = "54.2.0" }
5050
arrow-schema = { version = "54.2.0" }
5151
arrow-select = { version = "54.2.0" }
5252
arrow-string = { version = "54.2.0" }
53-
async-trait = "0.1.86"
5453
async-std = "1.12"
54+
async-trait = "0.1.86"
5555
aws-config = "1"
5656
aws-sdk-glue = "1.39"
5757
bimap = "0.6"
@@ -62,11 +62,14 @@ ctor = "0.2.8"
6262
datafusion = "45"
6363
derive_builder = "0.20"
6464
env_logger = "0.11.0"
65+
expect-test = "1"
6566
fnv = "1.0.7"
6667
futures = "0.3"
68+
hive_metastore = "0.1"
69+
http = "1.1"
6770
iceberg = { version = "0.4.0", path = "./crates/iceberg" }
68-
iceberg-catalog-rest = { version = "0.4.0", path = "./crates/catalog/rest" }
6971
iceberg-catalog-memory = { version = "0.4.0", path = "./crates/catalog/memory" }
72+
iceberg-catalog-rest = { version = "0.4.0", path = "./crates/catalog/rest" }
7073
iceberg-datafusion = { version = "0.4.0", path = "./crates/integrations/datafusion" }
7174
itertools = "0.13"
7275
log = "0.4.22"
@@ -78,8 +81,8 @@ opendal = "0.53.0"
7881
ordered-float = "4"
7982
parquet = "54.2.0"
8083
pilota = "0.11.2"
81-
pretty_assertions = "1.4"
8284
port_scanner = "0.1.5"
85+
pretty_assertions = "1.4"
8386
rand = "0.8.5"
8487
regex = "1.10.5"
8588
reqwest = { version = "0.12.2", default-features = false, features = ["json"] }
@@ -92,14 +95,11 @@ serde_json = "1.0.138"
9295
serde_repr = "0.1.16"
9396
serde_with = "3.4"
9497
tempfile = "3.18"
98+
tera = "1"
9599
thrift = "0.17.0"
96100
tokio = { version = "1.44", default-features = false }
97101
typed-builder = "0.20"
98102
url = "2.5.4"
99103
uuid = { version = "1.14", features = ["v7"] }
100104
volo-thrift = "0.10"
101-
hive_metastore = "0.1"
102-
tera = "1"
103105
zstd = "0.13.2"
104-
expect-test = "1"
105-
http = "1.1"

Makefile

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ check-fmt:
2626
check-clippy:
2727
cargo clippy --all-targets --all-features --workspace -- -D warnings
2828

29-
install-cargo-sort:
30-
cargo install [email protected]
31-
32-
cargo-sort: install-cargo-sort
33-
cargo sort -c -w
34-
3529
install-cargo-machete:
3630
cargo install [email protected]
3731

@@ -47,7 +41,7 @@ fix-toml: install-taplo-cli
4741
check-toml: install-taplo-cli
4842
taplo check
4943

50-
check: check-fmt check-clippy cargo-sort check-toml cargo-machete
44+
check: check-fmt check-clippy check-toml cargo-machete
5145

5246
doc-test:
5347
cargo test --no-fail-fast --doc --all-features --workspace

bindings/python/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@
1616
# under the License.
1717

1818
[package]
19-
name = "pyiceberg_core_rust"
20-
version = "0.4.0"
2119
edition = "2021"
2220
homepage = "https://rust.iceberg.apache.org"
21+
name = "pyiceberg_core_rust"
2322
rust-version = "1.84"
23+
version = "0.4.0"
2424
# This crate is used to build python bindings, we don't want to publish it
2525
publish = false
2626

27-
license = "Apache-2.0"
2827
keywords = ["iceberg"]
28+
license = "Apache-2.0"
2929

3030
[lib]
3131
crate-type = ["cdylib"]
3232

3333
[dependencies]
34+
arrow = { version = "54.1.0", features = ["pyarrow", "chrono-tz"] }
3435
iceberg = { path = "../../crates/iceberg" }
3536
pyo3 = { version = "0.23.3", features = ["extension-module", "abi3-py39"] }
36-
arrow = { version = "54.1.0", features = ["pyarrow", "chrono-tz"] }

bindings/python/pyproject.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,10 @@
1616
# under the License.
1717

1818
[build-system]
19-
requires = ["maturin>=1.0,<2.0"]
2019
build-backend = "maturin"
20+
requires = ["maturin>=1.0,<2.0"]
2121

2222
[project]
23-
name = "pyiceberg-core"
24-
version = "0.4.0"
25-
readme = "project-description.md"
26-
requires-python = "~=3.9"
2723
classifiers = [
2824
"Development Status :: 4 - Beta",
2925
"Intended Audience :: Developers",
@@ -34,11 +30,15 @@ classifiers = [
3430
"Programming Language :: Python :: 3.11",
3531
"Programming Language :: Python :: 3.12",
3632
]
33+
name = "pyiceberg-core"
34+
readme = "project-description.md"
35+
requires-python = "~=3.9"
36+
version = "0.4.0"
3737

3838
[tool.maturin]
3939
features = ["pyo3/extension-module"]
40-
python-source = "python"
4140
module-name = "pyiceberg_core.pyiceberg_core_rust"
41+
python-source = "python"
4242

4343
[tool.ruff.lint]
4444
ignore = ["F403", "F405"]
@@ -47,6 +47,6 @@ ignore = ["F403", "F405"]
4747
dependencies = ["maturin>=1.0,<2.0", "pytest>=8.3.2", "pyarrow>=17.0.0"]
4848

4949
[tool.hatch.envs.dev.scripts]
50-
develop = "maturin develop"
5150
build = "maturin build --out dist --sdist"
51+
develop = "maturin develop"
5252
test = "pytest"

crates/catalog/glue/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
# under the License.
1717

1818
[package]
19-
name = "iceberg-catalog-glue"
20-
version = { workspace = true }
2119
edition = { workspace = true }
2220
homepage = { workspace = true }
21+
name = "iceberg-catalog-glue"
2322
rust-version = { workspace = true }
23+
version = { workspace = true }
2424

2525
categories = ["database"]
2626
description = "Apache Iceberg Glue Catalog Support"
27-
repository = { workspace = true }
28-
license = { workspace = true }
2927
keywords = ["iceberg", "glue", "catalog"]
28+
license = { workspace = true }
29+
repository = { workspace = true }
3030

3131
[dependencies]
3232
anyhow = { workspace = true }

crates/catalog/hms/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
# under the License.
1717

1818
[package]
19-
name = "iceberg-catalog-hms"
20-
version = { workspace = true }
2119
edition = { workspace = true }
2220
homepage = { workspace = true }
21+
name = "iceberg-catalog-hms"
2322
rust-version = { workspace = true }
23+
version = { workspace = true }
2424

2525
categories = ["database"]
2626
description = "Apache Iceberg Hive Metastore Catalog Support"
27-
repository = { workspace = true }
28-
license = { workspace = true }
2927
keywords = ["iceberg", "hive", "catalog"]
28+
license = { workspace = true }
29+
repository = { workspace = true }
3030

3131
[dependencies]
3232
anyhow = { workspace = true }

crates/catalog/memory/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
# under the License.
1717

1818
[package]
19-
name = "iceberg-catalog-memory"
20-
version = { workspace = true }
2119
edition = { workspace = true }
2220
homepage = { workspace = true }
21+
name = "iceberg-catalog-memory"
2322
rust-version = { workspace = true }
23+
version = { workspace = true }
2424

2525
categories = ["database"]
2626
description = "Apache Iceberg Rust Memory Catalog API"
27-
repository = { workspace = true }
28-
license = { workspace = true }
2927
keywords = ["iceberg", "memory", "catalog"]
28+
license = { workspace = true }
29+
repository = { workspace = true }
3030

3131
[dependencies]
3232
async-trait = { workspace = true }

crates/catalog/rest/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
# under the License.
1717

1818
[package]
19-
name = "iceberg-catalog-rest"
20-
version = { workspace = true }
2119
edition = { workspace = true }
2220
homepage = { workspace = true }
21+
name = "iceberg-catalog-rest"
2322
rust-version = { workspace = true }
23+
version = { workspace = true }
2424

2525
categories = ["database"]
2626
description = "Apache Iceberg Rust REST API"
27-
repository = { workspace = true }
28-
license = { workspace = true }
2927
keywords = ["iceberg", "rest", "catalog"]
28+
license = { workspace = true }
29+
repository = { workspace = true }
3030

3131
[dependencies]
3232
# async-trait = { workspace = true }

0 commit comments

Comments
 (0)