Skip to content
Open
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
22 changes: 11 additions & 11 deletions .github/workflows/ci-development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,41 @@ name: Continuous Integration for development
on: pull_request
jobs:
lint:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Install python
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: "3.11"
python-version: "3.12"
- name: Install lint dependencies
run: |
pip install pre-commit black
- name: Install and run pre-commit
uses: pre-commit/[email protected].0
uses: pre-commit/[email protected].1
test:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
needs:
- lint
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up testing python ${{ matrix.config.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.config.python-version }}
- name: Install poetry
uses: abatilo/actions-poetry@v2.3.0
uses: abatilo/actions-poetry@v4
- name: Setup a local virtual environment for caching
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- name: Define a cache for the virtual environment based on the dependencies lock file to speed up later runs
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/ci-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,26 @@ on:

jobs:
test:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Set up testing python ${{ matrix.config.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.config.python-version }}
- name: Install poetry
uses: abatilo/actions-poetry@v2.3.0
uses: abatilo/actions-poetry@v4
- name: Setup a local virtual environment for caching
run: |
poetry config virtualenvs.create true --local
poetry config virtualenvs.in-project true --local
- name: Define a cache for the virtual environment based on the dependencies lock file to speed up later runs
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ./.venv
key: venv-${{ hashFiles('poetry.lock') }}
Expand All @@ -41,17 +41,17 @@ jobs:

build-and-publish:
name: Build and publish Python distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
needs:
- test
steps:
- uses: actions/checkout@v4
- name: Set up base Python 3.11
uses: actions/setup-python@v4
- uses: actions/checkout@v5
- name: Set up base Python 3.12
uses: actions/setup-python@v6
with:
python-version: 3.11
python-version: 3.12
- name: Python Poetry Action
uses: abatilo/actions-poetry@v2.3.0
uses: abatilo/actions-poetry@v4
- name: Publish distribution 📦 with test.pypi.org
if: startsWith(github.ref, 'refs/tags')
run: |
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,6 @@ setup.py

# project files
**/ohsome_log/

# default testing script file
playground.py
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
repos:
- repo: https://github.com/ambv/black
rev: 23.11.0
rev: 25.9.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 7.3.0
hooks:
- id: flake8
args:
Expand All @@ -13,9 +13,9 @@ repos:
- "--ignore=E501,W503,E203,F401,D400,D205,D401,D202,T001,D105"
additional_dependencies:
[
"flake8-bugbear==23.9.16",
"flake8-bugbear==24.12.12",
"flake8-coding==1.3.2",
"flake8-comprehensions==3.14.0",
"flake8-comprehensions==3.17.0",
"flake8-debugger==4.1.2",
"flake8-deprecated==2.2.1",
"flake8-pep3101==2.1.0",
Expand All @@ -25,7 +25,7 @@ repos:
"flake8-docstrings==1.7.0",
]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

## [Unreleased](https://github.com/GIScience/ohsome-py/compare/v0.3.3..master)

### Removed

- support for python 3.10 (it probably still works, we just don't assert it anymore)

### Added

- support for python 3.13

## [0.4.0](https://github.com/GIScience/ohsome-py/releases/tag/v0.4.0)

### Changed
Expand Down
6 changes: 3 additions & 3 deletions ohsome/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def format_bcircles(
dict,
gpd.GeoDataFrame,
pd.DataFrame,
]
],
) -> str:
"""
Formats bcircles parameter to comply with ohsome API
Expand Down Expand Up @@ -152,7 +152,7 @@ def format_bboxes(
List[float],
List[List[str]],
List[List[float]],
]
],
) -> str:
"""
Formats bboxes parameter to comply with ohsome API
Expand Down Expand Up @@ -206,7 +206,7 @@ def format_bboxes(
def format_bpolys(
bpolys: Union[
gpd.GeoDataFrame, gpd.GeoSeries, shapely.Polygon, shapely.MultiPolygon, str
]
],
) -> str:
"""
Formats bpolys parameter to comply with ohsome API
Expand Down
2 changes: 1 addition & 1 deletion ohsome/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def _as_geodataframe(
for feature in self.data["features"]:
properties = feature["properties"]
tags = {}
new_properties = {k: None for k in explode_tags}
new_properties = dict.fromkeys(explode_tags, None)
for k in properties.keys():
if (
(k.startswith("@"))
Expand Down
17 changes: 10 additions & 7 deletions ohsome/test/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,17 @@ def test_exception_connection_reset(base_client):
:return:
"""

with patch(
"requests.sessions.Session.post",
MagicMock(
side_effect=RequestException(
"This request was failed on purpose without response!"
)
with (
patch(
"requests.sessions.Session.post",
MagicMock(
side_effect=RequestException(
"This request was failed on purpose without response!"
)
),
),
), patch("ohsome.OhsomeException.log_response", MagicMock()) as mock_func:
patch("ohsome.OhsomeException.log_response", MagicMock()) as mock_func,
):
bpolys = gpd.read_file(f"{script_path}/data/polygons.geojson")
time = "2018-01-01"
fltr = "name=Krautturm and type:way"
Expand Down
Loading
Loading