From 5e2ec92f65ed0b80e08e11ceae40af2cca774f6a Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 12 Jul 2025 16:33:15 -0400 Subject: [PATCH 1/7] fix doctests in markov.py --- giddy/markov.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/giddy/markov.py b/giddy/markov.py index 858e550..2fede5a 100644 --- a/giddy/markov.py +++ b/giddy/markov.py @@ -2024,7 +2024,7 @@ class FullRank_Markov(Markov): ..., [ 0., 0., 0., ..., 40., 17., 0.], [ 0., 0., 0., ..., 15., 54., 2.], - [ 0., 0., 0., ..., 2., 1., 77.]]) + [ 0., 0., 0., ..., 2., 1., 77.]], shape=(48, 48)) >>> m.p[0, :5] array([0.825 , 0.0625, 0.0625, 0.025 , 0.025 ]) >>> m.mfpt[0, :5] @@ -2170,7 +2170,7 @@ class GeoRank_Markov(Markov): ..., [ 2., 0., 5., ..., 34., 0., 0.], [ 0., 0., 0., ..., 0., 18., 2.], - [ 0., 0., 0., ..., 0., 3., 14.]]) + [ 0., 0., 0., ..., 0., 3., 14.]], shape=(48, 48)) >>> m.p array([[0.475 , 0. , 0.1 , ..., 0. , 0. , 0. ], [0. , 0.1875, 0. , ..., 0. , 0.0125, 0. ], @@ -2178,7 +2178,8 @@ class GeoRank_Markov(Markov): ..., [0.025 , 0. , 0.0625, ..., 0.425 , 0. , 0. ], [0. , 0. , 0. , ..., 0. , 0.225 , 0.025 ], - [0. , 0. , 0. , ..., 0. , 0.0375, 0.175 ]]) + [0. , 0. , 0. , ..., 0. , 0.0375, 0.175 ]], + shape=(48, 48)) >>> m.mfpt array([[ 48. , 63.35532038, 92.75274652, ..., 82.47515731, 71.01114491, 68.65737127], @@ -2192,7 +2193,7 @@ class GeoRank_Markov(Markov): [113.65278078, 61.1987031 , 133.57991745, ..., 96.0103924 , 48. , 56.74165107], [114.71894813, 63.4019776 , 134.73381719, ..., 97.287895 , - 61.45565054, 48. ]]) + 61.45565054, 48. ]], shape=(48, 48)) >>> m.sojourn_time array([ 1.9047619 , 1.23076923, 2.22222222, 1.73913043, 1.15942029, 3.80952381, 1.70212766, 1.25 , 1.31147541, 1.11111111, From 0382c9fd146ea2e9ed3124366bc9124f62f4132d Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 12 Jul 2025 16:45:09 -0400 Subject: [PATCH 2/7] fix plotting doctests (skips) --- giddy/plotting.py | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/giddy/plotting.py b/giddy/plotting.py index e06bfc5..945283a 100644 --- a/giddy/plotting.py +++ b/giddy/plotting.py @@ -140,13 +140,13 @@ def dynamic_lisa_heatmap(rose, p=0.05, ax=None, **kwargs): plot - >>> dynamic_lisa_heatmap(rose) - >>> plt.show() + >>> dynamic_lisa_heatmap(rose) #doctest: +SKIP + >>> plt.show() #doctest: +SKIP customize plot - >>> dynamic_lisa_heatmap(rose, cbar='GnBu') - >>> plt.show() + >>> dynamic_lisa_heatmap(rose, cbar='GnBu') #doctest: +SKIP + >>> plt.show() #doctest: +SKIP """ moran_locy, moran_locx = _moran_loc_from_rose_calc(rose) @@ -257,13 +257,13 @@ def dynamic_lisa_rose(rose, attribute=None, ax=None, **kwargs): plot - >>> dynamic_lisa_rose(rose, attribute=y1) - >>> plt.show() + >>> dynamic_lisa_rose(rose, attribute=y1) #doctest: +SKIP + >>> plt.show() #doctest: +SKIP customize plot - >>> dynamic_lisa_rose(rose, c='r') - >>> plt.show() + >>> dynamic_lisa_rose(rose, c='r') #doctest: +SKIP + >>> plt.show() #doctest: +SKIP """ # save_old default values @@ -409,13 +409,13 @@ def dynamic_lisa_vectors(rose, ax=None, arrows=True, **kwargs): plot - >>> dynamic_lisa_vectors(rose) - >>> plt.show() + >>> dynamic_lisa_vectors(rose) #doctest: +SKIP + >>> plt.show() #doctest: +SKIP customize plot - >>> dynamic_lisa_vectors(rose, arrows=False, color='r') - >>> plt.show() + >>> dynamic_lisa_vectors(rose, arrows=False, color='r') #doctest: +SKIP + >>> plt.show() #doctest: +SKIP """ if ax is None: @@ -526,17 +526,17 @@ def dynamic_lisa_composite(rose, gdf, p=0.05, figsize=(13, 10)): plot - >>> dynamic_lisa_composite(rose, gdf) - >>> plt.show() + >>> dynamic_lisa_composite(rose, gdf) #doctest: +SKIP + >>> plt.show() #doctest: +SKIP customize plot - >>> fig, axs = dynamic_lisa_composite(rose, gdf) - >>> axs[0].set_ylabel('1996') - >>> axs[0].set_xlabel('2009') - >>> axs[1].set_title('LISA cluster for 1996') - >>> axs[3].set_title('LISA clsuter for 2009') - >>> plt.show() + >>> fig, axs = dynamic_lisa_composite(rose, gdf) #doctest: +SKIP + >>> axs[0].set_ylabel('1996') #doctest: +SKIP + >>> axs[0].set_xlabel('2009') #doctest: +SKIP + >>> axs[1].set_title('LISA cluster for 1996') #doctest: +SKIP + >>> axs[3].set_title('LISA clsuter for 2009') #doctest: +SKIP + >>> plt.show() #doctest: +SKIP """ # Moran_Local uses random numbers, @@ -705,8 +705,8 @@ def dynamic_lisa_composite_explore(rose, gdf, pattern="", p=0.05, figsize=(13, 1 plot - >>> fig = dynamic_lisa_composite_explore(rose, gdf, pattern='rel') - >>> # plt.show() + >>> fig = dynamic_lisa_composite_explore(rose, gdf, pattern='rel') #doctest: +SKIP + >>> plt.show() #doctest: +SKIP """ try: From f2594ceed6e0479a58817f6c8db005bfc031bc58 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 12 Jul 2025 16:52:06 -0400 Subject: [PATCH 3/7] standard CI env naming --- .github/workflows/build_docs.yml | 4 ++-- .github/workflows/tests.yml | 18 +++++++++--------- ...311-latest.yaml => py311-giddy-latest.yaml} | 2 +- ...311-oldest.yaml => py311-giddy-oldest.yaml} | 2 +- ...312-latest.yaml => py312-giddy-latest.yaml} | 2 +- ci/{313-dev.yaml => py313-giddy-dev.yaml} | 2 +- ...313-latest.yaml => py313-giddy-latest.yaml} | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) rename ci/{311-latest.yaml => py311-giddy-latest.yaml} (90%) rename ci/{311-oldest.yaml => py311-giddy-oldest.yaml} (91%) rename ci/{312-latest.yaml => py312-giddy-latest.yaml} (90%) rename ci/{313-dev.yaml => py313-giddy-dev.yaml} (97%) rename ci/{313-latest.yaml => py313-giddy-latest.yaml} (90%) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 9ca5356..5b6fa4b 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -19,7 +19,7 @@ strategy: matrix: os: ['ubuntu-latest'] - environment-file: [ci/312-latest.yaml] + environment-file: [ci/py313_giddy-latest.yaml] experimental: [false] defaults: run: @@ -30,7 +30,7 @@ uses: actions/checkout@v4 - name: setup micromamba - uses: mamba-org/setup-micromamba@v1 + uses: mamba-org/setup-micromamba@v2 with: environment-file: ${{ matrix.environment-file }} micromamba-version: 'latest' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9439729..d3275d6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,17 +28,17 @@ jobs: matrix: os: [ubuntu-latest] environment-file: - - ci/311-oldest.yaml - - ci/311-latest.yaml - - ci/312-latest.yaml - - ci/313-latest.yaml - - ci/313-dev.yaml + - ci/py311_giddy-oldest.yaml + - ci/py311_giddy-latest.yaml + - ci/py312_giddy-latest.yaml + - ci/py313_giddy-latest.yaml + - ci/py313_giddy-dev.yaml include: - - environment-file: ci/313-latest.yaml + - environment-file: ci/py313_giddy-latest.yaml os: macos-13 # Intel - - environment-file: ci/313-latest.yaml + - environment-file: ci/py313_giddy-latest.yaml os: macos-14 # Apple Silicon - - environment-file: ci/313-latest.yaml + - environment-file: ci/py313_giddy-latest.yaml os: windows-latest fail-fast: false @@ -77,7 +77,7 @@ jobs: --cov-report term-missing - name: run docstring tests - if: contains(matrix.environment-file, '313-dev') && contains(matrix.os, 'ubuntu') + if: contains(matrix.environment-file, 'dev') && contains(matrix.os, 'ubuntu') run: | pytest \ giddy \ diff --git a/ci/311-latest.yaml b/ci/py311-giddy-latest.yaml similarity index 90% rename from ci/311-latest.yaml rename to ci/py311-giddy-latest.yaml index 4f00ee5..78227e3 100644 --- a/ci/311-latest.yaml +++ b/ci/py311-giddy-latest.yaml @@ -1,4 +1,4 @@ -name: test +name: py311-giddy-latest channels: - conda-forge dependencies: diff --git a/ci/311-oldest.yaml b/ci/py311-giddy-oldest.yaml similarity index 91% rename from ci/311-oldest.yaml rename to ci/py311-giddy-oldest.yaml index 665a845..f56cba7 100644 --- a/ci/311-oldest.yaml +++ b/ci/py311-giddy-oldest.yaml @@ -1,4 +1,4 @@ -name: test +name: py311-giddy-oldest channels: - conda-forge dependencies: diff --git a/ci/312-latest.yaml b/ci/py312-giddy-latest.yaml similarity index 90% rename from ci/312-latest.yaml rename to ci/py312-giddy-latest.yaml index 34ded22..f3c5652 100644 --- a/ci/312-latest.yaml +++ b/ci/py312-giddy-latest.yaml @@ -1,4 +1,4 @@ -name: test +name: py312-giddy-latest channels: - conda-forge dependencies: diff --git a/ci/313-dev.yaml b/ci/py313-giddy-dev.yaml similarity index 97% rename from ci/313-dev.yaml rename to ci/py313-giddy-dev.yaml index ab24d8c..5ac2b84 100644 --- a/ci/313-dev.yaml +++ b/ci/py313-giddy-dev.yaml @@ -1,4 +1,4 @@ -name: test +name: py313-giddy-dev channels: - conda-forge dependencies: diff --git a/ci/313-latest.yaml b/ci/py313-giddy-latest.yaml similarity index 90% rename from ci/313-latest.yaml rename to ci/py313-giddy-latest.yaml index 8c5bbd6..5f2c2d9 100644 --- a/ci/313-latest.yaml +++ b/ci/py313-giddy-latest.yaml @@ -1,4 +1,4 @@ -name: test +name: py313-giddy-latest channels: - conda-forge dependencies: From 1329ba4d0a27b061161547fe09cb395384917515 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 12 Jul 2025 16:58:27 -0400 Subject: [PATCH 4/7] fix naming typo & resolve #233 --- .github/workflows/build_docs.yml | 2 ++ .github/workflows/release_and_publish.yml | 6 +++++- .github/workflows/tests.yml | 2 ++ ci/{py311-giddy-latest.yaml => py311_giddy-latest.yaml} | 0 ci/{py311-giddy-oldest.yaml => py311_giddy-oldest.yaml} | 0 ci/{py312-giddy-latest.yaml => py312_giddy-latest.yaml} | 0 ci/{py313-giddy-dev.yaml => py313_giddy-dev.yaml} | 0 ci/{py313-giddy-latest.yaml => py313_giddy-latest.yaml} | 0 8 files changed, 9 insertions(+), 1 deletion(-) rename ci/{py311-giddy-latest.yaml => py311_giddy-latest.yaml} (100%) rename ci/{py311-giddy-oldest.yaml => py311_giddy-oldest.yaml} (100%) rename ci/{py312-giddy-latest.yaml => py312_giddy-latest.yaml} (100%) rename ci/{py313-giddy-dev.yaml => py313_giddy-dev.yaml} (100%) rename ci/{py313-giddy-latest.yaml => py313_giddy-latest.yaml} (100%) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 5b6fa4b..d05657d 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -28,6 +28,8 @@ steps: - name: checkout repo uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: setup micromamba uses: mamba-org/setup-micromamba@v2 diff --git a/.github/workflows/release_and_publish.yml b/.github/workflows/release_and_publish.yml index c2f4e2e..3e5bb55 100644 --- a/.github/workflows/release_and_publish.yml +++ b/.github/workflows/release_and_publish.yml @@ -16,7 +16,11 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: checkout repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Python uses: actions/setup-python@v4 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d3275d6..db61b8d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -45,6 +45,8 @@ jobs: steps: - name: checkout repo uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: setup micromamba uses: mamba-org/setup-micromamba@v2 diff --git a/ci/py311-giddy-latest.yaml b/ci/py311_giddy-latest.yaml similarity index 100% rename from ci/py311-giddy-latest.yaml rename to ci/py311_giddy-latest.yaml diff --git a/ci/py311-giddy-oldest.yaml b/ci/py311_giddy-oldest.yaml similarity index 100% rename from ci/py311-giddy-oldest.yaml rename to ci/py311_giddy-oldest.yaml diff --git a/ci/py312-giddy-latest.yaml b/ci/py312_giddy-latest.yaml similarity index 100% rename from ci/py312-giddy-latest.yaml rename to ci/py312_giddy-latest.yaml diff --git a/ci/py313-giddy-dev.yaml b/ci/py313_giddy-dev.yaml similarity index 100% rename from ci/py313-giddy-dev.yaml rename to ci/py313_giddy-dev.yaml diff --git a/ci/py313-giddy-latest.yaml b/ci/py313_giddy-latest.yaml similarity index 100% rename from ci/py313-giddy-latest.yaml rename to ci/py313_giddy-latest.yaml From 9ec365b74d4c7f6b05c0b395721a19cad3e0aa26 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 12 Jul 2025 19:36:19 -0400 Subject: [PATCH 5/7] lint YAML action files --- .github/workflows/build_docs.yml | 128 +++++++++++----------- .github/workflows/release_and_publish.yml | 64 +++++------ .github/workflows/tests.yml | 27 ++--- 3 files changed, 101 insertions(+), 118 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index d05657d..c82b9e2 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -1,67 +1,63 @@ - name: Build Docs - - on: - push: - # Sequence of patterns matched against refs/tags - tags: - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 - workflow_dispatch: - inputs: - version: - description: Manual Doc Build - default: test - required: false - jobs: - docs: - name: build & push docs - runs-on: ${{ matrix.os }} - timeout-minutes: 90 - strategy: - matrix: - os: ['ubuntu-latest'] - environment-file: [ci/py313_giddy-latest.yaml] - experimental: [false] - defaults: - run: - shell: bash -l {0} - - steps: - - name: checkout repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: setup micromamba - uses: mamba-org/setup-micromamba@v2 - with: - environment-file: ${{ matrix.environment-file }} - micromamba-version: 'latest' - - - name: reinstall for version - run: | - pip install -e . --no-deps --force-reinstall +--- +name: Build Docs +on: + push: + tags: + - v* + workflow_dispatch: + inputs: + version: + description: Manual Doc Build + default: test + required: false +jobs: + docs: + name: build & push docs + runs-on: ${{ matrix.os }} + timeout-minutes: 90 + strategy: + matrix: + os: + - ubuntu-latest + environment-file: + - ci/py313_giddy-latest.yaml + experimental: + - false + defaults: + run: + shell: bash -l {0} + steps: + - name: checkout repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: setup micromamba + uses: mamba-org/setup-micromamba@v2 + with: + environment-file: ${{ matrix.environment-file }} + micromamba-version: latest + - name: reinstall for version + run: | + pip install -e . --no-deps --force-reinstall + - name: make docs + run: | + cd docs + make html + - name: commit docs + run: > + git clone https://github.com/ammaraskar/sphinx-action-test.git --branch + gh-pages --single-branch gh-pages + cp -r docs/_build/html/* gh-pages/ + cd gh-pages + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git commit -m "Update documentation" -a || true + - name: push to gh-pages + uses: ad-m/github-push-action@master + with: + branch: gh-pages + directory: gh-pages + github_token: ${{ secrets.GITHUB_TOKEN }} + force: true - - name: make docs - run: | - cd docs - make html - - - name: commit docs - run: | - git clone https://github.com/ammaraskar/sphinx-action-test.git --branch gh-pages --single-branch gh-pages - cp -r docs/_build/html/* gh-pages/ - cd gh-pages - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add . - git commit -m "Update documentation" -a || true - # The above command will fail if no changes were present, - # so we ignore the return code. - - - name: push to gh-pages - uses: ad-m/github-push-action@master - with: - branch: gh-pages - directory: gh-pages - github_token: ${{ secrets.GITHUB_TOKEN }} - force: true diff --git a/.github/workflows/release_and_publish.yml b/.github/workflows/release_and_publish.yml index 3e5bb55..773fa15 100644 --- a/.github/workflows/release_and_publish.yml +++ b/.github/workflows/release_and_publish.yml @@ -1,49 +1,43 @@ +--- name: Release Package - on: push: - # Sequence of patterns matched against refs/tags tags: - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + - v* workflow_dispatch: inputs: version: description: Manual Release default: test required: false - jobs: build: runs-on: ubuntu-latest steps: - - name: checkout repo - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - - name: Build source and wheel distributions - run: | - python -m pip install --upgrade build twine - python -m build - twine check --strict dist/* - - - name: Create Release Notes - uses: actions/github-script@v6 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - await github.request(`POST /repos/${{ github.repository }}/releases`, { - tag_name: "${{ github.ref }}", - generate_release_notes: true - }); - - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_PASSWORD }} + - name: checkout repo + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.x + - name: Build source and wheel distributions + run: | + python -m pip install --upgrade build twine + python -m build + twine check --strict dist/* + - name: Create Release Notes + uses: actions/github-script@v6 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: > + await github.request(`POST /repos/${{ github.repository }}/releases`, { + tag_name: "${{ github.ref }}", + generate_release_notes: true + }); + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_PASSWORD }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index db61b8d..68b4389 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,21 +1,20 @@ +--- name: Continuous Integration - on: push: branches: - - '*' + - "*" pull_request: branches: - - '*' + - "*" schedule: - - cron: '59 23 * * *' + - cron: 59 23 * * * workflow_dispatch: inputs: version: description: Manual Unittest Run default: test required: false - jobs: unittests: name: ${{ matrix.os }}, ${{ matrix.environment-file }} @@ -26,7 +25,8 @@ jobs: timeout-minutes: 60 strategy: matrix: - os: [ubuntu-latest] + os: + - ubuntu-latest environment-file: - ci/py311_giddy-oldest.yaml - ci/py311_giddy-latest.yaml @@ -35,36 +35,31 @@ jobs: - ci/py313_giddy-dev.yaml include: - environment-file: ci/py313_giddy-latest.yaml - os: macos-13 # Intel + os: macos-13 - environment-file: ci/py313_giddy-latest.yaml - os: macos-14 # Apple Silicon + os: macos-14 - environment-file: ci/py313_giddy-latest.yaml os: windows-latest fail-fast: false - steps: - name: checkout repo uses: actions/checkout@v4 with: fetch-depth: 0 - - name: setup micromamba uses: mamba-org/setup-micromamba@v2 with: environment-file: ${{ matrix.environment-file }} - micromamba-version: 'latest' - + micromamba-version: latest - name: environment info shell: bash -l {0} run: | micromamba info micromamba list - - name: spatial versions (if geopandas is installed) shell: bash -l {0} - run: 'python -c "import geopandas; geopandas.show_versions();"' + run: python -c "import geopandas; geopandas.show_versions();" if: contains(matrix.environment-file, 'dev') - - name: run pytest run: | pytest \ @@ -77,7 +72,6 @@ jobs: --cov-append \ --cov-report xml \ --cov-report term-missing - - name: run docstring tests if: contains(matrix.environment-file, 'dev') && contains(matrix.os, 'ubuntu') run: | @@ -93,7 +87,6 @@ jobs: --cov-report term-missing \ --doctest-only \ --doctest-continue-on-failure - - name: codecov uses: codecov/codecov-action@v5 with: From 42913051245ffdaeaf4965d666c06c91a87db15d Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 12 Jul 2025 20:45:31 -0400 Subject: [PATCH 6/7] don't mention specific versions in README - point to pyproject.toml --- README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 04bf11e..32a62eb 100644 --- a/README.md +++ b/README.md @@ -73,11 +73,13 @@ pip install git+https://github.com/pysal/giddy #### Requirements -- scipy>=1.8 -- libpysal>=4.8 -- mapclassify>=2.5 -- esda>=2.4 -- quantecon>=0.7 +*see currently supported versions in [`pyproject.toml[dependencies]`](https://github.com/pysal/giddy/blob/main/pyproject.toml)* + +- scipy +- libpysal +- mapclassify +- esda +- quantecon Contribute -------------- From 4975926b69e8b15ebdcc58dec5d61f17dcdac5d5 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Sat, 12 Jul 2025 21:11:53 -0400 Subject: [PATCH 7/7] update doc build action; ensure build properly --- .github/workflows/build_docs.yml | 20 ++++---------------- ci/py313_giddy-latest.yaml | 8 ++++++++ docs/Makefile | 6 +++--- docs/conf.py | 10 +++++----- docs/installation.rst | 7 ++----- 5 files changed, 22 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index c82b9e2..dc04038 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -43,21 +43,9 @@ jobs: run: | cd docs make html - - name: commit docs - run: > - git clone https://github.com/ammaraskar/sphinx-action-test.git --branch - gh-pages --single-branch gh-pages - cp -r docs/_build/html/* gh-pages/ - cd gh-pages - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add . - git commit -m "Update documentation" -a || true - - name: push to gh-pages - uses: ad-m/github-push-action@master + - name: Publish to Github Pages + uses: peaceiris/actions-gh-pages@v4 with: - branch: gh-pages - directory: gh-pages github_token: ${{ secrets.GITHUB_TOKEN }} - force: true - + publish_dir: docs/build/html/ + keep_files: false diff --git a/ci/py313_giddy-latest.yaml b/ci/py313_giddy-latest.yaml index 5f2c2d9..561a09c 100644 --- a/ci/py313_giddy-latest.yaml +++ b/ci/py313_giddy-latest.yaml @@ -17,3 +17,11 @@ dependencies: - pytest - pytest-cov - pytest-xdist + # docs (this env only) + - nbsphinx + - numpydoc + - sphinx + - sphinxcontrib-bibtex + - sphinxcontrib-napoleon + - sphinx-gallery + - sphinx_bootstrap_theme diff --git a/docs/Makefile b/docs/Makefile index 91e22de..071f1ab 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -4,9 +4,9 @@ # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build -SPHINXPROJ = giddy +SPHINXPROJ = PACKAGE_NAME SOURCEDIR = . -BUILDDIR = _build +BUILDDIR = build # Put it first so that "make" without argument is like "make help". help: @@ -24,7 +24,7 @@ github: @make html sync: - @rsync -avh _build/html/ ../docs/ --delete + @rsync -avh build/html/ ../docs/ --delete @make clean touch .nojekyll diff --git a/docs/conf.py b/docs/conf.py index be4a3c6..9927392 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -96,7 +96,7 @@ # directories to ignore when looking for source files. # This patterns also effect to html_static_path and html_extra_path exclude_patterns = [ - "_build", + "build", "Thumbs.db", ".DS_Store", "tests/*", @@ -276,12 +276,12 @@ def setup(app): # Configuration for intersphinx intersphinx_mapping = { "python": ("https://docs.python.org/3", None), - "numpy": ("https://docs.scipy.org/doc/numpy", None), - "scipy": ("https://docs.scipy.org/doc/scipy/reference/", None), + "esda": ("https://pysal.org/esda/", None), "libpysal": ("https://pysal.org/libpysal/", None), "mapclassify": ("https://pysal.org/mapclassify/", None), - "esda": ("https://pysal.org/esda/", None), - "matplotlib": ("https://matplotlib.org/", None), + "matplotlib": ("https://matplotlib.org/stable/", None), + "numpy": ("https://numpy.org/doc/stable/", None), + "scipy": ("https://docs.scipy.org/doc/scipy/", None), } diff --git a/docs/installation.rst b/docs/installation.rst index 78d334f..89ca8a7 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -3,8 +3,8 @@ Installation ============ -giddy currently supports python `3.10`_, `3.11`_, and `3.12`_. -Please make sure that you are operating in a python 3 environment. +giddy currently supports python `3.11`_ and above. +Please make sure that you are operating in a supported environment. Installing released version --------------------------- @@ -14,7 +14,6 @@ install directly with `pip` from the command line:: pip install -U giddy - or download the source distribution (.tar.gz) and decompress it to your selected destination. Open a command shell and navigate to the decompressed folder. Type:: @@ -41,9 +40,7 @@ your fork. By making changes to your local clone and submitting a pull request to `pysal/giddy`_, you can contribute to the giddy development. -.. _3.10: https://docs.python.org/3.10/ .. _3.11: https://docs.python.org/3.11/ -.. _3.12: https://docs.python.org/3.12/ .. _Python Package Index: https://pypi.org/project/giddy/ .. _pysal/giddy: https://github.com/pysal/giddy .. _fork: https://help.github.com/articles/fork-a-repo/