diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 39347bc0..00f08241 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -39,7 +39,7 @@ jobs: }); - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@master + uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ password: ${{ secrets.PYPI_PASSWORD }} diff --git a/.github/workflows/versioneer.yml b/.github/workflows/versioneer.yml new file mode 100644 index 00000000..9fd7c352 --- /dev/null +++ b/.github/workflows/versioneer.yml @@ -0,0 +1,50 @@ +# See https://github.com/python-versioneer/python-versioneer +name: "Update Versioneer" +on: + workflow_dispatch: + inputs: + version: + description: Manual Versioneer Run + default: test + required: false + schedule: + - cron: "0 6 1 * *" # 1st day of each month at 06:00 UTC + push: + paths: + - "setup.cfg" + - ".github/workflows/versioneer.yml" + +jobs: + versioneer: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: "3.11" + - name: Install and run versioneer + run: | + pip install versioneer + versioneer install + - name: Blacken code + uses: psf/black@stable + with: + options: "--verbose" + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + path: versioneer.py + - name: Ignore changes in __init__ + run: | + git reset -- mapclassify/__init__.py + git checkout -- mapclassify/__init__.py + - name: Create PR + uses: peter-evans/create-pull-request@v4 + with: + title: "Update Versioneer" + branch: update-versioneer + base: main + commit-message: "[Bot] Update Versioneer" + + body: | + Automatic update of Versioneer by the `versioneer.yml` workflow. diff --git a/setup.py b/setup.py index f000d960..fc6bd3b2 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,5 @@ import os import sys -from distutils.command.build_py import build_py from io import open from os.path import join as pjoin from os.path import relpath @@ -73,7 +72,7 @@ def setup_package(): setup( name=package, version=versioneer.get_version(), - cmdclass=versioneer.get_cmdclass({"build_py": build_py}), + cmdclass=versioneer.get_cmdclass(), description="Classification Schemes for Choropleth Maps.", long_description=long_description, long_description_content_type="text/markdown",