Skip to content

Commit

Permalink
fix: Sdist Python packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
Stranger6667 committed Jan 29, 2021
1 parent 8c27016 commit 9116b91
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions bindings/python/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions bindings/python/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
12 changes: 12 additions & 0 deletions bindings/python/build-sdist.sh
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion bindings/python/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ commands =
deps =
setuptools-rust
commands =
python setup.py sdist
./build-sdist.sh

[testenv:build-wheel]
passenv =
Expand Down

0 comments on commit 9116b91

Please sign in to comment.