From 28c675169c39e14d76fa4bc0c7741beddd7d31bb Mon Sep 17 00:00:00 2001 From: Bart Feenstra Date: Sat, 5 Aug 2017 23:23:01 +0200 Subject: [PATCH 1/5] Support installing the package inside a virtual environment. --- README.md | 12 ++++++++++++ setup.py | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ad5f740..cac5dcf 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,18 @@ To install this tool for __Python 3__, execute the following: sudo pip3 install colorama sudo pip3 install websocket_client sudo python3 setup.py install + +To install this tool in a [virtual environment](https://pypi.python.org/pypi/virtualenv), execute the following steps: + + # Set up the virtual environment. Replace $python_global with the path to your Python executable. "venv" is the name of the subdirectory that will be created, and can be anything. + $python_global -m virtualenv venv + sudo pip install pyserial + sudo pip install colorama + sudo pip install websocket_client + # Tell disutils to use the current environment's Python executable, + # which will then be handled by virtualenv. + sudo python setup.py build -e "/usr/bin/env python" + sudo python setup.py install ## Known Issues diff --git a/setup.py b/setup.py index ca9a9c8..aab3506 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,12 @@ #!/usr/bin/env python from mp import version -from distutils.core import setup +try: + from setuptools import setup +except ImportError: + from distutils.core import setup + + setup(name='mpfshell', version=version.FULL, From 9e0dc74a071b44b146296913e7084ab41883a9a8 Mon Sep 17 00:00:00 2001 From: Bart Feenstra Date: Sat, 5 Aug 2017 23:26:06 +0200 Subject: [PATCH 2/5] Fix a formatting error. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cac5dcf..007626a 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ To install this tool in a [virtual environment](https://pypi.python.org/pypi/vir # Set up the virtual environment. Replace $python_global with the path to your Python executable. "venv" is the name of the subdirectory that will be created, and can be anything. $python_global -m virtualenv venv - sudo pip install pyserial + sudo pip install pyserial sudo pip install colorama sudo pip install websocket_client # Tell disutils to use the current environment's Python executable, From 1b33c32ac064e7abfb1de2a886ba290d00ac63f2 Mon Sep 17 00:00:00 2001 From: Bart Feenstra Date: Sat, 5 Aug 2017 23:26:37 +0200 Subject: [PATCH 3/5] Fix a typo. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 007626a..1bf308f 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ To install this tool in a [virtual environment](https://pypi.python.org/pypi/vir sudo pip install pyserial sudo pip install colorama sudo pip install websocket_client - # Tell disutils to use the current environment's Python executable, + # Tell distutils to use the current environment's Python executable, # which will then be handled by virtualenv. sudo python setup.py build -e "/usr/bin/env python" sudo python setup.py install From 788a4e5eb6629970d0a9ee7fb34d746cbd2b8574 Mon Sep 17 00:00:00 2001 From: Bart Feenstra Date: Mon, 7 Aug 2017 12:18:38 +0200 Subject: [PATCH 4/5] Simplify virtual environment instructions after recent changes to master. --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 84ee09f..4153b93 100644 --- a/README.md +++ b/README.md @@ -77,9 +77,7 @@ To install this tool in a [virtual environment](https://pypi.python.org/pypi/vir # Set up the virtual environment. Replace $python_global with the path to your Python executable. "venv" is the name of the subdirectory that will be created, and can be anything. $python_global -m virtualenv venv - sudo pip install pyserial - sudo pip install colorama - sudo pip install websocket_client + pip install -r requirements.txt # Tell distutils to use the current environment's Python executable, # which will then be handled by virtualenv. sudo python setup.py build -e "/usr/bin/env python" From b6061a565fa176bb61ea91d287d0a16efd3d4782 Mon Sep 17 00:00:00 2001 From: Bart Feenstra Date: Mon, 7 Aug 2017 13:45:32 +0200 Subject: [PATCH 5/5] Fix venv commands. --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4153b93..3ccf09e 100644 --- a/README.md +++ b/README.md @@ -77,11 +77,12 @@ To install this tool in a [virtual environment](https://pypi.python.org/pypi/vir # Set up the virtual environment. Replace $python_global with the path to your Python executable. "venv" is the name of the subdirectory that will be created, and can be anything. $python_global -m virtualenv venv + . venv/bin/activate pip install -r requirements.txt # Tell distutils to use the current environment's Python executable, # which will then be handled by virtualenv. - sudo python setup.py build -e "/usr/bin/env python" - sudo python setup.py install + python setup.py build -e "/usr/bin/env python" + python setup.py install ## Known Issues