diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..6cf17a0 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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/sortbikenet/ + + 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 \ No newline at end of file diff --git a/plot.py b/plot.py index 01e10b3..03fb290 100644 --- a/plot.py +++ b/plot.py @@ -8,7 +8,7 @@ import networkx as nx import shapely -from .utils import get_node_positions +from sortbikenet.utils import get_node_positions def plot_growth( diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..bc5505b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,58 @@ +[build-system] +requires = ["setuptools >= 77.0.3"] +build-backend = "setuptools.build_meta" + +[project] +name = "sortbikenet" +version = "0.5.0" +authors = [ + { name = "Clement Sebastiao" }, + { name = "Manuel Knepper" }, + { name = "Michael Szell" }, +] +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" +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", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Natural Language :: English", +] +requires-python = ">=3.10" +dependencies = [ + "geopandas>=0.14", + "osmnx>=1.9.4", + "pip", + "numpy" +] + +[project.urls] +Repository = "https://github.com/BikeNetKit/SortBikeNet" +Issues = "https://github.com/BikeNetKit/SortBikeNet/issues" + +[project.optional-dependencies] +test = ["pytest"] +doc = ["sphinx", "momepy"] + +[tool.ruff.lint.extend-per-file-ignores] +"__init__.py" = ["F401"] # "Imported but unused: happens with packages + +[tool.setuptools.packages.find] +exclude = [ + "examples*", + "tests*", + "results", + "docs*", + "data*", + "scripts*", +] +namespaces = false \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..42af45c --- /dev/null +++ b/readme.md @@ -0,0 +1,20 @@ +[![PyPI Version](https://img.shields.io/pypi/v/sortbikenet?color=10d249)](https://pypi.org/project/SortBikeNet/) + +The Python package `sortbikenet` is in the planning phase and not yet being developed. + +## Installation + +``` +pip install sortbikenet +``` + +## Usage +In development. + +## Docs +In development. + +## Supported by +Development of BikeNetKit/SortBikeNet is supported by the [Innovation Fund Denmark](https://innovationsfonden.dk/en) and the EU HORIZON project [JUST STREETS](https://www.just-streets.eu). + +[![Innovation Fund Denmark](https://raw.githubusercontent.com/BikeNetKit/.github/refs/heads/main/profile/_static/logo_innovationfund.png)](https://innovationsfonden.dk/en)    [![European Union](https://raw.githubusercontent.com/BikeNetKit/.github/refs/heads/main/profile/_static/logo_eu.png)](https://commission.europa.eu/index_en)   [![JUST STREETS](https://raw.githubusercontent.com/BikeNetKit/.github/refs/heads/main/profile/_static/logo_juststreets.png)](https://www.just-streets.eu/) \ No newline at end of file diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..6966fd2 --- /dev/null +++ b/setup.py @@ -0,0 +1,5 @@ +from setuptools import find_packages, setup +setup( + name="sortbikenet", + packages=find_packages(), +) \ No newline at end of file diff --git a/sortbikenet/__init__.py b/sortbikenet/__init__.py new file mode 100644 index 0000000..d47812b --- /dev/null +++ b/sortbikenet/__init__.py @@ -0,0 +1,12 @@ +import contextlib +from importlib.metadata import PackageNotFoundError, version + +#from . import config +#from . import functions +from sortbikenet.sortbikenet import sortbikenet + +__author__ = "MS, MK" +__author_email__ = "email@domain.com" + +with contextlib.suppress(PackageNotFoundError): + __version__ = version("sortbikenet") \ No newline at end of file diff --git a/sortbikenet/_version.py b/sortbikenet/_version.py new file mode 100644 index 0000000..5a8c25f --- /dev/null +++ b/sortbikenet/_version.py @@ -0,0 +1,3 @@ +"""sortbikenet package version.""" + +__version__ = "0.5.0" # x-release-please-version \ No newline at end of file diff --git a/growth.py b/sortbikenet/growth.py similarity index 99% rename from growth.py rename to sortbikenet/growth.py index 20c0a7a..0717cfd 100644 --- a/growth.py +++ b/sortbikenet/growth.py @@ -7,7 +7,7 @@ import networkx as nx import momepy as mp import shapely -from .metrics import directness +from metrics import directness class Orderbike: diff --git a/metrics.py b/sortbikenet/metrics.py similarity index 98% rename from metrics.py rename to sortbikenet/metrics.py index 044b1d3..cacf287 100644 --- a/metrics.py +++ b/sortbikenet/metrics.py @@ -8,7 +8,7 @@ import igraph as ig import scipy from haversine import haversine -from .utils import get_node_positions +from utils import get_node_positions def coverage(G, buff_size): diff --git a/sortbikenet/sortbikenet.py b/sortbikenet/sortbikenet.py new file mode 100644 index 0000000..225e9a8 --- /dev/null +++ b/sortbikenet/sortbikenet.py @@ -0,0 +1,3 @@ +def sortbikenet(): + 'Placeholder for sortbikenet function' + print("sortbikenet") \ No newline at end of file diff --git a/utils.py b/sortbikenet/utils.py similarity index 100% rename from utils.py rename to sortbikenet/utils.py