Skip to content

Commit

Permalink
fix js build error
Browse files Browse the repository at this point in the history
  • Loading branch information
AkioHayakawa-sony committed Apr 8, 2022
1 parent a0f4bc8 commit 212bc22
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ nnabla-browser-build-env:
.PHONY:nnabla-browser-wheel
nnabla-browser-wheel:
npm install
npm build
npm run build
python3 setup.py bdist_wheel

.PHONY:bwd-nnabla-browser-wheel
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ python >= 3.6
$pip install nnabla-browser
```

- Build from source by yourself & install (required npm)
- Build from source to create wheel & install

Using npm installed in your environment, you can create wheel as follows.
```shell
$ make nnabla-browser-wheel
$ make nnabla-browser-wheel # npm is required
$ pip install ./dist/nnablabrowser-<version>-<env>.whl
```

We also provide docker image so that you don't have to set up environment on your server except docker:
We also provide docker image so that you don't have to set up environment on your server:
```shell
$ make bwd-nnabla-browser-wheel # `bwd` stands for build with docker
$ pip install ./dist/nnablabrowser-<version>-<env>.whl
Expand Down
3 changes: 2 additions & 1 deletion docker/development/Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ RUN apt-get update \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN pip install ${PIP_INS_OPTS} wheel setuptools nnabla
RUN pip install ${PIP_INS_OPTS} wheel setuptools nnabla

9 changes: 7 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
from setuptools import setup, find_packages
from setuptools import setup
import glob

# get webpack outputs
pkg_dirs = glob.glob('nnabla_browser/dist/**/', recursive=True)
pkg_data = [f'{x.lstrip("nnabla_browser/")}*' for x in pkg_dirs]

setup(
name="nnabla-browser",
Expand Down Expand Up @@ -27,7 +32,7 @@
],
python_requires=">=3.6",
packages=["nnabla_browser"],
package_data={'nnabla_browser': ['dist/*', "dist/static/*"]},
package_data={'nnabla_browser': pkg_data},
include_package_data=True,
entry_points={
"console_scripts": [
Expand Down

0 comments on commit 212bc22

Please sign in to comment.