Merge pull request #868 from theodesp/issue-867

Fixed [Issue 867] Simplified code in setup.py
main
Selwin Ong 8 years ago committed by GitHub
commit 009c478822

@ -2,17 +2,18 @@
rq is a simple, lightweight, library for creating background jobs, and rq is a simple, lightweight, library for creating background jobs, and
processing them. processing them.
""" """
import sys
import os import os
from setuptools import setup, find_packages from setuptools import setup, find_packages
def get_version(): def get_version():
basedir = os.path.dirname(__file__) basedir = os.path.dirname(__file__)
try:
with open(os.path.join(basedir, 'rq/version.py')) as f: with open(os.path.join(basedir, 'rq/version.py')) as f:
locals = {} locals = {}
exec(f.read(), locals) exec(f.read(), locals)
return locals['VERSION'] return locals['VERSION']
except FileNotFoundError:
raise RuntimeError('No version info found.') raise RuntimeError('No version info found.')

Loading…
Cancel
Save