Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a numeric field for version info. #39

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ defaults:
jobs:
run:
runs-on: ${{ matrix.os }}
timeout-minutes: 3

strategy:
fail-fast: false
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
on:
push:
tags:
- '*'
permissions:
contents: read

jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/matplotlib-inline
permissions:
id-token: write
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Install built wheel
run: pip install dist/*
- name: Build package
run: python -m build
- name: Echo current tag
run: echo ${{ github.ref }}
- name: Get package version
run: |
PACKAGE_VERSION=$(python -c 'import matplotlib_inline; print(matplotlib_inline.__version__)')
echo "Package version: $PACKAGE_VERSION"

- name: Check tag and package version match
run: |
if [ "$GITHUB_REF" != "refs/tags/$PACKAGE_VERSION" ]; then
echo "Tag and package version do not match. Aborting."
exit 1
fi
# - name: Publish package
# uses: pypa/gh-action-pypi-publish@15c56dba361d8335944d31a2ecd17d700fc7bcbc

8 changes: 7 additions & 1 deletion matplotlib_inline/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
from . import backend_inline, config # noqa
__version__ = "0.1.7" # noqa

__version__ = "0.1.7"

# we can't ''.join(...) otherwise finding the version number at build time requires
# import which introduces IPython and matplotlib at build time, and thus circular
# dependencies.
version_info = tuple(int(s) for s in __version__.split(".")[:3])
8 changes: 4 additions & 4 deletions tests/notebooks/mpl_inline.ipynb

Large diffs are not rendered by default.

Loading