Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci,deps): fix build, bump some deps #276

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
3 changes: 3 additions & 0 deletions .github/workflows/c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure
run: mkdir -p build && cd build && cmake ../c -DSUBSTRAIT_VALIDATOR_BUILD_TESTS=ON
- name: Build
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
type: [wheel]
include:
- os: ubuntu-latest
python-version: "3.8"
python-version: "3.9"
type: sdist
runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install Python build dependencies
run: python3 -m pip install --upgrade pip "maturin>=0.14,<0.15"
run: python3 -m pip install --upgrade pip "maturin>=1,<2"
- name: Prepare build environment
working-directory: py
run: python3 prepare_build.py populate
Expand All @@ -64,6 +64,11 @@ jobs:
manylinux: auto
command: build
args: -i ${{ matrix.python-version }} --release -o dist -m py/Cargo.toml
before-script-linux: |
PROTOC_VERSION=28.2
PB_REL="https://github.com/protocolbuffers/protobuf/releases"
curl -LO $PB_REL/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-x86_64.zip
unzip protoc-$PROTOC_VERSION-linux-x86_64.zip -d /usr/local
- name: Build Windows wheels
if: ${{ matrix.type == 'wheel' && matrix.os == 'windows-latest' }}
uses: PyO3/[email protected]
Expand All @@ -75,7 +80,7 @@ jobs:
uses: PyO3/[email protected]
with:
command: build
args: --release -o dist --universal2 -m py/Cargo.toml
args: --release -o dist --target universal2-apple-darwin -m py/Cargo.toml
- name: Install runtime dependencies
run: python3 -m pip install --upgrade protobuf pytest click pyyaml jdot toml
- name: Install generated sdist
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check
run: cargo check --all-features

Expand All @@ -36,6 +39,9 @@ jobs:
python-version: "3.x"
if: ${{ matrix.os == 'ubuntu-latest' }}
- uses: Swatinem/rust-cache@v2
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Run unit tests
run: cargo test --all-features
- name: Install test runner dependencies
Expand Down Expand Up @@ -71,6 +77,9 @@ jobs:
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Clippy
run: cargo clippy --all-features -- -D warnings

Expand All @@ -83,6 +92,9 @@ jobs:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Doc
run: RUSTDOCFLAGS="-Dwarnings" cargo doc --workspace --all-features

Expand All @@ -97,6 +109,9 @@ jobs:
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@stable
- uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Fetch Substrait submodule tags
working-directory: substrait
run: |
Expand Down
2 changes: 1 addition & 1 deletion ci/version-diff-template
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ index 6dbf6a8..d7e0c22 100644
edition = "2021"
license = "Apache-2.0"
include = ["src", "build.rs", "README.md"]
@@ -17,7 +17,7 @@ prost-types = "0.10"
@@ -17,7 +17,7 @@ prost-types = "0.13.3"

# Prost doesn't generate any introspection stuff, so we hack that stuff in with
# our own procedural macros.
Expand Down
2 changes: 1 addition & 1 deletion py/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ substrait-validator = { path = "../rs", version = "0.0.11" }
pyo3 = { version = "0.21.2", features = ["extension-module"] }

[build-dependencies]
prost-build = "0.10"
prost-build = "0.13.3"
pyo3-build-config = "0.22.2"
walkdir = "2"
dunce = "1"
2 changes: 1 addition & 1 deletion py/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you want to create wheels or sdists of your own, you can do so using
maturin (note the manual prepare_build.py invocation, see hints):

```console
user@host:~$ pip install "maturin>=0.14,<0.15"
user@host:~$ pip install "maturin>=1,<2"
...
user@host:~$ ./prepare_build.py populate
user@host:~$ maturin build
Expand Down
4 changes: 2 additions & 2 deletions py/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn main() {
// Directory that the proto files are stored in. If the local_dependencies
// directory exists, we're building from an sdist package, in which case
// the proto files should have been copied to a local directory.
let input_paths = if std::path::Path::new("local_dependencies").exists() {
let input_paths = if std::path::Path::new("proto/substrait").exists() {
vec!["proto"]
} else {
assert!(
Expand Down Expand Up @@ -78,7 +78,7 @@ fn main() {
fs::create_dir_all(&intermediate_path).expect("failed to create protoc output directory");

// Run protoc.
let mut cmd = Command::new(prost_build::protoc());
let mut cmd = Command::new(prost_build::protoc_from_env());
for input_path in input_paths.iter() {
let mut proto_path_arg = OsString::new();
proto_path_arg.push("--proto_path=");
Expand Down
14 changes: 11 additions & 3 deletions py/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["maturin>=0.14,<0.15"]
requires = ["maturin>=1,<2"]
build-backend = "substrait_validator_build"
backend-path = ["."]

Expand All @@ -10,7 +10,7 @@ description = "Validator for Substrait query plans"
readme = "README.md"
license = { file = "LICENSE" }
keywords = ["substrait"]
requires-python = ">=3.8"
requires-python = ">=3.9"
classifiers = [
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
Expand All @@ -29,4 +29,12 @@ repository = "https://github.com/substrait-io/substrait-validator"
substrait-validator = "substrait_validator:cli"

[tool.maturin]
include = ["substrait_validator/substrait/**/*.py"]
include = [
{ path = "substrait_validator/substrait/**/*.py", format = [
"sdist",
"wheel",
] },
{ path = "substrait_validator_build/**/*", format = [
"sdist",
] },
]
6 changes: 3 additions & 3 deletions rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ private_docs = []
[dependencies]

# Prost is used to deal with protobuf serialization and deserialization.
prost = "0.10"
prost-types = "0.10"
prost = "0.13.3"
prost-types = "0.13.3"

# Prost doesn't generate any introspection stuff, so we hack that stuff in with
# our own procedural macros.
Expand Down Expand Up @@ -91,7 +91,7 @@ semver = "1.0"
[build-dependencies]

# Used for generating Rust structs from the protobuf definitions.
prost-build = "0.10"
prost-build = "0.13.3"

# Used to automatically find all protobuf files.
walkdir = "2"
2 changes: 1 addition & 1 deletion tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
walkdir = "2"
glob = "0.3"
prost-build = "0.10"
prost-build = "0.13.3"
rayon = "1.10"
2 changes: 1 addition & 1 deletion tests/src/find_protoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
//! the Python code as well...

fn main() {
println!("{}", prost_build::protoc().display());
println!("{}", prost_build::protoc_from_env().display());
}
Loading