Skip to content

Commit

Permalink
Merge 31b9e8c into fd1f1e7
Browse files Browse the repository at this point in the history
  • Loading branch information
tammoippen committed Sep 26, 2018
2 parents fd1f1e7 + 31b9e8c commit 7a5ba7e
Show file tree
Hide file tree
Showing 17 changed files with 318 additions and 557 deletions.
5 changes: 5 additions & 0 deletions .gitignore
@@ -1,8 +1,13 @@
venv/
.venv/
data/
*.egg-info
.DS_Store
.cache/
.coverage
dist/

README.rst

pyproject.lock
.vscode/
35 changes: 20 additions & 15 deletions .travis.yml
Expand Up @@ -8,43 +8,48 @@ python:
- "2.7"
- "3.5"
- "3.6"
- "3.7-dev"
- "nightly"
- "pypy2.7-5.8.0"
- "pypy3.5-5.8.0"
- "pypy"
- "pypy3.5"

env:
- WITH_SHAPELY=1
- WITH_SHAPELY=0
matrix:
- WITH_SHAPELY=1
- WITH_SHAPELY=0
global:
secure: "UpVMzQjYMoyt8cbWc/QPNqRzV2Z9rnIqCAY0BP/DdRHDjhzRTmvoiEEYhAa6Bl10EAWosC23lc262x0EliWJ6wt5iy9VjPw+Ep+VBIrzG7Rl/q1lnPBmTfg7r2fbiwKUbFYSTVj7dQ3hCTHfr4BIQ1ZluisaPKZf8oRxoii528xGRHz2eASSluXba22bzN+QyuKWGDYxEdctsS3m+HAr9A+HpN+1MiMYDzsrv/CkdVWdll9K8E53uuucvgV8NhY9oS+iAL/JQxB3fZO5Plj10cjS097GEdRnHI8h1dK59IKcaa1ZshTlDHNwacv6DfiGjtsgA/TxCi1LZWD/rp+qPYVtMTfHsYI6pznA8/BfB64eQIjbRroHkJ8ih2n3b7bc6BNNrvXpesD9+lleocnYL4XOeLJd+H9q/QvKSDv8IdXrj+K213Ohk65qCdAv1lNDlPirjwDH5pEc4ANp5Tiit/9HgO5khe77yDqmn1ob8AZoe7WwJQPx3dgr41LVFvqIk0tjEcfc0P+Q175Zr1+9o25QfZgIxUzss0k3QmKs+NBGbzOKqaxHmUi5sKggsRNWN+S5dxYa6v3WbzXUMPmvUEQ/UkHkqs93qmMOy2CUUZKkpq1xEc+fN1zGAMuXNNtjhD0iRSYkFU+4YxyO/ZPhJm7j4GnxOV7NO6H3LHwbZJo="

addons:
apt:
packages:
- libgeos-dev
- pandoc

before_install:
- pip install poetry

install:
- pip install pipenv
- poetry install
- if [ $WITH_SHAPELY -eq 1 ]; then
pipenv install numpy "shapely[vectorized]>=1.6b4" --skip-lock ;
poetry install -E fast ;
else
poetry install ;
fi
- pipenv install --dev
- pipenv run python -c 'import geopip; print(geopip._geopip.SHAPELY_AVAILABLE)'
- poetry run python -c 'import geopip; print(geopip._geopip.SHAPELY_AVAILABLE)'

script: PYTHONPATH=$PWD pipenv run pytest
script: poetry run pytest

after_success:
- coveralls

before_deploy:
- git stash --all
- pandoc --from=markdown --to=rst --output=README.rst README.md
- poetry build -f sdist

deploy:
provider: pypi
user: tammoippen
provider: script
script: poetry publish -u tammoippen -p $PYPI_PASS
skip_cleanup: true
password:
secure: l+dWOwBywp+TyFgPEoJBhR+I44E4AMCgjxIaEd6AD0bv2yPeJQGUX/oPiOlQVbtcjqBbESZ6dZA0FVYcO7OCP+uK768S18GaTketFz7EByrSJqrjOt5Ka4TCgAPfo5d/0pHeEGQUqjHWNsP9V0WSx4UFIBv0s7bs8uLduJrGDdyjpH/Ki/l5Arl+H8gygdFRzW4oIhF0u/7AjQ1VKN9WZV9HYB6D+SF0rWP2bZvqFMvBBfwagCbwLsD2QPGJz4nFwBoL5bY2YrEEQ6TrtQbyqL65IS9wYfrEo2c/miC7nCS2p2pI9jRqnMENREvKeJRx2Nck0ZKxdW1R63odvU5I4+OzG5BKo/Q7GHma1jCXn8Qj/RPYIEDIiCmgeTXElq13409J2TA34dpIM32hfXt4SmHzACwPvy5tr1FMGIYrFqVCl9J4Z3kDRkIvZP9EYhFrOy11hVCXNEUv79qk8YswmWhgs/tsB9IiriZD9CewtpbmiEvok//X0ExeykTe93t6D27ehDPwDm4j/FisTLv6i2PRXySqWnE0+Q6cCoAmeDG5GyJ4KKzbPE9sdqQoyrh1bbSGfRfVGdzVKyaHO1Y3y1U5raXEuZ4nNJ0XWIWiwgedB4YFsF/7ZWN7MbGZ7QXxifXEPXsrEMVOofyx349mhIJP1ibCh/Zh+QTrYldXNmw=
on:
branch: master
tags: true
Expand Down
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

19 changes: 0 additions & 19 deletions Pipfile

This file was deleted.

247 changes: 0 additions & 247 deletions Pipfile.lock

This file was deleted.

12 changes: 6 additions & 6 deletions geopip/__init__.py
Expand Up @@ -36,10 +36,10 @@

_INSTANCE = None
def instance(): # noqa: E302
'''Singleton GeoPIP instance (lasy loading)
"""Singleton GeoPIP instance (lasy loading)
Is used in the `search_all` and `search` functions.
'''
"""
global _INSTANCE
if _INSTANCE is not None:
return _INSTANCE
Expand All @@ -50,7 +50,7 @@ def instance(): # noqa: E302


def search_all(lng, lat):
'''Reverse geocode lng/lat coordinate within the features from `instance().shapes`.
"""Reverse geocode lng/lat coordinate within the features from `instance().shapes`.
Look within the features from the `instance().shapes` function for all polygon that
contains the point (lng, lat). From all found feature the `porperties`
Expand All @@ -63,12 +63,12 @@ def search_all(lng, lat):
Returns:
Iterator[Dict[Any, Any]] Iterator for `properties` of found features.
'''
"""
return instance().search_all(lng, lat)


def search(lng, lat):
'''Reverse geocode lng/lat coordinate within the features from `instance().shapes`.
"""Reverse geocode lng/lat coordinate within the features from `instance().shapes`.
Look within the features from the `instance().shapes` function for a polygon that
contains the point (lng, lat). From the first found feature the `porperties`
Expand All @@ -80,5 +80,5 @@ def search(lng, lat):
Returns:
Dict[Any, Any] `Properties` of found feature. `None` if nothing is found.
'''
"""
return instance().search(lng, lat)

0 comments on commit 7a5ba7e

Please sign in to comment.