Skip to content

Commit

Permalink
update for 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Jan 20, 2025
1 parent 3508904 commit d0b4bb4
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 52 deletions.
48 changes: 28 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,43 @@ on:
- '*'
pull_request:
env:
LATEST_PY_VERSION: '3.9'
LATEST_PY_VERSION: '3.13'

jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9']
python-version:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
- '3.13'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
# Run tox using the version of Python in `PATH`
- name: Run Tox
run: tox -e py
python -m pip install -e ".[test]"
- name: Run pre-commit
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
run: |
python -m pip install pre-commit
pre-commit run --all-files
- name: Run tests
run: python -m pytest --cov rio_tiler_mvt --cov-report xml --cov-report term-missing -s -vv

- name: Upload Results
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
Expand All @@ -53,31 +57,35 @@ jobs:
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ env.LATEST_PY_VERSION }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox numpy cython
python -m pip install numpy cython wheel setuptools twine
- name: Set tag version
id: tag
# https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
run: |
echo "version=${GITHUB_REF#refs/*/}"
echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Set module version
id: module
# https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
run: echo ::set-output name=version::$(python setup.py --version)
run: |
hatch --quiet version
echo "version=$(python setup.py --version)" >> $GITHUB_OUTPUT
- name: Build sdist
run: python setup.py sdist

- name: Build and publish
if: steps.tag.outputs.tag == steps.module.outputs.version
if: ${{ steps.tag.outputs.version }} == ${{ steps.module.outputs.version}}
env:
TOXENV: release
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: tox
run: twine upload --skip-existing dist/*
25 changes: 7 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
language_version: python

- repo: https://github.com/PyCQA/isort
rev: 5.4.2
rev: 5.13.2
hooks:
- id: isort
language_version: python

- repo: https://github.com/PyCQA/flake8
rev: 3.8.3
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
hooks:
- id: flake8
language_version: python

- repo: https://github.com/PyCQA/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
language_version: python
- id: ruff
args: ["--fix"]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.812
rev: v1.9.0
hooks:
- id: mypy
language_version: python
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.2.0 (2025-01-20)

* update python versions support

## 0.1.0 (2022-08-08)

* Fix polygon and point coordinates in `pixels_encoder`
Expand Down
2 changes: 1 addition & 1 deletion rio_tiler_mvt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from rio_tiler_mvt.mvt import pixels_encoder, shapes_encoder # noqa

__version__ = "0.1.0"
__version__ = "0.2.0"
4 changes: 2 additions & 2 deletions rio_tiler_mvt/mvt.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import warnings

import numpy
cimport numpy

from vtzero.tile import Tile, Layer, Point, Polygon
cimport numpy

from rasterio._features import _shapes
from rasterio.rio.helpers import coords
from rasterio.transform import IDENTITY
from shapely import geometry
from vtzero.tile import Layer, Point, Polygon, Tile


cpdef bytes pixels_encoder(
Expand Down
32 changes: 25 additions & 7 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[bumpversion]
current_version = 0.1.0
current_version = 0.2.0
commit = True
tag = True
tag_name = {new_version}
parse =
parse =
(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
((?P<pre>a|b|rc|dev)(?P<prenum>\d+))?
serialize =
serialize =
{major}.{minor}.{patch}{pre}{prenum}
{major}.{minor}.{patch}

Expand All @@ -17,10 +17,6 @@ replace = __version__ = "{new_version}"
[metadata]
version = attr: rio_tiler_mvt.__version__

[flake8]
exclude = .git,__pycache__,docs/source/conf.py,old,build,dist
max-line-length = 90

[mypy]
no_strict_optional = True
ignore_missing_imports = True
Expand All @@ -30,3 +26,25 @@ profile = black
known_first_party = rio_tiler_mvt
known_third_party = rasterio,vtzero,shapely
default_section = THIRDPARTY

[tool.ruff]
line-length = 90

[tool.ruff.lint]
select = [
"D1", # pydocstyle errors
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # flake8
"C", # flake8-comprehensions
"B", # flake8-bugbear
]
ignore = [
"E501", # line too long, handled by black
"B008", # do not perform function calls in argument defaults
"B905", # ignore zip() without an explicit strict= parameter, only support with python >3.10
"B028",
]

[tool.ruff.lint.mccabe]
max-complexity = 12
10 changes: 6 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@
description="""A rio-tiler plugin to encode tile array to MVT""",
long_description=long_description,
long_description_content_type="text/markdown",
python_requires=">=3.7",
python_requires=">=3.9",
classifiers=[
"Intended Audience :: Information Technology",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Scientific/Engineering :: GIS",
],
keywords="COG MVT mapbox vectortile GIS",
Expand Down

0 comments on commit d0b4bb4

Please sign in to comment.