Skip to content

Commit

Permalink
Merge branch 'release/1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreMiras committed Apr 19, 2020
2 parents 47b6471 + 02ef4d9 commit a445e0d
Show file tree
Hide file tree
Showing 31 changed files with 97 additions and 100 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@ jobs:
with:
python-version: 3.x
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip virtualenv wheel setuptools
- name: Lint with pycodestyle
run: |
python3 -m pip install flake8
python3 -m flake8 . --count --ignore=E125,E126,E127,E128,E402,E741,E731,W503,F401,W504,F841 --show-source --statistics --max-line-length=80 --exclude=__pycache__,.tox,.git/,doc/
run: python3 -m pip install tox>=2.0
- name: Linting
run: python3 -m tox -e pep8

linux_test:
runs-on: ubuntu-18.04
Expand Down Expand Up @@ -58,8 +55,7 @@ jobs:
draft: true
- name: Test with pytest
run: |
flower_name=$(python3 -c "print('$GITHUB_REPOSITORY'.split('/')[-1])")
python3 -m pytest --cov=kivy_garden.$flower_name --cov-report term --cov-branch
python3 -m pytest --cov=kivy_garden.mapview --cov-report term --cov-branch tests/
windows_test:
runs-on: windows-latest
Expand All @@ -79,8 +75,7 @@ jobs:
run: python -m pip install -e .[dev,ci] --extra-index-url https://kivy-garden.github.io/simple/
- name: Test with pytest
run: |
$flower_name=(python -c "print('$GITHUB_REPOSITORY'.split('/')[-1])")
python -m pytest --cov=kivy_garden.$flower_name --cov-report term --cov-branch
python -m pytest --cov=kivy_garden.mapview --cov-report term --cov-branch tests/
docs:
runs-on: ubuntu-18.04
Expand Down Expand Up @@ -112,7 +107,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
flower_name=$(python3 -c "print('$GITHUB_REPOSITORY'.split('/')[-1])")
cp -r doc/build/html ~/docs_temp
git config --global user.email "[email protected]"
Expand All @@ -123,9 +117,9 @@ jobs:
git checkout --orphan gh-pages
cp -r .git ~/docs_git
cd ..
rm -rf $flower_name
mkdir $flower_name
cd $flower_name
rm -rf mapview
mkdir mapview
cd mapview
cp -r ~/docs_git .git
cp -r ~/docs_temp/* .
touch .nojekyll
Expand Down
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,14 @@ install:

script:
- docker run -e DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix mapview-linux /bin/sh -c 'tox'

# Deploy to PyPI using token set in `PYPI_PASSWORD` environment variable
# https://pypi.org/manage/account/token/
# https://travis-ci.com/github/kivy-garden/mapview/settings
deploy:
provider: pypi
distributions: sdist bdist_wheel
user: "__token__"
on:
tags: true
repo: kivy-garden/mapview
4 changes: 0 additions & 4 deletions CHANGELOG

This file was deleted.

9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Change Log

## [1.0.1]

- Migrate to kivy-garden/mapview

## [1.0.0]

- Initial release
19 changes: 0 additions & 19 deletions LICENSE

This file was deleted.

8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Mapview

[![Github Build Status](https://github.com/kivy-garden/mapview/workflows/Garden%20flower/badge.svg)](https://github.com/kivy-garden/mapview/actions)
[![Build Status](https://travis-ci.com/kivy-garden/garden.mapview.svg?branch=master)](https://travis-ci.com/kivy-garden/garden.mapview)
[![Build Status](https://travis-ci.com/kivy-garden/mapview.svg?branch=develop)](https://travis-ci.com/kivy-garden/mapview)

Mapview is a Kivy widget for displaying interactive maps. It has been
designed with lot of inspirations of
Expand Down Expand Up @@ -42,10 +42,8 @@ otherwise you'll have an issue when importing `urllib3` from `requests`.

# Install

Install the mapview garden module using the `garden` tool:

```
garden install mapview
pip install mapview
```

# Usage
Expand All @@ -54,7 +52,7 @@ This widget can be either used within Python or Kv. That's said, not
everything can be done in Kv, to prevent too much computing.

```python
from kivy.garden.mapview import MapView
from kivy_garden.mapview import MapView
from kivy.app import App

class MapViewApp(App):
Expand Down
3 changes: 0 additions & 3 deletions __init__.py

This file was deleted.

8 changes: 4 additions & 4 deletions examples/clustered_geojson.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))

from mapview import MapView, MapMarker
from mapview.geojson import GeoJsonMapLayer
from mapview.clustered_marker_layer import ClusteredMarkerLayer
from mapview.utils import haversine, get_zoom_for_radius
from kivy_garden.mapview import MapView, MapMarker
from kivy_garden.mapview.geojson import GeoJsonMapLayer
from kivy_garden.mapview.clustered_marker_layer import ClusteredMarkerLayer
from kivy_garden.mapview.utils import haversine, get_zoom_for_radius

source = sys.argv[1]

Expand Down
2 changes: 1 addition & 1 deletion examples/map_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))

root = Builder.load_string("""
#:import MapSource mapview.MapSource
#:import MapSource kivy_garden.mapview.MapSource
<Toolbar@BoxLayout>:
size_hint_y: None
Expand Down
3 changes: 1 addition & 2 deletions examples/map_with_marker_popup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))

import mapview

root = Builder.load_string("""
#:import sys sys
#:import MapSource mapview.MapSource
#:import MapSource kivy_garden.mapview.MapSource
MapView:
lat: 50.6394
lon: 3.057
Expand Down
6 changes: 3 additions & 3 deletions examples/simple_geojson.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))

from mapview import MapView, MapMarker
from mapview.geojson import GeoJsonMapLayer
from mapview.utils import haversine, get_zoom_for_radius
from kivy_garden.mapview import MapView, MapMarker
from kivy_garden.mapview.geojson import GeoJsonMapLayer
from kivy_garden.mapview.utils import haversine, get_zoom_for_radius

if len(sys.argv) > 1:
source = sys.argv[1]
Expand Down
2 changes: 1 addition & 1 deletion examples/simple_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))

from mapview import MapView, MapSource
from kivy_garden.mapview import MapView, MapSource

kwargs = {}
if len(sys.argv) > 1:
Expand Down
4 changes: 2 additions & 2 deletions examples/simple_mbtiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
if __name__ == '__main__' and __package__ is None:
from os import path
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from mapview import MapView
from mapview.mbtsource import MBTilesMapSource
from kivy_garden.mapview import MapView
from kivy_garden.mapview.mbtsource import MBTilesMapSource


source = MBTilesMapSource(sys.argv[1])
Expand Down
2 changes: 1 addition & 1 deletion examples/test_kdbush.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from kivy.app import App
from kivy.uix.widget import Widget
from kivy.graphics import Color, Rectangle, Ellipse, Canvas
from mapview.clustered_marker_layer import KDBush, Marker
from kivy_garden.mapview.clustered_marker_layer import KDBush, Marker
from random import random

# creating markers
Expand Down
6 changes: 3 additions & 3 deletions mapview/__init__.py → kivy_garden/mapview/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
except KeyError:
pass

from mapview.types import Coordinate, Bbox
from mapview.source import MapSource
from mapview.view import MapView, MapMarker, MapLayer, MarkerMapLayer, \
from kivy_garden.mapview.types import Coordinate, Bbox
from kivy_garden.mapview.source import MapSource
from kivy_garden.mapview.view import MapView, MapMarker, MapLayer, MarkerMapLayer, \
MapMarkerPopup
1 change: 1 addition & 0 deletions kivy_garden/mapview/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '1.0.1'
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from os.path import dirname, join
from math import sin, log, pi, atan, exp, floor, sqrt
from mapview.view import MapLayer, MapMarker
from kivy_garden.mapview.view import MapLayer, MapMarker
from kivy.lang import Builder
from kivy.metrics import dp
from kivy.properties import (ObjectProperty, NumericProperty, StringProperty, ListProperty)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import requests
import traceback
from time import time
from mapview import CACHE_DIR
from kivy_garden.mapview import CACHE_DIR


DEBUG = "MAPVIEW_DEBUG_DOWNLOADER" in environ
Expand Down
6 changes: 3 additions & 3 deletions mapview/geojson.py → kivy_garden/mapview/geojson.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
from kivy.graphics.tesselator import Tesselator, WINDING_ODD, TYPE_POLYGONS
from kivy.utils import get_color_from_hex
from kivy.metrics import dp
from mapview import CACHE_DIR
from mapview.view import MapLayer
from mapview.downloader import Downloader
from kivy_garden.mapview import CACHE_DIR
from kivy_garden.mapview.view import MapLayer
from kivy_garden.mapview.downloader import Downloader

COLORS = {
'aliceblue': '#f0f8ff',
Expand Down
File renamed without changes
File renamed without changes
4 changes: 2 additions & 2 deletions mapview/mbtsource.py → kivy_garden/mapview/mbtsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
__all__ = ["MBTilesMapSource"]


from mapview.source import MapSource
from mapview.downloader import Downloader
from kivy_garden.mapview.source import MapSource
from kivy_garden.mapview.downloader import Downloader
from kivy.core.image import Image as CoreImage, ImageLoader
import threading
import sqlite3
Expand Down
6 changes: 3 additions & 3 deletions mapview/source.py → kivy_garden/mapview/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

from kivy.metrics import dp
from math import cos, ceil, log, tan, pi, atan, exp
from mapview import MIN_LONGITUDE, MAX_LONGITUDE, MIN_LATITUDE, MAX_LATITUDE, \
from kivy_garden.mapview import MIN_LONGITUDE, MAX_LONGITUDE, MIN_LATITUDE, MAX_LATITUDE, \
CACHE_DIR
from mapview.downloader import Downloader
from mapview.utils import clamp
from kivy_garden.mapview.downloader import Downloader
from kivy_garden.mapview.utils import clamp
import hashlib


Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions mapview/view.py → kivy_garden/mapview/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
from kivy.lang import Builder
from kivy.compat import string_types
from math import ceil
from mapview import MIN_LONGITUDE, MAX_LONGITUDE, MIN_LATITUDE, MAX_LATITUDE, \
from kivy_garden.mapview import MIN_LONGITUDE, MAX_LONGITUDE, MIN_LATITUDE, MAX_LATITUDE, \
CACHE_DIR, Coordinate, Bbox
from mapview.source import MapSource
from mapview.utils import clamp
from kivy_garden.mapview.source import MapSource
from kivy_garden.mapview.utils import clamp
from itertools import takewhile

import webbrowser
Expand Down
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

22 changes: 15 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

here = path.abspath(path.dirname(__file__))

filename = path.join(here, 'kivy_garden', 'flower', '_version.py')
# change this ^^^^^^
filename = path.join(here, 'kivy_garden', 'mapview', '_version.py')
locals = {}
with open(filename, "rb") as fh:
exec(compile(fh.read(), filename, 'exec'), globals(), locals)
Expand All @@ -17,12 +16,12 @@
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()

URL = 'https://github.com/kivy-garden/flower'
URL = 'https://github.com/kivy-garden/mapview'

setup(
name='kivy_garden.flower',
setup_params = dict(
name='kivy_garden.mapview',
version=__version__,
description='A kivy garden flower demo.',
description='A kivy garden mapview demo.',
long_description=long_description,
long_description_content_type='text/markdown',
url=URL,
Expand All @@ -43,7 +42,7 @@
packages=find_namespace_packages(include=['kivy_garden.*']),
install_requires=[],
extras_require={
'dev': ['pytest>=3.6', 'pytest-cov', 'pytest-asyncio',
'dev': ['pytest>=3.6', 'pytest-cov', 'pytest-asyncio', 'flake8',
'sphinx_rtd_theme'],
'ci': ['coveralls', 'pycodestyle'],
},
Expand All @@ -55,3 +54,12 @@
'Source': URL,
},
)


def run_setup():
setup(**setup_params)


# makes sure the setup doesn't run at import time
if __name__ == "__main__":
run_setup()
14 changes: 14 additions & 0 deletions setup_meta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
Creates a distribution alias that just installs kivy_garden.mapview.
"""
from setuptools import setup

from setup import setup_params

setup_params.update({
'install_requires': ['kivy_garden.mapview'],
'name': 'mapview',
})


setup(**setup_params)
2 changes: 1 addition & 1 deletion tests/test_mapview.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import unittest
from mapview import MapView
from kivy_garden.mapview import MapView


class TextInputTest(unittest.TestCase):
Expand Down
Loading

0 comments on commit a445e0d

Please sign in to comment.