Skip to content

Commit

Permalink
Fix relative path handling in setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
noirbizarre committed May 10, 2015
1 parent 50e7ec5 commit e08a1f1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import unicode_literals
import re

from os.path import join
from os.path import join, dirname

from setuptools import setup, find_packages

Expand All @@ -20,6 +20,8 @@
(r'.*coveralls\.io/.*', ''),
)

ROOT = dirname(__file__)


def rst(filename):
'''
Expand All @@ -28,7 +30,7 @@ def rst(filename):
- code-block directive
- travis ci build badge
'''
content = open(filename).read()
content = open(join(ROOT, filename)).read()
for regex, replacement in PYPI_RST_FILTERS:
content = re.sub(regex, replacement, content)
return content
Expand All @@ -37,7 +39,7 @@ def rst(filename):
def pip(filename):
'''Parse pip requirement file and transform it to setuptools requirements'''
requirements = []
for line in open(join('requirements', filename)):
for line in open(join(ROOT, 'requirements', filename)):
line = line.strip()
if not line or '://' in line:
continue
Expand All @@ -50,7 +52,7 @@ def pip(filename):


def dependency_links(filename):
return [line.strip() for line in open(join('requirements', filename)) if '://' in line]
return [line.strip() for line in open(join(ROOT, 'requirements', filename)) if '://' in line]


long_description = '\n'.join((
Expand Down

0 comments on commit e08a1f1

Please sign in to comment.