From a17d0a49ba931f1911cc26a5e275fe4c3ce11e0b Mon Sep 17 00:00:00 2001 From: jqtrde Date: Wed, 19 Nov 2025 21:47:11 -0500 Subject: [PATCH 01/18] Replace setup.py with pyproject.toml --- pyproject.toml | 50 ++++++++++++++++++++++++++++++++++++++ requirements.txt | 12 ---------- setup.cfg | 0 setup.py | 62 ------------------------------------------------ 4 files changed, 50 insertions(+), 74 deletions(-) create mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 setup.cfg delete mode 100755 setup.py diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..388c59a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,50 @@ +[build-system] +requires = ["setuptools>=68", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "mapbox-tilesets" +version = "1.14.0" +description = "CLI for interacting with and preparing data for the Mapbox Tilesets API" +readme = "README.md" +requires-python = ">=3.9" +license = { file = "LICENSE.md" } +authors = [{ name = "Mapbox", email = "raster@mapbox.com" }] +keywords = ["mapbox", "tilesets", "cli", "geojson", "vector tiles"] +classifiers = [ + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "License :: OSI Approved :: BSD License", + "Operating System :: OS Independent", +] + +dependencies = [ + "click>=8.1", + "cligj>=0.7", + "requests>=2.32", + "requests-toolbelt>=1.0", + "jsonschema>=4.18,<5", + "mercantile>=1.1", + "geojson>=3.0", + "numpy>=1.23,<2", +] + +[project.optional-dependencies] +estimate-area = ["supermercado>=0.2.0"] + +[project.scripts] +tilesets = "mapbox_tilesets.scripts.cli:cli" + +[tool.pytest.ini_options] +addopts = "-q --strict-markers --disable-warnings" +testpaths = ["tests"] + +[dependency-groups] +dev = [ + "ruff>=0.5", + "pyright>=1.1.385", + "pytest>=8", + "pytest-cov>=4", + "build>=1.2", + "pre-commit>=3.5", +] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index d61b6ec..0000000 --- a/requirements.txt +++ /dev/null @@ -1,12 +0,0 @@ -boto3==1.23.10 -Click==8.0.2 -cligj==0.7.2 -numpy==1.19.5 -requests==2.27.1 -requests-toolbelt==0.9.1 -jsonschema==3.0.1 -jsonseq==1.0.0 -mercantile==1.1.6 -supermercado==0.2.0 -geojson===2.5.0 -urllib3==1.26.19 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index e69de29..0000000 diff --git a/setup.py b/setup.py deleted file mode 100755 index 05ea71c..0000000 --- a/setup.py +++ /dev/null @@ -1,62 +0,0 @@ -import os -from codecs import open as codecs_open -from setuptools import setup, find_packages - -from mapbox_tilesets import __version__ - -# Get the long description from the relevant file -with codecs_open("README.md", encoding="utf-8") as f: - long_description = f.read() - - -def read(fname): - return open(os.path.join(os.path.dirname(__file__), fname)).read() - - -setup( - name="mapbox-tilesets", - version=__version__, - description="CLI for interacting with and preparing data for the Tilesets API", - long_description=long_description, - long_description_content_type="text/markdown", - classifiers=[], - keywords="", - author="Mapbox", - author_email="sam@mapbox.com", - url="https://github.com/mapbox/tilesets-cli", - license="BSD-2", - packages=find_packages(exclude=["ez_setup", "examples", "tests"]), - install_requires=[ - "boto3", - "click~=8.0.2", - "cligj", - "numpy", - "requests", - "requests-toolbelt", - "jsonschema~=3.0", - "jsonseq~=1.0", - "mercantile~=1.1.6", - "geojson~=2.5.0", - ], - include_package_data=True, - zip_safe=False, - extras_require={ - "estimate-area": [ - "supermercado~=0.2.0", - ], - "test": [ - "codecov", - "pytest==6.2.5", - "pytest-cov", - "pre-commit", - "black==22.3.0", - "pep8", - "supermercado~=0.2.0", - "toml==0.10.2", - ], - }, - entry_points=""" - [console_scripts] - tilesets=mapbox_tilesets.scripts.cli:cli - """, -) From 6280f299d48ea359c22961e1dbc0c7b8a3ee2678 Mon Sep 17 00:00:00 2001 From: jqtrde Date: Wed, 19 Nov 2025 21:47:24 -0500 Subject: [PATCH 02/18] Pull version from pyproject.toml --- mapbox_tilesets/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mapbox_tilesets/__init__.py b/mapbox_tilesets/__init__.py index 1570161..7610c40 100644 --- a/mapbox_tilesets/__init__.py +++ b/mapbox_tilesets/__init__.py @@ -1,3 +1,8 @@ """mapbox_tilesets package""" -__version__ = "1.14.0" +from importlib.metadata import PackageNotFoundError, version as _pkg_version + +try: + __version__ = _pkg_version("mapbox-tilesets") +except PackageNotFoundError: + __version__ = "0.0.0" From 0b94146d5ca316e3742bd40410225fe44e4a2183 Mon Sep 17 00:00:00 2001 From: jqtrde Date: Wed, 19 Nov 2025 21:48:00 -0500 Subject: [PATCH 03/18] Increment version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 388c59a..de23e7e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "mapbox-tilesets" -version = "1.14.0" +version = "1.15.0" description = "CLI for interacting with and preparing data for the Mapbox Tilesets API" readme = "README.md" requires-python = ">=3.9" From 436f33fb2dc236f1dd3172dcb742056745d18d18 Mon Sep 17 00:00:00 2001 From: jqtrde Date: Wed, 19 Nov 2025 22:02:12 -0500 Subject: [PATCH 04/18] Bump minimum version to 3.10 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index de23e7e..5bb1032 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "mapbox-tilesets" version = "1.15.0" description = "CLI for interacting with and preparing data for the Mapbox Tilesets API" readme = "README.md" -requires-python = ">=3.9" +requires-python = ">=3.10" license = { file = "LICENSE.md" } authors = [{ name = "Mapbox", email = "raster@mapbox.com" }] keywords = ["mapbox", "tilesets", "cli", "geojson", "vector tiles"] From ff2418e03912cf5b68f08949f3351f5f6db81150 Mon Sep 17 00:00:00 2001 From: jqtrde Date: Wed, 19 Nov 2025 22:02:31 -0500 Subject: [PATCH 05/18] Refresh CI harness --- .github/workflows/test.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f1c0ff0..ef3cf78 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -10,9 +10,15 @@ jobs: strategy: matrix: include: - - python-version: 3.8 + - python-version: '3.10' os: ubuntu-22.04 - - python-version: 3.9 + - python-version: '3.11' + os: ubuntu-22.04 + - python-version: '3.12' + os: ubuntu-22.04 + - python-version: '3.13' + os: ubuntu-22.04 + - python-version: '3.14' os: ubuntu-22.04 runs-on: ${{ matrix.os }} @@ -27,9 +33,9 @@ jobs: - name: Install dependencies run: | - python -m pip install --upgrade pip setuptools - pip install "importlib-metadata==4.8.3" - pip install -r requirements.txt -e .[test] + python -m pip install --upgrade pip + pip install -e '.[estimate-area]' + pip install pytest pytest-cov pre-commit codecov - name: Show Python and pytest versions run: | @@ -46,7 +52,7 @@ jobs: run: ls -la - name: Upload coverage to GitHub (optional, internal) - if: matrix.python-version == '3.8' + if: matrix.python-version == '3.10' uses: actions/upload-artifact@v4 with: name: coverage-report From 5c725396d53baf3e061192b7fbc8199756c61ef6 Mon Sep 17 00:00:00 2001 From: jqtrde Date: Wed, 19 Nov 2025 22:09:30 -0500 Subject: [PATCH 06/18] Drop pyright --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5bb1032..dcc431a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,6 @@ testpaths = ["tests"] [dependency-groups] dev = [ "ruff>=0.5", - "pyright>=1.1.385", "pytest>=8", "pytest-cov>=4", "build>=1.2", From 7f7d362d21456b11273e445bcd1f2a07a90c21d9 Mon Sep 17 00:00:00 2001 From: jqtrde Date: Wed, 19 Nov 2025 22:23:33 -0500 Subject: [PATCH 07/18] Remove version test We'll do this a little differently soon. --- tests/test_version_documentation.py | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 tests/test_version_documentation.py diff --git a/tests/test_version_documentation.py b/tests/test_version_documentation.py deleted file mode 100644 index 12cadb4..0000000 --- a/tests/test_version_documentation.py +++ /dev/null @@ -1,7 +0,0 @@ -from mapbox_tilesets import __version__ - - -def test_versions(): - mod_version = __version__ - with open("./CHANGELOG.md") as src: - assert len([line in line for line in src if mod_version in line]) == 1 From a50add194e4a6042a3ae8359dd0f75d049905f0a Mon Sep 17 00:00:00 2001 From: jqtrde Date: Wed, 19 Nov 2025 22:31:34 -0500 Subject: [PATCH 08/18] Ensure that TilesetNameError is wired up appropriately --- mapbox_tilesets/errors.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mapbox_tilesets/errors.py b/mapbox_tilesets/errors.py index 93f3ba9..523ec66 100644 --- a/mapbox_tilesets/errors.py +++ b/mapbox_tilesets/errors.py @@ -17,6 +17,7 @@ def __init__(self, message): message: str Error description """ + super().__init__(message) self.message = message @@ -25,7 +26,7 @@ class TilesetNameError(TilesetsError): def __init__(self, tileset_id): self.tileset_id = tileset_id - self.message = "Invalid Tileset ID" + super().__init__("Invalid Tileset ID") def __str__(self): return "{tileset_id} -> {message}".format( From 9e8d3eb3d16026166627752e9cc553367ebcc980 Mon Sep 17 00:00:00 2001 From: jqtrde Date: Thu, 20 Nov 2025 09:56:21 -0500 Subject: [PATCH 09/18] Pare down build matrix Rasterio wheels don't exist for the full matrix yet. --- .github/workflows/test.yaml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index ef3cf78..d7f835a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -16,10 +16,6 @@ jobs: os: ubuntu-22.04 - python-version: '3.12' os: ubuntu-22.04 - - python-version: '3.13' - os: ubuntu-22.04 - - python-version: '3.14' - os: ubuntu-22.04 runs-on: ${{ matrix.os }} From a573221ac5292b2af34376b5934034c35432929f Mon Sep 17 00:00:00 2001 From: jqtrde Date: Thu, 20 Nov 2025 10:10:02 -0500 Subject: [PATCH 10/18] Simplify CI matrix --- .github/workflows/test.yaml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index d7f835a..27fe549 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -9,13 +9,8 @@ jobs: test: strategy: matrix: - include: - - python-version: '3.10' - os: ubuntu-22.04 - - python-version: '3.11' - os: ubuntu-22.04 - - python-version: '3.12' - os: ubuntu-22.04 + os: ["ubuntu-22.04"] + python-version: ["3.10", "3.11", "3.12"] runs-on: ${{ matrix.os }} From 227b6c7e3aadce4fa4182fb25c603cadec333063 Mon Sep 17 00:00:00 2001 From: jqtrde Date: Thu, 20 Nov 2025 10:14:49 -0500 Subject: [PATCH 11/18] Keep black around for a bit longer --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index dcc431a..646f90c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,9 +41,9 @@ testpaths = ["tests"] [dependency-groups] dev = [ - "ruff>=0.5", "pytest>=8", "pytest-cov>=4", "build>=1.2", "pre-commit>=3.5", + "black==22.3.0", ] From 7fd940279dfb66e9010f27e0eebd9eace4d1c4db Mon Sep 17 00:00:00 2001 From: jqtrde Date: Thu, 20 Nov 2025 10:19:43 -0500 Subject: [PATCH 12/18] Adjust versioning mechanics --- CONTRIBUTING.md | 2 +- mapbox_tilesets/__init__.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b537031..af4919c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,7 +56,7 @@ After which you can add these changes and commit again. Note that failing pre-co Releases to PyPi are handled via Github Actions and GitHub tags. Once changes have been merged to master: -1. Update the version in mapbox_tilesets/__init__.py +1. Update the version in `pyproject.toml` 2. Update the changelog 3. Commit changes to **your branch**. For example `git commit -am '0.2.0' && git push origin HEAD` 4. Get a review and merge your changes to master. diff --git a/mapbox_tilesets/__init__.py b/mapbox_tilesets/__init__.py index 7610c40..e1514b6 100644 --- a/mapbox_tilesets/__init__.py +++ b/mapbox_tilesets/__init__.py @@ -5,4 +5,5 @@ try: __version__ = _pkg_version("mapbox-tilesets") except PackageNotFoundError: - __version__ = "0.0.0" + # Fallback for development mode + __version__ = "0.0.0.dev" From 7425a8aadea022f9c6ed10718bee390ced707b05 Mon Sep 17 00:00:00 2001 From: jqtrde Date: Tue, 23 Dec 2025 09:23:58 -0500 Subject: [PATCH 13/18] Update README --- README.md | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 32488d0..0f0dd86 100644 --- a/README.md +++ b/README.md @@ -14,23 +14,18 @@ CLI for interacting with and preparing data for the [Mapbox Tiling Service](http ## Requirements -- Python >= 3.6 (can be installed via virtualenv) -- Recommended: [virtualenv](https://virtualenv.pypa.io/) / [virtualenvwrapper](https://virtualenvwrapper.readthedocs.io/en/latest/) +- Python >= 3.10 -## Basic installation - -`pip install mapbox-tilesets` will install everything but [`estimate-area`](#estimate-area). +`pip install mapbox-tilesets` will install everything but the [`estimate-area`](#estimate-area) command. ## Installing optional `estimate-area` command If you are using an x86 Mac or Linux machine, run: -`pip install 'mapbox-tilesets[estimate-area]'` - -Otherwise, you will need to install some dependencies. +`pip install 'mapbox-tilesets[estimate-area]'`. Otherwise, you will need to install some dependencies. ### arm64 MacOS -If you're on an arm64 Mac (e.g., with an M1 chip), you'll need to install [GDAL](https://gdal.org/) first. On Mac, a simple way is to use [Homebrew](https://brew.sh/): +If you're on an Arm64 Mac, you'll need to install [GDAL](https://gdal.org/) first. On Mac, a simple way is to use [Homebrew](https://brew.sh/): ```sh $ brew install gdal @@ -507,4 +502,4 @@ Publishes changesets for a tileset that supports incremental updates. This comma ```shell tilesets publish-changesets --changeset /path/to/changeset.json -``` \ No newline at end of file +``` From f2b5ffc9a7f7577ae140d1f5ed48f0efd65ebf58 Mon Sep 17 00:00:00 2001 From: jqtrde Date: Tue, 23 Dec 2025 09:25:57 -0500 Subject: [PATCH 14/18] Make package explicit --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 646f90c..43110ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,9 @@ tilesets = "mapbox_tilesets.scripts.cli:cli" addopts = "-q --strict-markers --disable-warnings" testpaths = ["tests"] +[tool.setuptools] +packages = ["mapbox_tilesets"] + [dependency-groups] dev = [ "pytest>=8", From a22b2bfc411e11ed4fc9630c73148dad5a93891c Mon Sep 17 00:00:00 2001 From: jqtrde Date: Tue, 23 Dec 2025 09:41:44 -0500 Subject: [PATCH 15/18] Add missing module --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 43110ae..b22609a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ addopts = "-q --strict-markers --disable-warnings" testpaths = ["tests"] [tool.setuptools] -packages = ["mapbox_tilesets"] +packages = ["mapbox_tilesets", "mapbox_tilesets.scripts"] [dependency-groups] dev = [ From 98a166e76d54aa7c00c06ec3a41792f87ed26c4d Mon Sep 17 00:00:00 2001 From: jqtrde Date: Tue, 23 Dec 2025 10:36:13 -0500 Subject: [PATCH 16/18] Major version bump to 2.0.0 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b22609a..c25b963 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "mapbox-tilesets" -version = "1.15.0" +version = "2.0.0" description = "CLI for interacting with and preparing data for the Mapbox Tilesets API" readme = "README.md" requires-python = ">=3.10" From 9ab942c540d5f661f2ede575314e5058e05fa9d4 Mon Sep 17 00:00:00 2001 From: jqtrde Date: Tue, 23 Dec 2025 13:07:11 -0500 Subject: [PATCH 17/18] Bump changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a20483..33c15d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ======= +# 2.0.0 (2025-12-23) +- Migrates metadata to pyproject.toml +- Drops support for Python versions < 3.10 + # 1.14.0 (2025-04-23) - Added command `tilesets upload-changeset` that uploads a changeset file. - Added command `tilesets publish-changesets` that publishes changesets for a incrementally updatable tileset. From f593476cd1db2afe3eb831e29f68c5477e0f8291 Mon Sep 17 00:00:00 2001 From: jqtrde Date: Wed, 24 Dec 2025 10:12:41 -0500 Subject: [PATCH 18/18] Adjust email --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c25b963..1b2c486 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ description = "CLI for interacting with and preparing data for the Mapbox Tilese readme = "README.md" requires-python = ">=3.10" license = { file = "LICENSE.md" } -authors = [{ name = "Mapbox", email = "raster@mapbox.com" }] +authors = [{ name = "Mapbox", email = "maps-api-team@mapbox.com" }] keywords = ["mapbox", "tilesets", "cli", "geojson", "vector tiles"] classifiers = [ "Programming Language :: Python :: 3",