From 1158ca1eaa2a5d748837977fe85211d0a8e28b1d Mon Sep 17 00:00:00 2001 From: henry senyondo Date: Mon, 19 Dec 2022 01:18:11 -0500 Subject: [PATCH 01/10] Add Github actions --- .github/workflows/python-package.yml | 43 ++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/python-package.yml diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml new file mode 100644 index 0000000..b345b2c --- /dev/null +++ b/.github/workflows/python-package.yml @@ -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: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.8", "3.9", "3.10"] + + 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 From 5d24d377151ce6e28ffa52d200e5193badc11c35 Mon Sep 17 00:00:00 2001 From: henry senyondo Date: Mon, 19 Dec 2022 01:28:31 -0500 Subject: [PATCH 02/10] Add Badge --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index 29b488f..1dc68c2 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,10 @@ 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 From e6ec2217eb6f7185515e9fc6a424219f70a52311 Mon Sep 17 00:00:00 2001 From: henrykironde Date: Mon, 19 Dec 2022 01:54:29 -0500 Subject: [PATCH 03/10] Update deps change from tilda to >= for more compatibility fixes #82 --- .github/workflows/python-package.yml | 4 ++-- requirements-dev.txt | 12 ++++++------ setup.py | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index b345b2c..3cd820b 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -5,9 +5,9 @@ name: Python package on: push: - branches: [ "master" ] + branches: [ "main" ] pull_request: - branches: [ "master" ] + branches: [ "main" ] jobs: build: diff --git a/requirements-dev.txt b/requirements-dev.txt index 49a2252..a9a95e9 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -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 diff --git a/setup.py b/setup.py index 8f03754..5961136 100644 --- a/setup.py +++ b/setup.py @@ -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=""" From d3e8994b7e14dcd08b5c739c7fc79a53eb84a39e Mon Sep 17 00:00:00 2001 From: henrykironde Date: Mon, 19 Dec 2022 02:40:52 -0500 Subject: [PATCH 04/10] remove 2.7 --- .github/workflows/python-package.yml | 2 +- .travis.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 3cd820b..9caaa27 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.6", "3.9", "3.10"] steps: - uses: actions/checkout@v3 diff --git a/.travis.yml b/.travis.yml index 273c0a0..33d864e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,9 @@ env: - PIP_WHEEL_DIR=$HOME/.cache/pip - PIP_FIND_LINKS=$HOME/.cache/pip python: - - "2.7.15" - "3.6" - - "3.7" + - "3.8" + - "3.9" cache: directories: - $HOME/.cache/pip/ From f0c6ae22098393042b64ba1575662dd52e1841bf Mon Sep 17 00:00:00 2001 From: henrykironde Date: Mon, 19 Dec 2022 03:50:09 -0500 Subject: [PATCH 05/10] Update tests --- .github/workflows/python-package.yml | 2 +- tests/test_cli.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 9caaa27..3cd820b 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.6", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v3 diff --git a/tests/test_cli.py b/tests/test_cli.py index 1da5d87..414fe7c 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -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( From 2a2a946f62cf8c8648d0f21ad055c19887c6fec6 Mon Sep 17 00:00:00 2001 From: henrykironde Date: Mon, 19 Dec 2022 17:33:35 -0500 Subject: [PATCH 06/10] Remove tests on Python 3.6 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 33d864e..fb9b69a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,9 @@ env: - PIP_WHEEL_DIR=$HOME/.cache/pip - PIP_FIND_LINKS=$HOME/.cache/pip python: - - "3.6" - "3.8" - "3.9" + - "3.10" cache: directories: - $HOME/.cache/pip/ From 26291a032398a062ac848d09f740d9f5a1ea3da8 Mon Sep 17 00:00:00 2001 From: henry senyondo Date: Tue, 20 Dec 2022 17:07:45 -0500 Subject: [PATCH 07/10] Add bionic dist --- .travis.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index fb9b69a..d1c31e1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,10 +4,14 @@ env: global: - PIP_WHEEL_DIR=$HOME/.cache/pip - PIP_FIND_LINKS=$HOME/.cache/pip -python: - - "3.8" - - "3.9" - - "3.10" +matrix: + fast_finish: true + include: + - python: '3.10' + dist: bionic + - python: '3.9' + - python: '3.8' + cache: directories: - $HOME/.cache/pip/ From caaa419a8c61d55240ea419cd201f5ef9b097a36 Mon Sep 17 00:00:00 2001 From: henrykironde Date: Tue, 20 Dec 2022 17:45:54 -0500 Subject: [PATCH 08/10] Add PyPi badge --- README.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.rst b/README.rst index 1dc68c2..a02be94 100644 --- a/README.rst +++ b/README.rst @@ -8,6 +8,11 @@ rio-mbtiles .. 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 `__ that exports a raster dataset to the MBTiles (version 1.3) format. Features From 6cc3d42a5485da7ea5ba2df1fa63eb6049df6ef2 Mon Sep 17 00:00:00 2001 From: henrykironde Date: Thu, 15 Feb 2024 22:34:43 -0500 Subject: [PATCH 09/10] initialize appending for the intended scope --- mbtiles/scripts/cli.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mbtiles/scripts/cli.py b/mbtiles/scripts/cli.py index 70d87ed..7fee269 100644 --- a/mbtiles/scripts/cli.py +++ b/mbtiles/scripts/cli.py @@ -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 From adf0558f231b4b8db24a141692430c4fb720e3e0 Mon Sep 17 00:00:00 2001 From: henrykironde Date: Thu, 15 Feb 2024 22:42:40 -0500 Subject: [PATCH 10/10] Test on python-version=3.11 --- .github/workflows/python-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 3cd820b..a07afb1 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3