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

Commit

Permalink
Expose geozones executable through setuptools
Browse files Browse the repository at this point in the history
  • Loading branch information
noirbizarre committed Aug 17, 2017
1 parent 37b3c6f commit cd5ef14
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 19 deletions.
4 changes: 2 additions & 2 deletions LISEZMOI.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ $ git clone https://github.com/etalab/geozones.git
$ cd geozones
$ virtualenv -p /bin/python3 .
$ source bin/activate
$ pip install -r requirements.pip
$ ./geozones.py
$ pip install -e .
$ geozones -h
```

## Modèle
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ $ git clone https://github.com/etalab/geozones.git
$ cd geozones
$ virtualenv -p /bin/python3 .
$ source bin/activate
$ pip install -r requirements.pip
$ ./geozones.py
$ pip install -e .
$ geozones -h
```

## Model
Expand Down Expand Up @@ -122,6 +122,8 @@ Level names and some territories are translatable. They are provided as _gettext
Here’s the workflow:

```bash
# Ensure you have the optionnal tools to process translations
$ pip install -e .[i18n]
# Extract translatabls labels
$ pybabel extract -F babel.cfg -o geozones/translations/geozones.pot .
# Push updated translations template to Transifex
Expand All @@ -144,7 +146,7 @@ $ tx push -t -l <language code>
A set of commands are provided for the build process. You can list them all with:

```bash
$ ./geozones.py --help
$ geozones --help
```

### `download`
Expand Down Expand Up @@ -175,7 +177,7 @@ All in one task equivalent to:

```bash
# Perform all tasks from download to distibution
$ ./geozones.py download load aggregate postprocess dist
$ geozones download load aggregate postprocess dist
```

### `explore`
Expand All @@ -190,7 +192,7 @@ Commands are chainable so you can write:

```bash
# Perform all tasks from download to distibution
$ ./geozones.py download load -d aggregate postprocess dist dist -s status
$ geozones download load -d aggregate postprocess dist dist -s status
```

### `sourceslist`
Expand All @@ -202,7 +204,7 @@ This allows using an external download manager by example.
**Ex:** using 10 parallels threads with curl:

```bash
./geozones.py sourceslist | xargs -P 10 -n 1 curl -O
mkdir download && cd download && geozones sourceslist | xargs -P 10 -n 1 curl -O
```

## Options
Expand Down
3 changes: 2 additions & 1 deletion geozones/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def downloadable_urls(ctx):
help='Specify GeoZones working home')
@click.pass_context
def cli(ctx, level, home):
ctx.obj = {}
if home:
os.chdir(home)
else:
Expand Down Expand Up @@ -408,4 +409,4 @@ def explore(debug, launch):


if __name__ == '__main__':
cli(obj={})
cli()
10 changes: 0 additions & 10 deletions requirements.pip

This file was deleted.

25 changes: 25 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from setuptools import setup, find_packages

setup(
name='geozones',
version='1.0.0',
packages=find_packages(),
include_package_data=True,
install_requires=[
'click>=4.0',
'colorama>=0.3.3',
'Fiona==1.7.5',
'msgpack-python==0.4.7',
'pymongo>=3.0',
'Shapely==1.5.17',
'Flask',
'requests',
],
extras_require={
'i18n': ['transifex-client==0.11.1b0', 'Babel>=1.3']
},
entry_points='''
[console_scripts]
geozones=geozones.__main__:cli
''',
)

0 comments on commit cd5ef14

Please sign in to comment.