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
22 changes: 4 additions & 18 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
repos:
-
repo: 'https://github.com/ambv/black'
# 18.6b1
rev: 22.3.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.10
hooks:
- id: black
args: ['--safe']
-
repo: 'https://github.com/PyCQA/flake8'
rev: 5.0.4
hooks:
- id: flake8
args: [
# E501 let black handle all line length decisions
# W503 black conflicts with "line break before operator" rule
# E203 black conflicts with "whitespace before ':'" rule
# E231 black conflicts with "whitespace after ':'" rule
# E722 bare excepts need to be addressed
'--ignore=E501,W503,E203,E722,E231']
- id: ruff
- id: ruff-format
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

=======

# 2.1.0 (2025-12-24)
- Replace black with ruff

# 2.0.0 (2025-12-23)
- Migrates metadata to pyproject.toml
- Drops support for Python versions < 3.10
Expand Down
32 changes: 6 additions & 26 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
Hi there! Welcome to the tilesets-cli contributing document. Issues, comments, and pull requests are welcome. Please tag @mapbox/maps-api for any questions or reviews.

## Installation

First, clone the repo and `cd` into the folder:
```shell

```bash
# clone
git clone [email protected]:mapbox/tilesets-cli.git
cd tilesets-cli
Expand All @@ -21,36 +23,14 @@ tilesets --version
```

## Pre-commit hooks

We use [pre-commit hooks](https://pre-commit.com/) to auto-format and validate code before committing. `pre-commit` is included with the `[test]` extras, but you must run:
```

```bash
$ pre-commit install
```
within the repo to have the actions specified in `.pre-commit-config.yaml` registered.

After this, when committing, you'll see:
```
git commit -m 'update version'
black....................................................................Passed
Flake8...................................................................Passed
```
If your pre-commit hooks ran successfully. Note that `black` modifies your code, which means that if there is a syntax error you'll first see something like:
```
git commit -m '{message}'
black....................................................................Failed
hookid: black

Files were modified by this hook. Additional output:

reformatted this/file/was/reformatted.py
All done! ✨ 🍰 ✨
1 file reformatted.

Flake8...................................................................Failed
hookid: flake8

this/file/was/reformatted.py:{line}:{character}: {what was incorrect}
```
After which you can add these changes and commit again. Note that failing pre-commit commands mean that the commit has not taken place: you must commit again!

## Release process

Expand Down
1 change: 1 addition & 0 deletions mapbox_tilesets/errors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Error handling for the tilesets CLI"""

from click import ClickException


Expand Down
1 change: 0 additions & 1 deletion mapbox_tilesets/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def geojson_validate(index, feature):


def validate_geojson(index, feature, allow_delete=False):

if allow_delete:
delete_schema = {
"definitions": {},
Expand Down
12 changes: 10 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "mapbox-tilesets"
version = "2.0.0"
version = "2.1.0"
description = "CLI for interacting with and preparing data for the Mapbox Tilesets API"
readme = "README.md"
requires-python = ">=3.10"
Expand Down Expand Up @@ -48,5 +48,13 @@ dev = [
"pytest-cov>=4",
"build>=1.2",
"pre-commit>=3.5",
"black==22.3.0",
"ruff>=0.14.10",
]

[tool.ruff.lint]
ignore = [
"E203", # whitespace before ':'
"E231", # missing whitespace after ',', ';', or ':'
"E501", # line too long
"E722" # bare except
]