Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Update setup.py Makefile and documents #130

Merged
merged 7 commits into from
Sep 27, 2018
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ SHELL := /bin/bash
PIP_INSTALL := python3 -m pip install
PIP_UNINSTALL := python3 -m pip uninstall

## Colorful output
_INFO := $(shell echo -e '\e[1;36m')
_WARNING := $(shell echo -e '\e[1;33m')
_END := $(shell echo -e '\e[0m')


## Install directories
ifeq ($(shell id -u), 0) # is root
_ROOT := 1
Expand Down Expand Up @@ -37,41 +43,37 @@ SERVE_PATH ?= $(INSTALL_PREFIX)/nni/serve

## Check if dependencies have been installed globally
ifeq (, $(shell command -v node 2>/dev/null))
$(info Node.js not found)
$(info $(_INFO) Node.js not found $(_END))
_MISS_DEPS := 1 # node not found
else
_VER := $(shell node --version)
_NEWER := $(shell echo -e "$(NODE_VERSION)\n$(_VER)" | sort -Vr | head -n 1)
ifneq ($(_VER), $(_NEWER))
$(info Node.js version not match)
$(info $(_INFO) Node.js version not match $(_END))
_MISS_DEPS := 1 # node outdated
endif
endif
ifeq (, $(shell command -v yarnpkg 2>/dev/null))
$(info Yarn not found)
$(info $(_INFO) Yarn not found $(_END))
_MISS_DEPS := 1 # yarn not found
endif
ifeq (, $(shell command -v serve 2>/dev/null))
$(info Serve not found)
$(info $(_INFO) Serve not found $(_END))
_MISS_DEPS := 1 # serve not found
endif

ifdef _MISS_DEPS
$(info Missing dependencies, use local toolchain)
$(info $(_INFO) Missing dependencies, use local toolchain $(_END))
NODE := $(NODE_PATH)/bin/node
YARN := PATH=$${PATH}:$(NODE_PATH)/bin $(YARN_PATH)/bin/yarn
SERVE := $(SERVE_PATH)/serve
else
$(info All dependencies found, use global toolchain)
$(info $(_INFO) All dependencies found, use global toolchain $(_END))
NODE := node
YARN := yarnpkg
SERVE := serve
endif

## Colorful output
_INFO := $(shell echo -e '\e[1;36m')
_WARNING := $(shell echo -e '\e[1;33m')
_END := $(shell echo -e '\e[0m')

# Setting variables end

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pip Installation Prerequisites
* git, wget

```
pip3 install -v --user git+https://github.com/Microsoft/nni.git@v0.1
python3 -m pip install -v --user git+https://github.com/Microsoft/nni.git@v0.1
source ~/.bashrc
```

Expand Down
6 changes: 3 additions & 3 deletions docs/GetStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
git
wget

python pip should also be correctly installed. You could use "which pip" or "pip -V" to check in Linux.
python pip should also be correctly installed. You could use "python3 -m pip -V" to check in Linux.

* Note: we don't support virtual environment in current releases.

* __Install NNI through pip__

pip3 install -v --user git+https://github.com/Microsoft/nni.git@v0.1
python3 -m pip install -v --user git+https://github.com/Microsoft/nni.git@v0.1
source ~/.bashrc

* __Install NNI through source code__
Expand All @@ -27,7 +27,7 @@

* __Install NNI for all users__

sudo pip3 install -v --user git+https://github.com/Microsoft/nni.git@v0.1
sudo python3 -m pip install -v --user git+https://github.com/Microsoft/nni.git@v0.1
Crysple marked this conversation as resolved.
Show resolved Hide resolved

* Note: NNI will be installed to `/usr/share/nni` for all users and to `~/.local/nni` for current user. Respectively, the examples will be copied to `/usr/share/nni/examples` or `~/.local/nni/examples`.
* The following tutorial assumes that NNI is installed for current user.
Expand Down
2 changes: 1 addition & 1 deletion docs/RemoteMachineMode.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ For remote machines that are used only to run trials but not the nnictl, you can

* __Install python SDK through pip__

pip3 install --user git+https://github.com/Microsoft/NeuralNetworkIntelligence.git#subdirectory=src/sdk/pynni
python3 -m pip install --user git+https://github.com/Microsoft/NeuralNetworkIntelligence.git#subdirectory=src/sdk/pynni

* __Install python SDK through source code__

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def run(self):
'nni': 'src/sdk/pynni/nni',
'nnicmd': 'tools/nnicmd'
},
package_data = {'nni': ['**/requirements.txt']},
python_requires = '>=3.5',
install_requires = [
'astor',
Expand Down
1 change: 1 addition & 0 deletions src/sdk/pynni/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def read(fname):
'numpy',
'scipy'
],
package_data = {'nni': ['**/requirements.txt']},

test_suite = 'tests',

Expand Down