Skip to content

Commit

Permalink
Merge pull request #48 from pnkraemer/versioning
Browse files Browse the repository at this point in the history
Automated versioning
  • Loading branch information
pnkraemer authored Feb 7, 2022
2 parents 6d1c770 + 8129aba commit 3c9af24
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/pypi-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
#
# Source:
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

name: Upload Python Package

on:
release:
types: [published]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade build twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python -m build
twine upload dist/*py3-none-any.whl
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@

src/probfindiff/_version.py
.idea

# Byte-compiled / optimized / DLL files
Expand Down
12 changes: 12 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,22 @@
requires = [
"setuptools>=42",
"wheel",
"setuptools_scm[toml]",
]
build-backend = "setuptools.build_meta"


[tool.setuptools_scm]
local_scheme = "no-local-version"
write_to = "src/probfindiff/_version.py"
write_to_template = """
# pylint: skip-file
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
version = \"{version}\"
"""

# Configuration of the black code style checker
# For more information about Black's usage of this file, see
# https://github.com/psf/black#pyprojecttoml
Expand Down
2 changes: 2 additions & 0 deletions src/probfindiff/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Probabilistic numerical finite difference methods."""


from ._toplevel_api import (
FiniteDifferenceScheme,
backward,
Expand All @@ -9,6 +10,7 @@
forward,
from_grid,
)
from ._version import version as __version__

__all__ = [
"differentiate",
Expand Down

0 comments on commit 3c9af24

Please sign in to comment.