made grassloper an application installable by `pip`.

also added install instructions
This commit is contained in:
Guillaume Raffy 2022-11-30 16:42:25 +01:00
parent 71fdb927f7
commit b64be1655b
4 changed files with 32 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
grassloper/__pycache__
grassloper.egg-info
samples/TracTrac

View File

@ -2,3 +2,21 @@
an application to estimate the slope of a granular surface flow 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
```

11
setup.py Normal file
View File

@ -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', ]
},
)