From b64be1655b127bad5f975f707c6de41ccd95a013 Mon Sep 17 00:00:00 2001 From: Guillaume Raffy Date: Wed, 30 Nov 2022 16:42:25 +0100 Subject: [PATCH] made grassloper an application installable by `pip`. also added install instructions --- .gitignore | 3 +++ README.md | 18 ++++++++++++++++++ main.py => grassloper/main.py | 0 setup.py | 11 +++++++++++ 4 files changed, 32 insertions(+) create mode 100644 .gitignore rename main.py => grassloper/main.py (100%) create mode 100644 setup.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5bf0293 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +grassloper/__pycache__ +grassloper.egg-info +samples/TracTrac diff --git a/README.md b/README.md index 18bd7db..6aaf31e 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,21 @@ an application to estimate the slope of a granular surface flow +# how to install + +`grassloper` is delivered as a simple pip application, and as such it can be installed from scratch using the following steps: + +```sh +# create a python virtual environment (we name it name grassloper.venv) +bob@stykades:~/work/grassloper$ python3 -m venv grassloper.venv +# activate the virtual environment to use it +bob@stykades:~/work/grassloper$ source ./grassloper.venv/bin/activate +# grassloper requires improtools https://github.com/g-raffy/improtools, which is not in pip's catalog +# install improtools from its source directory (./improtools.git here, downloaded from https://github.com/g-raffy/improtools) +(grassloper.venv) bob@stykades:~/work/grassloper$ pip install -e ./improtools.git +# install grassloper from its source directory (./grassloper.git here) +# this automatically installs the packages that grassloper depends on +(grassloper.venv) bob@stykades:~/work/grassloper$ pip install -e ./grassloper.git +# now that grassloper is installed in grassloper.venv and grassloper.venv is activated, simply run it using its command line 'grassloper' +(grassloper.venv) bob@stykades:~/work/grassloper$ grassloper +``` diff --git a/main.py b/grassloper/main.py similarity index 100% rename from main.py rename to grassloper/main.py diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..09bb119 --- /dev/null +++ b/setup.py @@ -0,0 +1,11 @@ +import setuptools + +setuptools.setup( + name="grassloper", + version="1.0", + packages=['grassloper'], + install_requires=['improtools(>=1.0)', 'numpy', 'opencv-python', 'scipy', 'h5py'], + entry_points={ + 'console_scripts': ['grassloper=grassloper.main:main', ] + }, +)