Skip to content

Commit

Permalink
Automated versioning based on package metadata (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanWenger authored Mar 19, 2021
1 parent cb9e5ec commit 71c4990
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 31 deletions.
25 changes: 0 additions & 25 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,6 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Find and replace version
run: |
# from refs/tags/v1.2.3 get 1.2.3
VERSION=$(echo $GITHUB_REF | sed 's#.*/v##')
PLACEHOLDER='version = '
VERSION_FILE='setup.cfg'
# ensure the placeholder is there. If grep doesn't find the placeholder
# it exits with exit code 1 and github actions aborts the build.
grep "$PLACEHOLDER" "$VERSION_FILE"
sed -i "s/^version =.*$/version = ${VERSION}/" "$VERSION_FILE"
shell: bash
- name: Commit version bump
run: |
# from refs/tags/v1.2.3 get 1.2.3
VERSION=$(echo $GITHUB_REF | sed 's#.*/v##')
git config --local user.name "bumpversion-bot"
git add setup.cfg
git commit -m "Automatic version bump to ${VERSION}. Triggered on release via GitHub Actions."
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
force: false
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ benchmarks/probnum/*

######### IDEs #########

# IntelliJ: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
## IntelliJ: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 ##

# User-specific stuff
.idea/
Expand Down Expand Up @@ -130,3 +130,7 @@ fabric.properties

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser


## VSCode ##
.vscode/
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

[metadata]
name = probnum
version = 0.1.3
description = Probabilistic Numerics in Python.
url = https://github.com/probabilistic-numerics/probnum
author = ProbNum Authors
Expand All @@ -30,6 +29,8 @@ classifiers =
zip_safe = False
packages = find:
include_package_data = True
setup_requires =
setuptools_scm
package_dir =
=src
# Dependencies of the project (semicolon/line-separated):
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""
Setup file for probnum.
Use setup.cfg to configure the project.
"""Setup file for probnum.
Use setup.cfg to configure the project.
"""
import sys

Expand All @@ -16,4 +16,4 @@


if __name__ == "__main__":
setup()
setup(use_scm_version=True)

0 comments on commit 71c4990

Please sign in to comment.