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

Enhance python package and distribute wheels for multiple platforms #111

Merged
merged 4 commits into from
Jun 12, 2020

Conversation

macisamuele
Copy link
Contributor

This PR:

  • adds jsonschema_rs.__build__ which contains useful build information that will be relevant in case of support in the debugging of issues with the package
  • ensures that the python library build is reproducible: this is "the opposite" of style: A rust library should not pin exact versions (use bounds instead) #90 :) . Cargo.lock file should be present if we're building an artifact that won't be used by rust and a Python library is one example of it.
  • Removed bash scripts to build source and binary distributions. This is done in order to keep better support for windows developers (they might not have an easy access to bash) as well as we can leverage tox for dealing with Python virtual environments.
  • Better usage of github-actions: use pypa/gh-action-pypi-publish to publish artifacts on pypi

NOTE: In order to obtain reproducible builds we need to ensure that python/Cargo.toml contains a published version and not a path.
Unfortunately this might limit the capability to run the python tests against the jsonschema rust library modified. In order to workaround this I've modified the setup.py in order to accept in input an environmental variable (UNRELEASED_JSONSCHEMA_PATH) which should point to the root of jsonschema-rs git repo. By doing so we ensure that:

  • python build are reproducible at every commit
  • we can test the effect of the rust changes on the python library without actually releasing the rust library yet (and this is directly used in the CI)

I'm fully aware that this PR, again, is not small and I'm truly sorry for it :)

This fixes: #110

cc: @Stranger6667

…ld scripts to pass through tox

Cargo.lock is preserved to allow reproducible builds (which is important for binaries or libraries supposed to be imported)
Update gitignore to me specific to directories
extra= is not a valid distribution option, it should be extra_dependencies (but it is not needed as tox takes care of that)
python/setup.py Outdated Show resolved Hide resolved
python/tox.ini Show resolved Hide resolved
@macisamuele macisamuele force-pushed the enhance-python-package branch 2 times, most recently from c328594 to 6219f19 Compare June 11, 2020 21:28
Copy link
Owner

@Stranger6667 Stranger6667 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid changes! Looks great to me :) Will issue 0.3.1 release shortly

@Stranger6667 Stranger6667 merged commit c95a8d5 into Stranger6667:master Jun 12, 2020
@macisamuele macisamuele deleted the enhance-python-package branch June 12, 2020 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build wheels for other architectures
2 participants