Skip to content

Commit

Permalink
Merge #62
Browse files Browse the repository at this point in the history
62: Make wasmer silently available anywhere r=Hywan a=syrusakbary

## Problem

Python wasmer installation is failing in various systems (mainly because of alpine linux).
syrusakbary/snapshottest#88
syrusakbary/fastdiff#2
syrusakbary/fastdiff#3

One way to make it work very easily is by creating a generic wheel that it's always available but that fails on import (rather than on install).

This PR adds that, and upgrades wasmer to `0.5.6` as well

Co-authored-by: Syrus <me@syrusakbary.com>
  • Loading branch information
bors[bot] and syrusakbary committed Aug 14, 2019
2 parents 89abd0f + b384c88 commit 34539c9
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 37 deletions.
4 changes: 3 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ jobs:
export PATH="/home/circleci/.pyenv/versions/3.7.3/bin/:$PATH"
source .env/bin/activate
just build
just wasmer_any
# Run the extension test suites.
- run:
Expand Down Expand Up @@ -124,7 +125,8 @@ jobs:
export PATH="/home/circleci/.pyenv/versions/3.6.8/bin/:$PATH"
export PATH="/home/circleci/.pyenv/versions/3.5.7/bin/:$PATH"
source .env/bin/activate
pyo3-pack publish -i python3.7 python3.6 python3.5 -u wasmer
just wasmer_any
just publish
# List of workflows.
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
/.pytest_cache/
/benchmarks/__pycache__/
/target
/tests/__pycache__/
/tests/__pycache__/
/wasmer-any/dist
.DS_Store
51 changes: 19 additions & 32 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "wasmer"
version = "0.3.0"
authors = ["Ivan Enderlin <ivan.enderlin@hoa-project.net>"]
authors = ["The Wasmer Engineering Team <engineering@wasmer.io>"]
edition = "2018"
description = "Python extension to run WebAssembly binaries"
readme = "README.md"
Expand All @@ -15,8 +15,8 @@ name = "wasmer"
crate-type = ["cdylib"]

[dependencies]
wasmer-runtime = "0.5.5"
wasmer-runtime-core = "0.5.5"
wasmer-runtime = "0.5.6"
wasmer-runtime-core = "0.5.6"
pyo3 = { version = "0.7.0", features = ["extension-module"] }

[package.metadata.pyo3-pack]
Expand Down
9 changes: 9 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ benchmark benchmark-filename='':
inspect:
@python -c "help('wasmer')"

# Create a distribution of wasmer that can be installed
# anywhere (it will fail on import)
wasmer_any:
mkdir -p ./target/wheels/
cd wasmer-any && pip3 wheel . -w ../target/wheels/

publish:
pyo3-pack publish -i python3.7 python3.6 python3.5 -u wasmer

# Local Variables:
# mode: makefile
# End:
Expand Down
24 changes: 24 additions & 0 deletions wasmer-any/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from setuptools import setup
from setuptools.dist import Distribution

# with open('../README.md', 'rb') as f:
# readme = f.read().decode('utf-8')

setup(
name='wasmer',
version='0.3.0',
author='The Wasmer Engineering Team',
author_email='engineering@wasmer.io',
license='MIT',
packages=['wasmer'],
description='Python extension to run WebAssembly binaries',
# long_description=readme,
# long_description_content_type='text/markdown',
zip_safe=False,
platforms='any',
classifiers=[
"Programming Language :: Python",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
)
1 change: 1 addition & 0 deletions wasmer-any/wasmer/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
raise ImportError("Wasmer is not available on this system")

0 comments on commit 34539c9

Please sign in to comment.