Skip to content

Commit

Permalink
Merge pull request #208 from cleder/develop
Browse files Browse the repository at this point in the history
version 1.3.0
  • Loading branch information
cleder authored Feb 5, 2024
2 parents fe831e5 + 29094d3 commit 789d31f
Show file tree
Hide file tree
Showing 25 changed files with 99 additions and 229 deletions.
2 changes: 0 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Set update schedule for GitHub Actions

version: 2
updates:
- package-ecosystem: "github-actions"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -54,7 +54,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -68,5 +68,5 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
...
15 changes: 15 additions & 0 deletions .github/workflows/pr_agent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
on: [pull_request, issue_comment]

Check warning on line 1 in .github/workflows/pr_agent.yml

View workflow job for this annotation

GitHub Actions / static-tests (3.11)

1:1 [document-start] missing document start "---"

Check warning on line 1 in .github/workflows/pr_agent.yml

View workflow job for this annotation

GitHub Actions / static-tests (3.11)

1:1 [truthy] truthy value should be one of [false, true]
jobs:
pr_agent_job:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
contents: write
name: Run pr agent on every pull request, respond to user comments
steps:
- name: PR Agent action step
uses: Codium-ai/pr-agent@main
env:
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 6 additions & 6 deletions .github/workflows/run-all-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -26,11 +26,11 @@ jobs:
pytest tests --cov=tests --cov=pygeoif --cov-report=xml
- name: "Upload coverage to Codecov"
if: ${{ matrix.python-version==3.11 }}
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
verbose: true
token: ${{ env.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }}

static-tests:
runs-on: ubuntu-latest
Expand All @@ -41,7 +41,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.pypy-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.pypy-version }}
- name: Install dependencies
Expand All @@ -90,7 +90,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install pypa/build
Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ repos:
hooks:
- id: absolufy-imports
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.11.0
rev: 24.1.1
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.1.6'
rev: 'v0.1.14'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -68,23 +68,23 @@ repos:
- flake8-typing-imports
- flake8-use-fstring
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
rev: v1.8.0
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/abravalheri/validate-pyproject
rev: v0.15
rev: v0.16
hooks:
- id: validate-pyproject
- repo: https://github.com/kieran-ryan/pyprojectsort
rev: v0.3.0
hooks:
- id: pyprojectsort
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: "0.27.2"
rev: "0.27.3"
hooks:
- id: check-github-workflows
- id: check-github-actions
Expand Down
14 changes: 13 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ It was written to provide clean and python only geometries for fastkml_
:target: https://pypi.python.org/pypi/pygeoif/
:alt: Supported Python implementations

.. image:: https://img.shields.io/pypi/v/pygeoif.svg
:target: https://pypi.python.org/pypi/pygeoif/
:alt: Latest Version

.. image:: https://img.shields.io/pypi/l/pygeoif.svg
:target: https://pypi.python.org/pypi/pygeoif/
:alt: License

.. image:: https://img.shields.io/pypi/dm/pygeoif.svg
:target: https://pypi.python.org/pypi/pygeoif/
:alt: Downloads

Installation
------------

Expand Down Expand Up @@ -103,7 +115,7 @@ Example


You find more examples in the
`tests <https://github.com/cleder/pygeoif/tree/main/pygeoif/tests>`_
`tests <https://github.com/cleder/pygeoif/tree/main/tests>`_
directory which cover every aspect of pygeoif or in fastkml_.

Classes
Expand Down
4 changes: 4 additions & 0 deletions docs/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

1.3.0 (unreleased)
------------------


1.2.0 (2023/11/27)
------------------

Expand Down
1 change: 1 addition & 0 deletions mutmut_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Mutmut configuration."""

from typing import Protocol

files_to_mutate = [
Expand Down
3 changes: 2 additions & 1 deletion pygeoif/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
The only purpose of this module is to provide a version number for the package.
"""
__version__ = "1.2.0"

__version__ = "1.3.0"
3 changes: 3 additions & 0 deletions pygeoif/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ def shape(
>>> geom2 = shape(geom)
>>> geom == geom2
True
"""
type_map = {
"Point": Point,
Expand Down Expand Up @@ -173,6 +174,7 @@ def num(number: str) -> float:
Returns
-------
float or an integer if the string can be converted to an integer
"""
f = float(number)
return int(f) if int(f) == f else f
Expand Down Expand Up @@ -328,6 +330,7 @@ def mapping(
>>> pt = Point(0, 0)
>>> mapping(pt)
{'type': 'Point', 'bbox': (0, 0, 0, 0), 'coordinates': (0, 0)}
"""
return ob.__geo_interface__

Expand Down
4 changes: 3 additions & 1 deletion pygeoif/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ class Feature:
{'Name': 'Sample Point', 'Other': 'Other Data'}
>>> a.properties['Name']
'Sample Point'
"""

def __init__(
Expand Down Expand Up @@ -110,7 +111,7 @@ def __repr__(self) -> str:
)

@property
def id(self) -> Optional[Union[str, int]]: # noqa: A003
def id(self) -> Optional[Union[str, int]]:
"""Return the id of the feature."""
return self._feature_id

Expand Down Expand Up @@ -168,6 +169,7 @@ class FeatureCollection:
{'geometry': {'type': 'Point', 'coordinates': (1.0, -1.0)},
'type': 'Feature',
'properties': {'Other': 'Other Data2', 'Name': 'Sample Point2'}}]}
"""

def __init__(self, features: Sequence[Feature]) -> None:
Expand Down
Loading

0 comments on commit 789d31f

Please sign in to comment.