Skip to content

Commit

Permalink
update lint config
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentsarago committed Jan 20, 2025
1 parent d0b4bb4 commit a85a8b0
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 83 deletions.
14 changes: 1 addition & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install -e ".[test]"
python -m pip install "vector-tile-base@git+https://github.com/mapbox/vector-tile-base.git"
- name: Run pre-commit
if: ${{ matrix.python-version == env.LATEST_PY_VERSION }}
Expand Down Expand Up @@ -68,23 +69,10 @@ jobs:
python -m pip install --upgrade pip
python -m pip install numpy cython wheel setuptools twine
- name: Set tag version
id: tag
run: |
echo "version=${GITHUB_REF#refs/*/}"
echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Set module version
id: module
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.version }} == ${{ steps.module.outputs.version}}
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
Expand Down
32 changes: 32 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,34 @@
[build-system]
requires = ["setuptools>=46.4", "wheel", "cython", "numpy"]

[tool.mypy]
no_strict_optional = true
ignore_missing_imports = true

[tool.isort]
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
32 changes: 0 additions & 32 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,3 @@ replace = __version__ = "{new_version}"

[metadata]
version = attr: rio_tiler_mvt.__version__

[mypy]
no_strict_optional = True
ignore_missing_imports = True

[tool:isort]
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
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

extra_reqs = {
"test": [
"vector-tile-base @ git+https://github.com/mapbox/vector-tile-base.git",
# "vector-tile-base@git+https://github.com/mapbox/vector-tile-base.git",
"protobuf==3.20.1",
"rio-tiler>=2.0",
"pytest",
Expand Down
2 changes: 1 addition & 1 deletion tests/test_mvt.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_pixels_encoder():
assert len(mvt.layers) == 1

# Test bad feature type
with pytest.raises(Exception):
with pytest.raises(Exception): # noqa: B017
pixels_encoder(tile, mask, feature_type="somethingelse")


Expand Down
36 changes: 0 additions & 36 deletions tox.ini

This file was deleted.

0 comments on commit a85a8b0

Please sign in to comment.