Skip to content

Commit

Permalink
build: Fix Python release
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Dygalo <[email protected]>
  • Loading branch information
Stranger6667 committed Sep 30, 2024
1 parent e52df95 commit 85244a3
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 15 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,54 @@ jobs:

- run: cargo clippy --all-targets --all-features

check-releases-rust:
name: Check Rust releases
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

- run: cargo publish --dry-run -p referencing
- run: cargo publish --dry-run -p jsonschema
- run: cargo publish --dry-run -p jsonschema-cli

check-releases-python:
name: Check Python releases
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2

- uses: hynek/setup-cached-uv@v2

- run: uv python install "3.12"

- run: uv build --sdist --wheel --out-dir dist
working-directory: crates/jsonschema-py

- run: uv venv
working-directory: crates/jsonschema-py

- name: Install sdist
run: |
uv pip install dist/*.tar.gz --force-reinstall
working-directory: crates/jsonschema-py

- name: Install wheel
run: |
uv pip install dist/*.whl --force-reinstall
working-directory: crates/jsonschema-py

features:
name: Check features
runs-on: ubuntu-22.04
Expand Down
4 changes: 2 additions & 2 deletions crates/jsonschema-referencing-testsuite-codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ license.workspace = true
proc-macro = true

[dependencies]
internal = { package = "jsonschema-referencing-testsuite-internal", path = "../jsonschema-referencing-testsuite-internal/" }
referencing_internal = { package = "jsonschema-referencing-testsuite-internal", path = "../jsonschema-referencing-testsuite-internal/" }
heck = "0.5"
proc-macro2 = "1"
quote = "1"
serde_json.workspace = true
syn = { version = "2", features = ["full"] }
testsuite = { package = "testsuite-common", path = "../testsuite-common/" }
testsuite_common = { package = "testsuite-common", path = "../testsuite-common/" }
walkdir = "2.5"

[lints]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub(crate) fn generate_modules(
.iter()
.enumerate()
.map(|(case_idx, TestCase { name, case })| {
let module_name = testsuite::sanitize_name(name.to_snake_case());
let module_name = testsuite_common::sanitize_name(name.to_snake_case());
let mut new_path = current_path.clone();
new_path.push(module_name.clone());
let module_ident = format_ident!("{}", module_name);
Expand Down Expand Up @@ -57,7 +57,7 @@ pub(crate) fn generate_modules(
#ignore_attr
#[test]
fn #test_ident() {
let test = testsuite::Test {
let test = referencing_testsuite::Test {
registry: serde_json::from_str(#registry).expect("Failed to load JSON"),
base_uri: #base_uri,
reference: #reference,
Expand Down
4 changes: 2 additions & 2 deletions crates/jsonschema-referencing-testsuite-codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ mod loader;
/// [JSON-Referencing-Test-Suite](https://github.com/python-jsonschema/referencing-suite).
#[proc_macro_attribute]
pub fn suite(args: TokenStream, input: TokenStream) -> TokenStream {
let config = parse_macro_input!(args as testsuite::SuiteConfig);
let config = parse_macro_input!(args as testsuite_common::SuiteConfig);
let test_func = parse_macro_input!(input as ItemFn);
let test_func_ident = &test_func.sig.ident;

Expand All @@ -33,7 +33,7 @@ pub fn suite(args: TokenStream, input: TokenStream) -> TokenStream {
#output

mod #draft {
use testsuite::Test;
use referencing_testsuite::Test;
use super::#test_func_ident;

#[inline]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{fs::File, io::BufReader, path::Path};

use internal::Case;
use referencing_internal::Case;
use walkdir::WalkDir;

#[derive(Debug)]
Expand Down
4 changes: 2 additions & 2 deletions crates/jsonschema-referencing-testsuite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ repository.workspace = true
license.workspace = true

[dependencies]
codegen = { package = "jsonschema-referencing-testsuite-codegen", path = "../jsonschema-referencing-testsuite-codegen/" }
internal = { package = "jsonschema-referencing-testsuite-internal", path = "../jsonschema-referencing-testsuite-internal/" }
referencing_codegen = { package = "jsonschema-referencing-testsuite-codegen", path = "../jsonschema-referencing-testsuite-codegen/" }
referencing_internal = { package = "jsonschema-referencing-testsuite-internal", path = "../jsonschema-referencing-testsuite-internal/" }

[lints]
workspace = true
4 changes: 2 additions & 2 deletions crates/jsonschema-referencing-testsuite/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pub use codegen::suite;
pub use internal::Test;
pub use referencing_codegen::suite;
pub use referencing_internal::Test;
2 changes: 1 addition & 1 deletion crates/jsonschema-referencing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ workspace = true
[dev-dependencies]
benchmark = { path = "../benchmark/" }
criterion = { version = "0.5", default-features = false }
testsuite = { package = "jsonschema-referencing-testsuite", path = "../jsonschema-referencing-testsuite/" }
referencing_testsuite = { package = "jsonschema-referencing-testsuite", path = "../jsonschema-referencing-testsuite/" }
test-case = "3.3.1"

[[bench]]
Expand Down
2 changes: 1 addition & 1 deletion crates/jsonschema-referencing/tests/suite.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use referencing::{Draft, Registry};
use testsuite::{suite, Test};
use referencing_testsuite::{suite, Test};

#[suite(
path = "crates/jsonschema-referencing/tests/suite",
Expand Down
2 changes: 1 addition & 1 deletion crates/jsonschema-testsuite-codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ publish = false
proc-macro = true

[dependencies]
internal = { package = "jsonschema-testsuite-internal", path = "../jsonschema-testsuite-internal/" }
testsuite_internal = { package = "jsonschema-testsuite-internal", path = "../jsonschema-testsuite-internal/" }
heck = "0.5"
proc-macro2 = "1"
quote = "1"
Expand Down
2 changes: 1 addition & 1 deletion crates/jsonschema-testsuite-codegen/src/loader.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::{collections::BTreeMap, fs::File, io::BufReader, path::Path};

use internal::Case;
use testsuite_internal::Case;
use walkdir::WalkDir;

pub(crate) type TestCaseTree = BTreeMap<String, TestCaseNode>;
Expand Down

0 comments on commit 85244a3

Please sign in to comment.