Skip to content

Commit

Permalink
parse version instead of interpreting
Browse files Browse the repository at this point in the history
  • Loading branch information
bubenkoff committed Jun 15, 2015
1 parent ab0c731 commit 6e98670
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
14 changes: 5 additions & 9 deletions pytest_factoryboy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@

__version__ = '1.1.0'

try:
from .fixture import register, LazyFixture
from .fixture import register, LazyFixture

__all__ = [
register.__name__,
LazyFixture.__name__,
]
except ImportError: # pragma: no cover
# avoid import errors when only __version__ is needed (for setup.py)
pass
__all__ = [
register.__name__,
LazyFixture.__name__,
]
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@

import codecs
import os
import re
from setuptools import setup

import pytest_factoryboy


dirname = os.path.dirname(__file__)

long_description = (
Expand All @@ -16,6 +14,9 @@
codecs.open(os.path.join(dirname, "CHANGES.rst"), encoding="utf-8").read()
)

with codecs.open(os.path.join(dirname, 'pytest_factoryboy', '__init__.py'), encoding='utf-8') as fd:
VERSION = re.compile(r".*__version__ = '(.*?)'", re.S).match(fd.read()).group(1)

setup(
name="pytest-factoryboy",
description="Factory Boy support for pytest.",
Expand All @@ -24,7 +25,7 @@
license="MIT license",
author_email="oleg.pidsadnyi@gmail.com",
url="https://github.com/pytest-dev/pytest-factoryboy",
version=pytest_factoryboy.__version__,
version=VERSION,
classifiers=[
"Development Status :: 6 - Mature",
"Intended Audience :: Developers",
Expand Down

0 comments on commit 6e98670

Please sign in to comment.