comparison setup.py @ 7695:2be7a8f66ea7

fix: windows install using pip mislocates share directory The setup code that tries to make the share install path absolute prependeds something like: c:\program files\python_venv to the paths. The equivalent on linux is recognized as an absolute path. On windows this is treated oddly. This resulted in the share files being placed in: c:\program files\python_venv\Lib\site-packages\program files\python_venv\share Roundup was unable to find the files there. On windows (where the platform starts with 'win') don't make the path absolute. This puts share in: c:\program files\python_venv\Lib\share and Roundup finds them. The translations and templates are found by the roundup-server. The docs are also installed under the share directory. The man pages are not installed as windows doesn't have groff to format the source documents. This is the second fix from issues getting Roundup running on windows discussed on mailing list by Simon Eigeldinger. Thread starts with: https://sourceforge.net/p/roundup/mailman/message/41557096/ subject: Installing Roundup on Windows 2023-10-05.
author John Rouillard <rouilj@ieee.org>
date Sun, 05 Nov 2023 23:01:29 -0500
parents d3d685dab459
children 0127045f573b
comparison
equal deleted inserted replaced
7694:54eb12cd3be1 7695:2be7a8f66ea7
85 # strip '--prefix=' 85 # strip '--prefix='
86 prefix=a[9:] 86 prefix=a[9:]
87 if prefix: 87 if prefix:
88 return prefix 88 return prefix
89 else: 89 else:
90 if sys.platform.startswith('win'):
91 # on windows, using pip to install and
92 # prefixing data file paths with c:\path\a\b\...
93 # results in treatment as a relative path.
94 # The result is files are buried under:
95 # platlib\path\a\b\...\share\ and not findable by
96 # Roundup. So return no prefix which places the files at
97 # platlib\share\{doc,locale,roundup} where roundup can
98 # find templates/translations etc.
99 # sigh....
100 return ""
101
90 # start with the platform library 102 # start with the platform library
91 plp = get_path('platlib') 103 plp = get_path('platlib')
92 # nuke suffix that matches lib/* and return prefix 104 # nuke suffix that matches lib/* and return prefix
93 head, tail = os.path.split(plp) 105 head, tail = os.path.split(plp)
94 old_head = None 106 old_head = None

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