Skip to content

Commit

Permalink
[Doc] Improved the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
da115115 committed Nov 22, 2019
1 parent c79ad80 commit 845d46a
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 12 deletions.
76 changes: 68 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ OpenTrepWrapper

# Refefences
* OpenTREP project: https://github.com/trep/opentrep
* This GitHub project: https://github.com/trrep/wrapper
* This GitHub project: https://github.com/trep/wrapper
* OpenTravelData (OPTD) project: https://github.com/opentraveldata/opentraveldata
* [How to install `pyenv` and `pipenv`](https://github.com/machine-learning-helpers/induction-python/tree/master/installation/virtual-env)

# Configuration

Expand All @@ -14,9 +15,52 @@ On RedHat/CentOS/Fedora, OpenTREP is packaged and can therefore easily
be installed with the native packager manager (`dnf` or `yum`).

On the platforms, it can be installed by following the instructions
in the [`README.md` file](https://github.cm/trep/opeentrep/tree/master/README.md).
in the [`README.md` file](https://github.com/trep/opentrep/tree/master/README.md).

For the remaining of this document, it assumed that OpenTREP has been
installed from the sources in `${HOME}/dev/deliveries/opentrep-latest`.
You can easily customize the `PYTHONPATH` and `LD_LIBRARY_PATH`
environment variables to suit your own settings.

* You may put the package created by `setuptools` in the repository with:
```bash
$ export TREP_DIR="${HOME}/dev/deliveries/opentrep-latest"
$ export PYTHONPATH="${TREP_DIR}/lib/python3.7/site-packages/pyopentrep:${TREP_DIR}/lib"
$ export LD_LIBRARY_PATH="${TREP_DIR}/lib"
$ export PATH="${TREP_DIR}/bin:${PATH}"
```

## Installation of `pyenv` and `pipenv`
* Install Python:
```bash
$ pyenv install 3.7.4
$ pyenv global 3.7.4 && pip install -U pip pipenv && pyenv global system
```

* Clone this Git repository:
```bash
$ mkdir -p ~/dev/geo/trep && git clone https://github.com/trep/wrapper.git ~/dev/geo/trep/wrapper
```

* Install the Python virtual environment:
```bash
$ cd ~/dev/geo/trep/wrapper
$ pipenv install && pipenv install --dev
```

## Test the wrapper application
* In the following Python examples, it is assumed that an interactive
Python Shell has been launched:
```bash
$ pipenv run python
```

* Or, on MacOS:
```bash
$ ASAN_OPTIONS=detect_container_overflow=0 \
DYLD_INSERT_LIBRARIES=/Library/Developer/CommandLineTools/usr/lib/clang/11.0.0/lib/darwin/libclang_rt.asan_osx_dynamic.dylib \
/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python
```

* Import the module:
```python
Expand All @@ -41,12 +85,11 @@ in the [`README.md` file](https://github.cm/trep/opeentrep/tree/master/README.md

```

* You may put the package created by `setuptools` in the repository with:
```bash
$ export TREP_VER="0.07.4"
$ export TREP_DIR="${HOME}/dev/deliveries/opentrep-latest"
$ export PYTHONPATH=${TREP_DIR}/lib/python3.7/site-packages/pyopentrep:${TREP_DIR}/lib
$ rake
* End the Python session:
```python

>>> quit()

```

* On MacOS, if there is an issue with the interceptors:
Expand All @@ -61,4 +104,21 @@ Ran 6 tests in 2.832s
OK
```

# Release OpenTrepWrapper to PyPi
* Build the Python artifacts for OpenTrepWrapper:
```bash
$ rm -rf dist && mkdir dist
$ pipenv run python setup.py sdist bdist_wheel bdist_egg
$ ls -lFh dist
total 48
-rw-r--r-- 1 user staff 7.1K Nov 22 01:03 OpenTrepWrapper-0.7.4.post3-py3-none-any.whl
-rw-r--r-- 1 user staff 6.7K Nov 22 01:03 OpenTrepWrapper-0.7.4.post3-py3.7.egg
-rw-r--r-- 1 user staff 6.2K Nov 22 01:03 OpenTrepWrapper-0.7.4.post3.tar.gz
```

* Publish to PyPi:
```bash
$ pipenv run twine upload dist/*
```


12 changes: 8 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@
Main installation script.
'''

import os
from setuptools import setup

def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()

setup(
name = 'OpenTrepWrapper',
version = '0.7.4.post1',
version = '0.7.4.post4',
author = 'Alex Prengere',
author_email = 'alex.prengere@gmail.com',
url = 'https://github.com/trep/wrapper',
description = 'A Python wrapper module for OpenTrep.',
description = 'A Python wrapper module for OpenTrep',
long_description = read('README.md'),
long_description_content_type = 'text/markdown',
entry_points = {
'console_scripts' : [
'OpenTrep = OpenTrepWrapperMain:main',
Expand All @@ -24,8 +30,6 @@
'OpenTrepWrapperMain'
],
install_requires = [
#Public
#'simplejson', # --> json now
],
#sanitize_lib = ['-lasan'] if cc == 'gcc' and not is_macos else [],
)
Expand Down

0 comments on commit 845d46a

Please sign in to comment.