Skip to content

Commit efb54f9

Browse files
committed
fix: setup.py change again. Make data files relative.
Keep make_data_files_absolute(data_files, prefix), but make it a no-op via parameter in case it needs to be reverted in the field. When run under pip, the data files are re-parented to the prefix directory even when they are absolute. So I get paths like: /usr/local/venv/usr/local/venv/share/{roundup,man,docs,locale,...}/... rather than: /usr/local/venv/share/{roundup,man,docs,locale,...}/... Roundup is finding them in either place, but /usr/local/venv/share is easier for humans who need to be able to find man pages, html docs, example code, frontend integration code (wsgi, cgi, zope) to modify. Running 'roundup-admin templates' can give the user a hint where the share directory is. I feel like I keep going around and around on this. I have decided to make pip install in a venv the standard path for installation. So make the code work for that path and if it breaks all the other ways to install, well that's the realm of Python packaging. The internal code that searches a bunch of places to try to find its files is not changed.
1 parent 5e3c619 commit efb54f9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

setup.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def mapscript(path):
5252
return '%s = roundup.scripts.%s:run' % (script, module)
5353

5454

55-
def make_data_files_absolute(data_files, prefix):
55+
def make_data_files_absolute(data_files, prefix, enable=False):
5656
"""Using setuptools data files are put under the egg install directory
5757
if the datafiles are relative paths. We don't want this. Data files
5858
like man pages, documentation, templates etc. should be installed
@@ -63,8 +63,9 @@ def make_data_files_absolute(data_files, prefix):
6363
"""
6464
new_data_files = [ (os.path.join(prefix,df[0]),df[1])
6565
for df in data_files ]
66-
67-
return new_data_files
66+
if enable:
67+
return new_data_files
68+
return data_files
6869

6970

7071
def get_prefix():

0 commit comments

Comments
 (0)