diff --git a/bindings/python/CHANGELOG.md b/bindings/python/CHANGELOG.md index e6c8d01d..dfcde7a7 100644 --- a/bindings/python/CHANGELOG.md +++ b/bindings/python/CHANGELOG.md @@ -9,6 +9,9 @@ ### Fixed - Not necessary network requests for schemas with `$id` values with trailing `#` symbol. [#163](https://github.com/Stranger6667/jsonschema-rs/issues/163) +- Source code distribution. It was missing the source code for the underlying Rust crate and were leading to + a build error during `pip install css-inline` on platforms that we don't have wheels for. + [#159](https://github.com/Stranger6667/jsonschema-rs/issues/159) ### Performance diff --git a/bindings/python/MANIFEST.in b/bindings/python/MANIFEST.in index f3310df8..578c93a3 100644 --- a/bindings/python/MANIFEST.in +++ b/bindings/python/MANIFEST.in @@ -3,3 +3,5 @@ include build.rs include pyproject.toml include rust-toolchain recursive-include src * +recursive-include jsonschema-lib * +recursive-exclude jsonschema-lib/target * diff --git a/bindings/python/build-sdist.sh b/bindings/python/build-sdist.sh new file mode 100755 index 00000000..283aef31 --- /dev/null +++ b/bindings/python/build-sdist.sh @@ -0,0 +1,12 @@ +#!/bin/bash +set -ex + +# Create a symlink for jsonschema +ln -sf ../../jsonschema jsonschema-lib +# Modify Cargo.toml to include this symlink +cp Cargo.toml Cargo.toml.orig +sed -i 's/\.\.\/\.\.\/jsonschema/\.\/jsonschema-lib/' Cargo.toml +# Build the source distribution +python setup.py sdist +rm jsonschema-lib +mv Cargo.toml.orig Cargo.toml diff --git a/bindings/python/tox.ini b/bindings/python/tox.ini index ac1487c0..f8152e06 100644 --- a/bindings/python/tox.ini +++ b/bindings/python/tox.ini @@ -19,7 +19,7 @@ commands = deps = setuptools-rust commands = - python setup.py sdist + ./build-sdist.sh [testenv:build-wheel] passenv =