From 9690e820e05350e91daaa70f1e26730f851bdc60 Mon Sep 17 00:00:00 2001 From: Michael Szell Date: Mon, 2 Nov 2026 13:29:12 +0100 Subject: [PATCH 1/2] Update pyproject for conda --- .github/workflows/publish.yml | 2 +- .gitignore | 269 ++++++++++++++++++++++++++++++++++ pyproject.toml | 25 ++-- 3 files changed, 285 insertions(+), 11 deletions(-) create mode 100644 .gitignore diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6cf17a0..7bb47dc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,7 +22,7 @@ jobs: url: https://pypi.org/project/sortbikenet/ steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - name: Build package run: | diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c8ad1df --- /dev/null +++ b/.gitignore @@ -0,0 +1,269 @@ +# Folders +data/ +results/ +cache/ +examples/*.gpkg +/*gpkg +docs/source/*.gpkg +docs/source/executed_notebooks/ +docs/jupyter_execute/ + +# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,python,macos,windows +# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,python,macos,windows + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# pixi environments +.pixi/* +!.pixi/config.toml +pixi* + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +### Python Patch ### +# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration +poetry.toml + +# ruff +.ruff_cache/ + +# LSP config files +pyrightconfig.json + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,python,macos,windows diff --git a/pyproject.toml b/pyproject.toml index 75b4fbb..35ff71a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,14 +6,16 @@ build-backend = "setuptools.build_meta" name = "sortbikenet" version = "0.6.0" authors = [ - { name = "Clement Sebastiao" }, + { name = "Clément Sebastiao" }, { name = "Manuel Knepper" }, - { name = "Michael Szell" }, + { name = "Michael Szell", email = "michael@szell.net" }, +] +maintainers = [ + { name = "Michael Szell", email = "michael@szell.net"}, ] -maintainers = [{ name = "Manuel Knepper", email = "manuel.knepper@gmx.net" }] license = "AGPL-3.0-or-later" readme = "README.md" -description = "BikeNetKit Python package to sort growth of bicycle networks" +description = "BikeNetKit Python package to prioritize developments in planned bicycle networks" keywords = ["Bicycle network planning", "Networks", "OpenStreetMap", "Urban Planning", "Urban Mobility"] classifiers = [ "Development Status :: 3 - Alpha", @@ -22,26 +24,29 @@ classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", "Natural Language :: English", + "Topic :: Scientific/Engineering :: GIS", ] -requires-python = ">=3.10" +requires-python = ">=3.12" dependencies = [ "geopandas>=0.14", "osmnx>=1.9.4", - "pip", - "numpy" ] [project.urls] +Homepage = "https://bikenetkit.org/sortbikenet" +Documentation = "https://docs.bikenetkit.org/SortBikeNet" Repository = "https://github.com/BikeNetKit/SortBikeNet" Issues = "https://github.com/BikeNetKit/SortBikeNet/issues" +Changelog = "https://docs.bikenetkit.org/SortBikeNet/changelog" [project.optional-dependencies] test = ["pytest"] -doc = ["sphinx", "momepy"] +doc = ["sphinx"] [tool.ruff.lint.extend-per-file-ignores] "__init__.py" = ["F401"] # "Imported but unused: happens with packages From 502e9aef6411fbe63dfa9656d080577c39cf4780 Mon Sep 17 00:00:00 2001 From: Michael Szell Date: Mon, 2 Nov 2026 13:33:04 +0100 Subject: [PATCH 2/2] Add estimated env files, pre commit hooks --- .pre-commit-config.yaml | 43 +++++++++++++++++++++++++++++++++++++++++ environment-dev.yml | 27 ++++++++++++++++++++++++++ environment.yml | 8 ++++++++ pyproject.toml | 1 + 4 files changed, 79 insertions(+) create mode 100644 .pre-commit-config.yaml create mode 100644 environment-dev.yml create mode 100644 environment.yml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..50e720e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,43 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: "v6.0.0" + hooks: + - id: check-added-large-files + args: [--maxkb=500] + - id: check-ast + - id: check-case-conflict + - id: check-json + - id: check-merge-conflict + args: [--assume-in-merge] + - id: check-toml + - id: check-xml + - id: debug-statements + - id: fix-byte-order-marker + - id: mixed-line-ending + - id: check-illegal-windows-names + + - repo: local # https://github.com/prettier/prettier/discussions/16227#discussioncomment-18456780 + hooks: + - id: prettier + name: prettier + entry: prettier + args: [--write, --ignore-unknown] + language: node + types_or: [markdown, yaml] + additional_dependencies: + - prettier@3.9.10 + - repo: https://github.com/astral-sh/ruff-pre-commit + # Ruff version. + rev: v0.17.0 + hooks: + # Run the linter. + - id: ruff-check + types_or: [python, pyi, jupyter] + args: [--fix] + # Run the formatter. + - id: ruff-format + types_or: [python, pyi, jupyter] + - repo: https://github.com/kynan/nbstripout + rev: 0.9.1 + hooks: + - id: nbstripout diff --git a/environment-dev.yml b/environment-dev.yml new file mode 100644 index 0000000..40d24e5 --- /dev/null +++ b/environment-dev.yml @@ -0,0 +1,27 @@ +name: sbnenvdev +channels: + - conda-forge +dependencies: + - python>=3.12 + - matplotlib + - osmnx>=1.9.4 + - geopandas>=0.14 + + # additional to the non-dev env + - ipykernel + - ipywidgets + - pytest + - pytest-mpl + - pytest-cov + - sphinx + - numpydoc + - myst-nb + - pre-commit + - jupyterlab + - pixi-kernel + - pip: + # not available via conda-forge: + - sphinx-copybutton + - sphinxext-opengraph + - furo + - sortbikenet # For docs, get latest version fast from pypi \ No newline at end of file diff --git a/environment.yml b/environment.yml new file mode 100644 index 0000000..ffa4e65 --- /dev/null +++ b/environment.yml @@ -0,0 +1,8 @@ +name: sbnenv +channels: + - conda-forge +dependencies: + - python>=3.12 + - matplotlib + - osmnx>=1.9.4 + - geopandas>=0.14 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 35ff71a..eac9c13 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,6 +34,7 @@ classifiers = [ requires-python = ">=3.12" dependencies = [ "geopandas>=0.14", + "matplotlib", "osmnx>=1.9.4", ]