Skip to content

Commit

Permalink
pep396
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowone committed Jun 7, 2018
1 parent cf04523 commit 810292b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 5 deletions.
7 changes: 5 additions & 2 deletions ring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
====================================================
Common ring decorators are aliased in this level as shortcuts.
"""
import ring.coder # noqa
from ring.__version__ import __version__ # noqa
from ring.func import (
dict, memcache, redis, disk,
aiodict, aiomcache, aioredis)
import ring.django # noqa
try:
import ring.django # noqa
except ImportError:
pass


__all__ = (
Expand Down
1 change: 1 addition & 0 deletions ring/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '0.7.0'
1 change: 0 additions & 1 deletion ring/version.txt

This file was deleted.

2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ python_files = tests/test*.py
norecursedirs=.git py ci
[flake8]
ignore=E501,E701
[metadata]
version-from-file: ring/__init__.py
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@


def get_version():
with open('ring/version.txt') as f:
return f.read().strip()
with open('ring/__version__.py') as f:
empty, version = f.read().split('__version__ = ')
assert empty == ''
version = version.strip()


install_requires = [
Expand Down
6 changes: 6 additions & 0 deletions tests/test_ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,9 @@ def simple(key):

assert simple(value) == value # cache miss
assert simple(value) == value # cache hit


def test_package_version():
parts = ring.__version__.split('.')
assert len(parts) == 3
assert parts[0] == '0'

0 comments on commit 810292b

Please sign in to comment.