Skip to content

Commit

Permalink
Merge pull request #176 from cleder/develop
Browse files Browse the repository at this point in the history
v 1.1.1
  • Loading branch information
cleder authored Oct 27, 2023
2 parents be7fecf + 4226320 commit a6bde2d
Show file tree
Hide file tree
Showing 24 changed files with 453 additions and 334 deletions.
16 changes: 9 additions & 7 deletions .github/workflows/run-all-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13-dev']

steps:
- uses: actions/checkout@v4
Expand All @@ -20,7 +20,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov typing_extensions
python -m pip install -e ".[tests]"
- name: Test with pytest
run: |
pytest tests --cov=tests --cov=pygeoif --cov-report=xml
Expand All @@ -30,12 +30,13 @@ jobs:
with:
fail_ci_if_error: true
verbose: true
token: ${{ env.CODECOV_TOKEN }}

static-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10']
python-version: ['3.11']

steps:
- uses: actions/checkout@v4
Expand All @@ -46,14 +47,15 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r test-requirements.txt
python -m pip install -e ".[typing, complexity, linting]"
- name: Typecheck
run: |
mypy pygeoif
- name: Linting
run: |
flake8 pygeoif
black --check pygeoif tests
ruff --no-fix pygeoif tests
yamllint .github/workflows/
- name: Check complexity
run: |
Expand All @@ -75,7 +77,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest typing_extensions
python -m pip install -e ".[tests]"
- name: Test with pytest
run: |
pytest tests
Expand All @@ -87,10 +89,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.12
- name: Install pypa/build
run: >-
python -m
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ venv/
.venv/
coverage.xml
.mutmut-cache
.watchmanconfig
html/
.dccache
.pytest_cache
.pyre/
.mypy_cache/
.pytype/
.ruff_cache/
.venv/
venv/
__pycache__/
*.stderr*
51 changes: 19 additions & 32 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,75 +40,62 @@ repos:
rev: 5.12.0
hooks:
- id: isort
# - repo: https://github.com/dhruvmanila/remove-print-statements
# rev: 'v0.5.0'
# hooks:
# - id: remove-print-statements
# args: ['--verbose'] # Show all the print statements to be removed
- repo: https://github.com/psf/black
rev: 23.9.1
rev: 23.10.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.0.292'
rev: 'v0.1.1'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
# - flake8-absolute-import
# - flake8-awesome
# - flake8-bandit
# - flake8-blind-except
- flake8-bugbear
# - flake8-class-attributes-order
- flake8-cognitive-complexity
# - flake8-commas
- flake8-comments
- flake8-complex-f-strings
# - flake8-continuation
# - flake8-debugger
- flake8-docstrings
# - flake8-dunder-all
- flake8-continuation
- flake8-dunder-all
- flake8-encodings
- flake8-expression-complexity
# - flake8-function-order
- flake8-function-order
- flake8-implicit-str-concat
- flake8-literal
- flake8-noqa
- flake8-pep3101
- flake8-print
- flake8-raise
- flake8-rst-docstrings
- flake8-simplify
# - flake8-slots
- flake8-string-format
- flake8-super
- flake8-typing-imports
# - flake8-use-fstring
- pep8-naming
- flake8-use-fstring
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.6.1
hooks:
- id: mypy
# - repo: https://github.com/Lucas-C/pre-commit-hooks-markup
# rev: v1.0.1
# hooks:
# - id: rst-linter
- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.15
hooks:
- id: validate-pyproject
- repo: https://github.com/kieran-ryan/pyprojectsort
rev: v0.3.0
hooks:
- id: check-manifest
- id: pyprojectsort
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: "0.27.0"
hooks:
- id: check-github-workflows
- id: check-github-actions
- id: check-readthedocs
# - repo: https://github.com/regebro/pyroma
# rev: "4.1"
# hooks:
# - id: pyroma
- repo: https://github.com/regebro/pyroma
rev: "4.2"
hooks:
- id: pyroma
...
7 changes: 0 additions & 7 deletions MANIFEST.in

This file was deleted.

14 changes: 9 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,21 @@ implement this protocol:
* `Shapely <https://github.com/Toblerity/Shapely>`_
* `pyshp <https://pypi.python.org/pypi/pyshp>`_

So when you want to write your own geospatial library with support
When you want to write your own geospatial library with support
for this protocol you may use pygeoif as a starting point and build
your functionality on top of it
your functionality on top of it. It has no requirements outside the
Python standard library and is therefore easy to integrate into your
project. It is tested on `CPython <https://python.org>`_ and
`PyPy <https://www.pypy.org/>`_, but it should work on alternative
Python implementations (that implement the language specification *>=3.8*) as well.

You may think of pygeoif as a 'shapely ultralight' which lets you
construct geometries and perform **very** basic operations like
reading and writing geometries from/to WKT, constructing line strings
out of points, polygons from linear rings, multi polygons from
polygons, etc. It was inspired by shapely and implements the
geometries in a way that when you are familiar with shapely
you feel right at home with pygeoif.
geometries in a way that when you are familiar with pygeoif,
you will feel right at home with shapely or the other way round.

It was written to provide clean and python only geometries for fastkml_

Expand All @@ -35,7 +39,7 @@ It was written to provide clean and python only geometries for fastkml_
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black

.. image:: https://img.shields.io/badge/type%20checker-mypy-blue
.. image:: https://img.shields.io/badge/type-checker-mypy-blue
:target: http://mypy-lang.org/

.. image:: https://www.openhub.net/p/pygeoif/widgets/project_thin_badge.gif
Expand Down
5 changes: 5 additions & 0 deletions docs/HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

1.1.1 (unreleased)
------------------

- Use pyproject.toml instead of setup.py

1.1 (2023/10/13)
-----------------

Expand Down
2 changes: 1 addition & 1 deletion docs/LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Pygeoif is a basic implementation of the __geo_interface__ in
pure Python

Copyright (C) 2012 - 2022 Christian Ledermann
Copyright (C) 2012 - 2023 Christian Ledermann

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand Down
9 changes: 7 additions & 2 deletions mutmut_config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""Mutmut configuration."""
from typing import Any
from typing import Protocol

files_to_mutate = [
"pygeoif/geometry.py",
Expand All @@ -9,7 +9,12 @@
]


def pre_mutation(context: Any) -> None:
class Context(Protocol):
filename: str
skip: bool


def pre_mutation(context: Context) -> None:
"""Only include the files specified above."""
if context.filename not in files_to_mutate:
context.skip = True
Expand Down
3 changes: 2 additions & 1 deletion pygeoif/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (C) 2012 - 2022 Christian Ledermann
# Copyright (C) 2012 - 2023 Christian Ledermann
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
Expand All @@ -16,6 +16,7 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
"""PyGeoIf provides a GeoJSON-like protocol for geo-spatial (GIS) vector data."""
from pygeoif.about import __version__ # noqa: F401
from pygeoif.factories import from_wkt
from pygeoif.factories import mapping
from pygeoif.factories import orient
Expand Down
6 changes: 6 additions & 0 deletions pygeoif/about.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""
About pygeoif.
The only purpose of this module is to provide a version number for the package.
"""
__version__ = "1.1.1"
2 changes: 1 addition & 1 deletion pygeoif/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class WKTParserError(AttributeError):


class InvalidGeometryError(ValueError):
"""This geometry is not valid."""
"""Geometry is not valid."""


__all__ = [
Expand Down
Loading

0 comments on commit a6bde2d

Please sign in to comment.