Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python package

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest coveralls pytest-cov
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
- name: Install rio-mbtiles
run: |
pip install -e .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest -v
12 changes: 8 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ env:
global:
- PIP_WHEEL_DIR=$HOME/.cache/pip
- PIP_FIND_LINKS=$HOME/.cache/pip
python:
- "2.7.15"
- "3.6"
- "3.7"
matrix:
fast_finish: true
include:
- python: '3.10'
dist: bionic
- python: '3.9'
- python: '3.8'

cache:
directories:
- $HOME/.cache/pip/
Expand Down
9 changes: 9 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
rio-mbtiles
===========

.. image:: https://github.com/mapbox/rio-mbtiles/actions/workflows/python-package.yml/badge.svg
:alt: Python Workflow
:target: https://github.com/mapbox/rio-mbtiles/actions/workflows/python-package.yml

.. image:: https://travis-ci.org/mapbox/rio-mbtiles.svg
:target: https://travis-ci.org/mapbox/rio-mbtiles


.. image:: https://img.shields.io/pypi/v/rio-mbtiles.svg
:target: https://pypi.python.org/pypi/rio-mbtiles


A plugin for the
`Rasterio CLI <https://github.com/mapbox/rasterio/blob/master/docs/cli.rst>`__
that exports a raster dataset to the MBTiles (version 1.3) format. Features
Expand Down
1 change: 1 addition & 0 deletions mbtiles/scripts/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ def mbtiles(
pbar = None

# Initialize the sqlite db.
appending = None
output_exists = os.path.exists(output)
if append:
appending = output_exists
Expand Down
12 changes: 6 additions & 6 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
affine==2.2.1
cligj==0.5.0
coveralls==1.5.1
coveralls
enum34==1.1.6
mercantile==1.1.6
mock; python_version < "3.3"
numpy==1.15.2
pytest<3.9
pytest-cov==2.5.1
numpy>=1.10
pytest
pytest-cov
coverage==4.5.1
rasterio~=1.0
rasterio>=1.0
snuggs==1.4.2
tqdm==4.48.2
tqdm>=4.0
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
"cligj>=0.5",
"mercantile",
"numpy>=1.10",
"rasterio~=1.0",
"shapely~=1.7.0",
"rasterio>=1.0",
"shapely>=1.8.0",
"supermercado",
"tqdm~=4.0",
"tqdm>=4.0",
],
extras_require={"test": ["coveralls", "pytest", "pytest-cov"]},
entry_points="""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def test_rgba_png(tmpdir, data, filename):
(4, 10, 70, "RGB.byte.tif"),
(6, 7, 6, "RGB.byte.tif"),
(4, 10, 12, "rgb-193f513.vrt"),
(4, 10, 69, "rgb-fa48952.vrt"),
(4, 10, 70, "rgb-fa48952.vrt"),
],
)
@pytest.mark.parametrize(
Expand Down