Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v 1.1.1 #176

Merged
merged 28 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
4c1c4f4
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Oct 16, 2023
ac83b20
Merge pull request #171 from cleder/pre-commit-ci-update-config
cleder Oct 16, 2023
ac1743d
Test with python 3.13
cleder Oct 17, 2023
e6f54b9
Drop setup.py in favour of pyproject.toml #170
cleder Oct 23, 2023
b736063
format pyproject.toml
cleder Oct 23, 2023
ccb47f9
[pre-commit.ci] pre-commit autoupdate
pre-commit-ci[bot] Oct 23, 2023
dac3e64
make version dynamic to have only one source of truth
cleder Oct 23, 2023
e3e4809
remove manifest.in
cleder Oct 23, 2023
cd0da84
configure ruff strict
cleder Oct 24, 2023
a4fcfef
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 24, 2023
446f509
style: format code with Black and isort
deepsource-autofix[bot] Oct 24, 2023
5476bc8
Merge pull request #173 from cleder/pre-commit-ci-update-config
cleder Oct 24, 2023
60e7392
Merge branch 'develop' into 170-modernize-packaging
cleder Oct 24, 2023
83ee20b
fix ruff errors
cleder Oct 24, 2023
c60c834
avoid Any, use a protocol
cleder Oct 24, 2023
806c46e
Merge pull request #172 from cleder/170-modernize-packaging
cleder Oct 24, 2023
8d34969
use keyword arguments where possible
cleder Oct 25, 2023
d62ad45
per file ignores for flake8
cleder Oct 25, 2023
c8420ff
add codecov token
cleder Oct 25, 2023
930f6bf
Merge pull request #174 from cleder/170-modernize-packaging
cleder Oct 25, 2023
2e317bd
move requirements to toml
cleder Oct 27, 2023
f748513
python -m pip
cleder Oct 27, 2023
bed2c10
forgot -e
cleder Oct 27, 2023
d0fdb2c
fix typo
cleder Oct 27, 2023
2032a19
remove test-requirements.txt
cleder Oct 27, 2023
a889b39
Merge pull request #175 from cleder/170-modernize-packaging
cleder Oct 27, 2023
286a30d
bring pre-commit in line with dependencies
cleder Oct 27, 2023
4226320
add flake8-function-order
cleder Oct 27, 2023
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
16 changes: 9 additions & 7 deletions .github/workflows/run-all-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# run tests and lint with a variety of Python versions
---
name: Tests
on: [push, pull_request]

Check warning on line 5 in .github/workflows/run-all-tests.yml

View workflow job for this annotation

GitHub Actions / static-tests (3.11)

5:1 [truthy] truthy value should be one of [false, true]

Check warning on line 5 in .github/workflows/run-all-tests.yml

View workflow job for this annotation

GitHub Actions / static-tests (3.11)

5:1 [truthy] truthy value should be one of [false, true]

Check warning on line 5 in .github/workflows/run-all-tests.yml

View workflow job for this annotation

GitHub Actions / static-tests (3.11)

5:1 [truthy] truthy value should be one of [false, true]

jobs:
cpython:
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 @@
- 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 @@
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 @@
- 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 @@
- 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 @@
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
Loading