From f0ea0ea5558c957f409f97bc27dd87413a366dc0 Mon Sep 17 00:00:00 2001 From: Ana Sofia Carmo <37815826+anascacais@users.noreply.github.com> Date: Wed, 24 Jan 2024 17:23:56 +0000 Subject: [PATCH] Changes to versioning and pypi (#27) * Update __version__.py * Update setup.py * Update publish-to-pypi.yml --- .github/workflows/publish-to-pypi.yml | 5 ++++- biosppy/__version__.py | 2 +- setup.py | 10 +++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml index 8e692e5f..2e49c966 100644 --- a/.github/workflows/publish-to-pypi.yml +++ b/.github/workflows/publish-to-pypi.yml @@ -1,6 +1,9 @@ name: Publish Python 🐍 distribution 📦 to PyPI -on: push +on: + push: + tags: + - '*' jobs: build: diff --git a/biosppy/__version__.py b/biosppy/__version__.py index 85dc0145..d9d89d0f 100644 --- a/biosppy/__version__.py +++ b/biosppy/__version__.py @@ -9,5 +9,5 @@ :license: BSD 3-clause, see LICENSE for more details. """ -VERSION = (1, 0, 0) +VERSION = (2, 1, 2) __version__ = ".".join(map(str, VERSION)) diff --git a/setup.py b/setup.py index aa961029..c14d3006 100644 --- a/setup.py +++ b/setup.py @@ -16,10 +16,18 @@ import io import os import sys +import re +import ast from shutil import rmtree from setuptools import find_packages, setup, Command +_version_re = re.compile(r'__version__\s+=\s+(.*)') + +with open('biosppy/__init__.py', 'rb') as f: + version = str(ast.literal_eval(_version_re.search( + f.read().decode('utf-8')).group(1))) + # Package meta-data. NAME = 'biosppy' DESCRIPTION = 'A toolbox for biosignal processing written in Python.' @@ -27,7 +35,7 @@ EMAIL = 'developer@scientisst.com' AUTHOR = 'Instituto de Telecomunicacoes' REQUIRES_PYTHON = '>3.5.2' -VERSION = '2.1.1' +VERSION = version LICENSE = 'BSD 3-clause' # What packages are required for this module to be executed?