From b788ee7f46582e17401c79000ad6fd5e1049aec9 Mon Sep 17 00:00:00 2001 From: Wei Kang Date: Thu, 2 Mar 2023 20:33:46 -0600 Subject: [PATCH 1/4] add github action for release --- .github/workflows/release_and_publish.yml | 44 +++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/release_and_publish.yml diff --git a/.github/workflows/release_and_publish.yml b/.github/workflows/release_and_publish.yml new file mode 100644 index 0000000..ecc932b --- /dev/null +++ b/.github/workflows/release_and_publish.yml @@ -0,0 +1,44 @@ +# Release package on GitHub and publish to PyPI +# IMPORTANT -- 1 MANUAL STEP +# * FOLLOWING TAGGED RELEASE +# - update CHANGELOG.md +#-------------------------------------------------- + +name: Build, Release, and publish + +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 Release + default: test + required: false + +jobs: + build: + name: Create release & publish to PyPI + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + - name: Set up python + uses: actions/setup-python@v4 + with: + python-version: "3.x" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine jupyter urllib3 pandas pyyaml + python setup.py sdist bdist_wheel + + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_PASSWORD }} From d56859834e606981d7aadb62b10bb8a0b9a876b4 Mon Sep 17 00:00:00 2001 From: Wei Kang Date: Thu, 2 Mar 2023 22:28:46 -0600 Subject: [PATCH 2/4] add github action for docs building --- .github/workflows/build_docs.yml | 68 ++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/build_docs.yml diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml new file mode 100644 index 0000000..5dc0a6c --- /dev/null +++ b/.github/workflows/build_docs.yml @@ -0,0 +1,68 @@ +# Building and hosting documentation for PACKAGE_NAME +# +# Notes: +# - After the first run of this workflow: +# - Within the project repo, navigate to Setting/Github Pages +# - set `the source pbranch to `gh-pages/(root))`. +# - Uncomment evertything below the following line to enable the workflow. +#--------------------------------------------------------------------------- + + 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/311-BASE.yaml] + experimental: [false] + defaults: + run: + shell: bash -l {0} + + steps: + - name: checkout repo + uses: actions/checkout@v3 + + - name: setup micromamba + uses: mamba-org/provision-with-micromamba@main + with: + environment-file: ${{ matrix.environment-file }} + micromamba-version: 'latest' + + - 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 From 195e627e9e5e6e523d74eb06caaca547b86d945d Mon Sep 17 00:00:00 2001 From: Wei Kang Date: Thu, 2 Mar 2023 22:45:44 -0600 Subject: [PATCH 3/4] fix CI badge --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index bb68327..38a6b0b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # pointpats: Point Pattern Analysis in PySAL -[![Continuous Integration](https://github.com/pysal/pointpats/actions/workflows/tests.yml/badge.svg)](https://github.com/pysal/pointpats/actions/workflows/tests.yml) +[![Continuous Integration](https://github.com/pysal/pointpats/actions/workflows/tests.yaml/badge.svg)](https://github.com/pysal/pointpats/actions/workflows/tests.yaml) [![codecov](https://codecov.io/gh/pysal/pointpats/branch/master/graph/badge.svg)](https://codecov.io/gh/pysal/pointpats) [![Documentation Status](https://readthedocs.org/projects/pointpats/badge/?version=latest)](https://pointpats.readthedocs.io/en/latest/?badge=latest) [![PyPI version](https://badge.fury.io/py/pointpats.svg)](https://badge.fury.io/py/pointpats) @@ -26,14 +26,14 @@ Online documentation is available ## Examples -- [Basic point pattern +- [Basic point pattern structure](https://github.com/pysal/pointpats/tree/master/notebooks/pointpattern.ipynb) -- [Centrography and +- [Centrography and visualization](https://github.com/pysal/pointpats/tree/master/notebooks/centrography.ipynb) -- [Marks](https://github.com/pysal/pointpats/tree/master/notebooks/marks.ipynb) -- [Simulation of point +- [Marks](https://github.com/pysal/pointpats/tree/master/notebooks/marks.ipynb) +- [Simulation of point processes](https://github.com/pysal/pointpats/tree/master/notebooks/process.ipynb) -- [Distance based +- [Distance based statistics](https://github.com/pysal/pointpats/tree/master/notebooks/distance_statistics-numpy-oriented.ipynb) ## Installation From 991951d60796753fbebd4a07bc5accf2a24e4fec Mon Sep 17 00:00:00 2001 From: Wei Kang Date: Thu, 2 Mar 2023 22:45:59 -0600 Subject: [PATCH 4/4] python versions in setup.py to be consistent with CI testing --- setup.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 809c299..6cb75b8 100644 --- a/setup.py +++ b/setup.py @@ -47,7 +47,7 @@ def setup_package(): maintainer="Hu Shao", maintainer_email="shaohutiger@gmail.com", py_modules=["pointpats"], - python_requires=">3.5", + python_requires=">3.7", tests_require=["pytest"], keywords="spatial statistics", classifiers=[ @@ -59,8 +59,10 @@ def setup_package(): "Topic :: Scientific/Engineering :: GIS", "License :: OSI Approved :: BSD License", "Programming Language :: Python", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11" ], license="3-Clause BSD", packages=find_packages(),