diff setup.py @ 7933:8bf56686f763

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.
author John Rouillard <rouilj@ieee.org>
date Sun, 05 May 2024 18:34:06 -0400
parents 55229bfcdd8a
children a377590eba34
line wrap: on
line diff
--- a/setup.py	Sun May 05 18:19:04 2024 -0400
+++ b/setup.py	Sun May 05 18:34:06 2024 -0400
@@ -52,7 +52,7 @@
     return '%s = roundup.scripts.%s:run' % (script, module)
 
 
-def make_data_files_absolute(data_files, prefix):
+def make_data_files_absolute(data_files, prefix, enable=False):
     """Using setuptools data files are put under the egg install directory
        if the datafiles are relative paths. We don't want this. Data files
        like man pages, documentation, templates etc. should be installed
@@ -63,8 +63,9 @@
     """
     new_data_files = [ (os.path.join(prefix,df[0]),df[1])
                        for df in data_files ]
-
-    return new_data_files
+    if enable:
+        return new_data_files
+    return data_files
 
 
 def get_prefix():

Roundup Issue Tracker: http://roundup-tracker.org/