Skip to content
Merged
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
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish to PyPI

on:
pull_request:
types:
- closed
branches:
- main

permissions:
contents: read
id-token: write

jobs:
publish:
name: Publish to PyPI
if: |
github.event.pull_request.merged && contains(github.event.pull_request.labels.*.name, 'autorelease: tagged')
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/bikenetlib/

steps:
- uses: actions/checkout@v4

- name: Build package
run: |
python -m pip install build
python -m build

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
19 changes: 19 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: release-please

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-file: release-please-config.json
6 changes: 6 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Changelog

## Version 0.5.0 (2026-05-22)

- ✨ Initial release ✨
- 🔧 Copy code from current packages GrowBikeNet and FixBikeNet
121 changes: 121 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = "BikeNetLib"
copyright = "2026, BikeNetLib developers"
author = "Szell, Knepper, Vybornova"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

import os # noqa
import sys # noqa

sys.path.insert(0, os.path.abspath(".."))
import bikenetlib # noqa

# version = bikenetlib.__version__
version = "0.5.0"
release = version

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.linkcode",
"sphinxcontrib.bibtex",
"sphinx.ext.mathjax",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"numpydoc",
"nbsphinx",
"matplotlib.sphinxext.plot_directive",
"IPython.sphinxext.ipython_console_highlighting",
"myst_parser",
"sphinx_copybutton",
"sphinx_gallery.load_style",
]

templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# path to bib file with references
bibtex_bibfiles = ["_static/references.bib"]
bibtex_reference_style = "author_year"

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_static_path = ["_static"]

### select html theme
# html_theme = 'alabaster'
html_theme = "pydata_sphinx_theme"

html_theme_options = {
"github_url": "https://github.com/BikeNetKit/BikeNetLib",
"twitter_url": "notwitter.com",
"pygment_light_style": "tango",
"logo": {
"image_light": "logo.png",
"image_dark": "logo.png",
},
}

# Generate the API documentation when building
autosummary_generate = True
autosummary_imported_members = True
numpydoc_show_class_members = True
class_members_toctree = True
numpydoc_show_inherited_class_members = True
numpydoc_class_members_toctree = False
numpydoc_use_plots = True
autodoc_typehints = "none"

# -- Extension configuration -------------------------------------------------
nbsphinx_prolog = r"""
{% set docname = env.doc2path(env.docname, base=None) %}

.. only:: html

.. role:: raw-html(raw)
:format: html

.. note::

| This page was generated from `{{ docname }}`__.
| Interactive online version: :raw-html:`<a href="https://mybinder.org/BikeNetLib/master?urlpath=lab/tree/docs/{{ docname }}"><img alt="Binder badge" src="https://mybinder.org/badge_logo.svg" style="vertical-align:text-bottom"></a>`

__ https://github.com/BikeNetKit/BikeNetLib/blob/master/docs/{{ docname }}
""" # noqa: E501


def linkcode_resolve(domain, info):
def find_source():
# try to find the file and line number, based on code from numpy:
# https://github.com/numpy/numpy/blob/master/doc/source/conf.py#L286
obj = sys.modules[info["module"]]
for part in info["fullname"].split("."):
obj = getattr(obj, part)
import inspect
import os

fn = inspect.getsourcefile(obj)
fn = os.path.relpath(fn, start=os.path.dirname(bikenetlib.__file__))
source, lineno = inspect.getsourcelines(obj)
return fn, lineno, lineno + len(source) - 1

if domain != "py" or not info["module"]:
return None
try:
filename = "BikeNetLib/%s#L%d-L%d" % find_source() # noqa: UP031
except Exception:
filename = info["module"].replace(".", "/") + ".py"
tag = "main" if "+" in release else ("v" + release)
return f"https://github.com/BikeNetKit/BikeNetLib/blob/{tag}/{filename}"
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ readme = "README.md"
description = "BikeNetKit Python core utility package"
keywords = ["Bicycle network planning", "Networks", "OpenStreetMap", "Urban Planning", "Urban Mobility"]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
Expand Down
Loading