Skip to content

Commit

Permalink
try versioneer action (#697)
Browse files Browse the repository at this point in the history
* try versioneer action

* unpin versioneer version in pyproject.toml

* add toml path to versioneer action

* make deps dynamic in toml

* update versioneer.yml

* correct syntax in versioneer.yml

* try pinning versioneer[toml]==0.28

* implement versioneer suggestions

* update pypa/gh-action-pypi-publish branch
  • Loading branch information
jGaboardi committed Jan 13, 2023
1 parent d361805 commit fa2ead9
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,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 }}
50 changes: 50 additions & 0 deletions .github/workflows/versioneer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# See https://github.com/python-versioneer/python-versioneer
name: "Update Versioneer"
on:
workflow_dispatch:
inputs:
version:
description: Manual Unittest Run
default: test
required: false
schedule:
- cron: "0 6 1 * *" # 1st day of each month at 06:00 UTC
push:
paths:
- "pyproject.toml"
- ".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[toml]
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 -- spaghetti/__init__.py
git checkout -- spaghetti/__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.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ requires = [
"isort",
"pyproject-flake8",
"setuptools>=61.0.0",
"versioneer[toml]==0.26",
"versioneer[toml]",

]
build-backend = "setuptools.build_meta"

[project]
name = "spaghetti"
dynamic = ["version"]
dynamic = ["dependencies", "version"]
maintainers = [
{name = "James D. Gaboardi", email = "jgaboardi@gmail.com"},
]
Expand Down

0 comments on commit fa2ead9

Please sign in to comment.