Skip to content
Merged
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
14 changes: 0 additions & 14 deletions .github/workflows/run_checks_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,6 @@ jobs:
- uses: actions/setup-python@v5
- uses: pre-commit/action@v3.0.1

pylint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- name: install Pylint and plugin
run: |
python -m pip install --upgrade pip
pip install pytest pylint pylint-per-file-ignores
pip install -e .
- name: run Pylint for errors, warnings and remarks only (ignore Comments/ Code style)
run: |
pylint --disable=C test_shapefile.py src/shapefile.py

build_wheel_and_sdist:
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ repos:
- id: check-yaml
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.17.0
rev: v1.17.1
hooks:
- id: mypy
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,8 @@ index which is 7.

>>> s = sf.shape(7)
>>> s
Shape #7: POLYGON
Polygon #7


>>> # Read the bbox of the 8th shape to verify
>>> # Round coordinates to 3 decimal places
Expand All @@ -476,7 +477,7 @@ index which is 7.

Each shape record (except Points) contains the following attributes. Records of
shapeType Point do not have a bounding box 'bbox'.

# TODO!! Fix attributes

>>> for name in dir(shapes[3]):
... if not name.startswith('_'):
Expand Down
39 changes: 6 additions & 33 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"typing_extensions",
]

[project.optional-dependencies]
Expand All @@ -47,6 +46,12 @@ sources = {"src" = ""} # move from "src" directory for wheel
[tool.hatch.version]
path = "src/shapefile.py"

[tool.pytest.ini_options]
markers = [
"network: marks tests requiring network access",
"slow: marks other tests that cause bottlenecks",
]

[tool.ruff]
# Exclude a variety of commonly ignored directories.
exclude = [
Expand Down Expand Up @@ -111,35 +116,3 @@ skip-magic-trailing-comma = false
line-ending = "auto"


[tool.pylint.MASTER]
load-plugins=[
"pylint_per_file_ignores",
]

# Silence warnings: src/shapefile.py:2076:20: W0212: Access to a protected member _from_geojson of a client class (protected-access)
# src/shapefile.py:950:16: W0201: Attribute 'm' defined outside __init__ (attribute-defined-outside-init)
# src/shapefile.py:973:12: W0707: Consider explicitly re-raising using 'except error as exc' and
# 'raise ShapefileException(f'Failed to write bounding box for record {i}.
# Expected floats.') from exc' (raise-missing-from)
# Silence remarks:
# src\shapefile.py:338:0: R0914: Too many local variables (21/15) (too-many-locals)
# src\shapefile.py:338:0: R0912: Too many branches (24/12) (too-many-branches)
# src\shapefile.py:338:0: R0915: Too many statements (52/50) (too-many-statements)
# src\shapefile.py:470:0: R0902: Too many instance attributes (9/7) (too-many-instance-attributes)
# src\shapefile.py:471:4: R0913: Too many arguments (6/5) (too-many-arguments)
# src\shapefile.py:471:4: R0917: Too many positional arguments (6/5) (too-many-positional-arguments)
# src\shapefile.py:506:4: R0911: Too many return statements (10/6) (too-many-return-statements)
# src\shapefile.py:878:0: R0903: Too few public methods (0/2) (too-few-public-methods)
# src\shapefile.py:1981:0: R0904: Too many public methods (23/20) (too-many-public-methods)
# src\shapefile.py:2117:17: R1732: Consider using 'with' for resource-allocating operations (consider-using-with)
# Silence warnings: test_shapefile.py:{783,786,799,803,06,1195}:19:
# W0212: Access to a protected member _offsets of a
# client class (protected-access)
#
# Toml multi-line string used instead of array due to:
# https://github.com/christopherpickering/pylint-per-file-ignores/issues/160
[tool.pylint.'messages control']
per-file-ignores = [
"/src/shapefile.py:W0707,W0212,W0201,R0902,R0903,R0904,R0911,R0912,R0913,R0914,R0915,R0917,R1732",
"test_shapefile.py:W0212,R1732",
]
4 changes: 0 additions & 4 deletions pytest.ini

This file was deleted.

Loading
Loading