Skip to content

Commit

Permalink
add __version__ var to package
Browse files Browse the repository at this point in the history
  • Loading branch information
ikvk committed Apr 28, 2020
1 parent 5a6489b commit cdebd40
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,4 @@ Thanks to:
* `audemed44 <https://github.com/audemed44>`_
* `mkalioby <https://github.com/mkalioby>`_
* `atlas0fd00m <https://github.com/atlas0fd00m>`_
* `unqx <https://github.com/unqx>`_
2 changes: 2 additions & 0 deletions imap_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
from .message import *
from .folder import *
from .utils import *

__version__ = '0.14.3'
4 changes: 4 additions & 0 deletions release_notes.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.14.3
======
* Fixed multiple encodings case for attachment name

0.14.2
======
* Fixed bug in folder.MailBoxFolderManager.exists/list on folder names with " and \ chars
Expand Down
11 changes: 10 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
import os
import re
import setuptools


def get_version(package: str) -> str:
"""Return package version as listed in __version__ variable at __init__.py"""
init_py = open(os.path.join(package, '__init__.py')).read()
return re.search(r"__version__\s*=\s*['\"]([^'\"]+)['\"]", init_py).group(1)


with open("README.rst", "r", encoding='utf-8') as fh:
long_description = fh.read()

setuptools.setup(
name='imap_tools',
version='0.14.2',
version=get_version('imap_tools'),
packages=setuptools.find_packages(),
url='https://github.com/ikvk/imap_tools',
license='Apache-2.0',
Expand Down

0 comments on commit cdebd40

Please sign in to comment.