Skip to content

Commit

Permalink
Add PEP-396 compliant __version__
Browse files Browse the repository at this point in the history
  • Loading branch information
akx committed Jan 18, 2020
1 parent 6535e76 commit 46b2a6f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions enumfields/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
from .enums import Enum, IntEnum
from .fields import EnumField, EnumIntegerField

__version__ = "1.0.0"
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python

import os
import re

from setuptools import find_packages, setup

Expand All @@ -9,17 +10,19 @@ def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()


README = read('README.rst')
def read_version(fname):
return re.search("__version__ = ['\"]([^'\"]+)['\"]", read(fname)).group(1)


setup(
name='django-enumfields',
version='1.0.0',
version=read_version('enumfields/__init__.py'),
author='HZDG',
author_email='[email protected]',
description='Real Python Enums for Django.',
license='MIT',
url='https://github.com/hzdg/django-enumfields',
long_description=README,
long_description=(read('README.rst')),
packages=find_packages(exclude=['tests*']),
zip_safe=False,
classifiers=[
Expand Down
5 changes: 5 additions & 0 deletions tests/test_misc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import enumfields


def test_version():
assert isinstance(enumfields.__version__, str)

0 comments on commit 46b2a6f

Please sign in to comment.