From cca23e067c45b5fb79d82c3de285a3bf1be31166 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 15 Jun 2024 10:12:27 -0400 Subject: [PATCH 1/6] starting #543 --- .github/release.yml | 28 +++++++++++++++++++++++++++ .github/workflows/release_to_pypi.yml | 10 ++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .github/release.yml diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 00000000..981ca6bb --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,28 @@ +changelog: + exclude: + labels: + - ignore-for-release + authors: + - dependabot + categories: + - title: Bug Fixes + labels: + - bug + - title: Enhancements + labels: + - enhancement + - title: Refactor + labels: + - refactor + - title: Preprocessing + labels: + - preprocessing + - title: Documentation + labels: + - documentation + - title: Refactor + labels: + - refactor + - title: Other Changes + labels: + - "*" diff --git a/.github/workflows/release_to_pypi.yml b/.github/workflows/release_to_pypi.yml index 6ce37c9e..33bc2d87 100644 --- a/.github/workflows/release_to_pypi.yml +++ b/.github/workflows/release_to_pypi.yml @@ -41,6 +41,16 @@ jobs: draft: false prerelease: false + - name: Create Release Notes + uses: actions/github-script@v7 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + await github.request(`POST /repos/${{ github.repository }}/releases`, { + tag_name: "${{ github.ref }}", + generate_release_notes: true + }); + - name: Get Asset name run: | export PKG=$(ls dist/ | grep tar) From 9622a63c798b4c628bb0397fdcbc3315d664c9fd Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 15 Jun 2024 10:40:00 -0400 Subject: [PATCH 2/6] Update .github/release.yml Co-authored-by: Martin Fleischmann --- .github/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/release.yml b/.github/release.yml index 981ca6bb..bcae68d6 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -4,6 +4,7 @@ changelog: - ignore-for-release authors: - dependabot + - pre-commit-ci categories: - title: Bug Fixes labels: From f3314fcac78de6a7c98ba1dcfc686978272dff5c Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 15 Jun 2024 12:34:51 -0400 Subject: [PATCH 3/6] remove log, update docs, adjust labels --- .github/release.yml | 15 ++- CHANGELOG.md | 251 -------------------------------------------- docs/changelog.rst | 1 - docs/index.rst | 2 +- 4 files changed, 8 insertions(+), 261 deletions(-) delete mode 100644 CHANGELOG.md delete mode 100644 docs/changelog.rst diff --git a/.github/release.yml b/.github/release.yml index bcae68d6..5f209428 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -6,24 +6,23 @@ changelog: - dependabot - pre-commit-ci categories: + - title: API changes + labels: refactor, ... + - title: Enhancements + labels: + - enhancement - title: Bug Fixes labels: - bug - - title: Enhancements + - title: Deprecations labels: - - enhancement + - ... - title: Refactor labels: - refactor - - title: Preprocessing - labels: - - preprocessing - title: Documentation labels: - documentation - - title: Refactor - labels: - - refactor - title: Other Changes labels: - "*" diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index 67a1f34e..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,251 +0,0 @@ -Changelog -========= - -Version 0.7.0 (November 22, 2023) ---------------------------------- - -Momepy now requires at least Python 3.10, GeoPandas 0.12, NetworkX 2.7 and tqdm 4.63. - -Enhancements: - -- ENH: support single-part multipolygons in ``Squareness`` and ``CentroidCorners`` (#507) -- ENH: add ``FaceArtifacts`` function to detect non-morphological artifacts in street - networks (#510) - -Version 0.6.0 (May 1, 2023) ---------------------------- - -Momepy now requires shapely 2.0 or newer to run and no longer depends on PyGEOS. The -highlights of the release: - -Enhancements: - -- ENH: support bi-directional roads in ``gdf_to_nx`` (#357) -- ENH: geometry-based simplification of roundabouts (#371, #392) -- REF: update for shapely 2.0 (#479) - -Bug fixes: - -- resolves bug in ``Percentiles`` append. (#427) - -Version 0.5.4 (September 20, 2022) ----------------------------------- - -Minor patch bringing some bug fixes and ensuring the full compatibility with the recent -versions of dependencies. - -Fixes: - -- BUG: return itself when no change possible in remove_false_nodes (#365) -- BUG: make COINS independent of the GeoDataFrame index (#378) -- Added warning for gdp_to_nx if geometries are not LineStrings (#379) -- REF: remove deprecated pandas append (#382, #384) -- MAINT: address numpy.nanpercintle warning (#387) -- MAINT: handle scenarios leading to dimensions.StreetProfile() warnings (#389) -- handle All NaN slice warning (#395) -- Fix various warnings (#398) -- BUG: get_network_ratio non-interescting joins fix (#409) - -Version 0.5.3 (April 9, 2022) ------------------------------ - -Minor patch release primarily fixing an issue with momepy.Blocks and a creation of angular graphs. - -Fixes: - -- BUG: Fix angle computation in graph creation with dual approach (#347) -- BUG: fix issue with blocks within another blocks (#351) - -Version 0.5.2 (January 6, 2022) -------------------------------- - -Since version 0.5.2, momepy is licensed under the BSD-3-Clause License instead -of the MIT License, to be in line with the rest of the PySAL ecosystem. - -Fixes: - -- BUG: non-default index dropped in Blocks id series (#315) -- BUG: fix FormFactor formula (#330) - -Version 0.5.1 (October 20, 2021) --------------------------------- - -Small patch adjusting momepy to changes geopandas 0.10. - -Fixes: - -- BUG: non-default index dropped in Blocks id series -- REF/TST: minimise warnings from geopandas 0.10 - -Version 0.5.0 (September 12, 2021) ----------------------------------- - -Enhancements: - -- COINS algorithm for analysis of continuity of street networks (#248, #276) -- ENH: distance decay in Percentiles (#269) -- ENH: add dropna keyword to Unique (#280) -- ENH: catch geographic CRS in Tessellation (#298) -- ENH: support shapely polygon as enclosures limit (#299) - -Bug fixes: - -- BUG/DOC: adapt to mutliindex + remove preprocess (#281) -- BUG: Tessellation error on non-standard enclosures (#291) -- BUG: properly clip enclosures by limit (#288) - -Other: - -- DEP: remove deprecated functions and args (#268) -- PERF: use dask.bag in Tessellation (#296) - -Version 0.4.4 (April 30, 2021) ---------------------------------- - -Small bug fix affecting `nx_to_gdf` and `NodeDensity`. - -- BUG: node ID doesn't match ID in weights (#274) - -Version 0.4.3 (February 16, 2021) ---------------------------------- - -Small bug fix: - -- BUG: UnboundLocalError: local variable 'cpu_count' referenced before assignment (#266) - -Version 0.4.2 (February 4, 2021) --------------------------------- - -Bug fix release: - -- BUG: resolve nans in StreetProfile (#251) -- REGR: fix slowdown in tessellation (#256) -- BUG: avoid string "geometry" (#257) -- PERF: move translation in Tessellation (#259) -- REGR: use convex_hull to mitigate infinity (#260) - -Version 0.4.1 (January 12, 2021) --------------------------------- - -- fixed bug in the automatic selection of number of dask chunks in enclosed tessellation -- fixed infinity issue in ``StreetProfile`` (#249) -- fixed issue changing the original dataframe in ``DistanceBand`` (#250) - -Version 0.4.0 (December 26, 2020) ---------------------------------- - -Requirements: - -- momepy now requires GeoPandas 0.8 or newer -- momepy now requires pygeos -- momepy now (optionally) requires mapclassify 2.4.2 or newer - -API changes: - -- ``network_false_nodes`` is now deprecated. Use new ``remove_false_nodes`` instead. - -Enhancements: - -- New performant algorithm ``remove_false_nodes`` to remove nodes of a degree 2 of a LineString network. (#204) -- Faster ``CircularCompactness`` (#205) -- pygeos-based ``Tessellation`` (#207) -- New class ``Percentiles`` (#209) -- Various speedups (#209) -- New ``enclosures`` function (#211) -- Enclosed tessellation option in ``Tessellation`` (#212) -- Preprocessing module (#214) -- Preprocessing function to ``close_gaps`` of LineString geoemtry (#215) -- Preprocessing function to ``extend_lines`` (#217) -- ratio-based network links (#218) -- vectorize ``StreetProfile`` (#219) -- capture MutliLineString in ``Linearity`` (#236) -- support MultiPolygons (#234) -- handle NaNs in ``limit_range`` (#235) -- ``SharedWalls`` length (#238) -- refactor ``Blocks`` using overlay and libpysal (#237) -- more options in converting to networkx graphs in ``gdf_to_nx`` (#240) -- use mapclassify.classify in ``Simpson`` and ``Shannon`` (#241) - -Bug fixes: - -- fix nearest neighbor in ``get_network_ratio`` (#224) -- ``Tessellation`` error when geom collapsed (#226) -- ``Blocks`` empty difference (#230) - -Version 0.3.0 (July 29, 2020) ------------------------------ - -API changes: - -- ``Convexeity`` is now ``Convexity`` (#171) -- ``local_`` centrality (betweenness, closeness, straightness) has been included in respective global versions (#178) - -New features: - -- ``CheckTessellationInput`` to check building footprint data for potential issues during ``Tessellation`` (#163) -- On demand ``DistanceBand`` spatial weights (neighbors) for larger weight which would not fit in memory (#165) - -Enhancements: - -- New documentation (#167) -- Support network analysis for full network (#176) -- Options for ``preprocess`` (#180) -- Expose underlying ``simpson`` and ``shannon`` functions (#183) -- ``MeanInterbuildingDistance`` performance (#187) -- ``StreetProfile`` performance refactor (#186) -- Retain attributes in ``network_false_nodes`` (#189) -- Performance improvements in ``elements`` module (#190) -- Performance refactor of ``SharedWallsRatio`` (#191) -- Performance refactor of ``NeighboringStreetOrientationDeviation`` (#192) -- Minor performance improvements (#193, #196) -- Allow specification of verbosity (#195) -- Perfomance enhancements in ``sw_high`` (#198) - -Bug fixes: - -- ``Density`` TypeError for islands (#164) -- Preserve CRS in ``network_false_nodes`` (#181) -- Fixed ``Squareness`` for non-Polygon geom types (#182) -- CRS lost with older geopandas (#188) - -Version 0.2.1 (April 15, 2020) ------------------------------- - -- fixed regression causing ``MeanInterbuildingDistance`` failure (#161) - -Version 0.2.0 (April 13, 2020) ------------------------------- - -API changes: - -- ``AverageCharacter`` allows calculation of multiple modes (mean, median, mode) at the same time. Each can be accessed via its own attribute. Apart from ``mean``, none is accessible using ``.series`` anymore. (#147) - -Enhancements: - -- ``Shannon`` index (#158) -- ``Simpson`` allows Gini-Simpson and Inverse Simpson index modes (#157) -- Diversity classes support categorical values (#159) -- ``SegmentsLength`` allows sum and mean at the same time (#146) -- ``AverageCharacter`` allows calculation of multiple modes (mean, median, mode) at the same time (#147) -- Better compatibility with OSMnx Graphs (#149) -- ``Orientation`` support LineString geometry (#156) -- ``AreaRatio`` for uneven number of features (#135) -- Performance improvements (#144, #145, #152, #155) - -Bug fixes: - -- float precision errors in ``network_false_nodes`` (#133) -- ``network_false_nodes`` for multiindex (#136) -- ``BlocksCount`` no neighbors error (#139, #140) -- LineString Z support in ``nx_to_gdf`` (#148) -- accidental 'rtd' print (#150) -- ``CentroidCorner`` may fail for Polygon Z (#151) - -Version 0.1.1 (December 15, 2019) ---------------------------------- - -Small bug-fix release: - -- fix for ``AreaRatio`` resetting index of resulting Series (#127) -- fix for ``network_false_nodes`` to work with GeoSeries (#128) -- fix for incomplete spatial_weights and missing neighbors. Instead of raising KeyError momepy now returns np.nan for affected row. np.nan is also returned if there are no neighbors (instead of 0). (#131) diff --git a/docs/changelog.rst b/docs/changelog.rst deleted file mode 100644 index 669aaa23..00000000 --- a/docs/changelog.rst +++ /dev/null @@ -1 +0,0 @@ -.. include:: ../CHANGELOG.md diff --git a/docs/index.rst b/docs/index.rst index 6d1e79c3..700456ff 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -153,7 +153,7 @@ Documentation contents examples/index API reference Contributing - changelog + Changelog references From 0c17f5dbec420495ecc728977c4d675600ad7134 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 15 Jun 2024 12:37:07 -0400 Subject: [PATCH 4/6] adjust labels again --- .github/release.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/release.yml b/.github/release.yml index 5f209428..5e0af71c 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -17,9 +17,6 @@ changelog: - title: Deprecations labels: - ... - - title: Refactor - labels: - - refactor - title: Documentation labels: - documentation From f6489da4f9146e1c5191400a1262304b05379266 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 15 Jun 2024 15:28:59 -0400 Subject: [PATCH 5/6] add api and depr labels --- .github/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/release.yml b/.github/release.yml index 5e0af71c..9a3b4cb5 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -6,8 +6,8 @@ changelog: - dependabot - pre-commit-ci categories: - - title: API changes - labels: refactor, ... + - title: API Changes + labels: api - title: Enhancements labels: - enhancement @@ -16,7 +16,7 @@ changelog: - bug - title: Deprecations labels: - - ... + - deprecation - title: Documentation labels: - documentation From 8c91d28d55a1421f3ecf685fe2aecc573ee8bc6c Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 15 Jun 2024 16:23:46 -0400 Subject: [PATCH 6/6] streamlined release workflow --- .github/workflows/release_to_pypi.yml | 41 ++++++--------------------- 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/.github/workflows/release_to_pypi.yml b/.github/workflows/release_to_pypi.yml index 33bc2d87..f503491d 100644 --- a/.github/workflows/release_to_pypi.yml +++ b/.github/workflows/release_to_pypi.yml @@ -12,6 +12,8 @@ jobs: steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch all history for all branches and tags. - name: Set up Python uses: actions/setup-python@v5 @@ -20,27 +22,11 @@ jobs: - name: Build source and wheel distributions run: | + python -m pip install --upgrade pip python -m pip install --upgrade build twine python -m build twine check --strict dist/* - - name: Publish distribution to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.pypi_password }} - - - name: Create GitHub Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token - with: - tag_name: ${{ github.ref }} - release_name: Version ${{ github.ref }} - draft: false - prerelease: false - - name: Create Release Notes uses: actions/github-script@v7 with: @@ -51,19 +37,10 @@ jobs: generate_release_notes: true }); - - name: Get Asset name - run: | - export PKG=$(ls dist/ | grep tar) - set -- $PKG - echo "name=$1" >> $GITHUB_ENV - - - name: Upload Release Asset (sdist) to GitHub - id: upload-release-asset - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Publish distribution to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: dist/${{ env.name }} - asset_name: ${{ env.name }} - asset_content_type: application/zip + user: __token__ + password: ${{ secrets.pypi_password }} + +