Skip to content

Commit e146fbf

Browse files
committed
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.
1 parent 954218b commit e146fbf

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

CHANGES.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,18 @@ Fixed:
6969
Noschvie on github.com)
7070
- support dicttoxml2.py for Roundup running on 3.7 and
7171
newer. dicttoxml uses a type alias: collection.Iterator that is
72-
dropped in Python 3.10. (found by Norbert SCHLEMMER, fix John
72+
dropped in Python 3.10. (found by Norbert Schlemmer, fix John
7373
Rouillard)
7474
- fix repeated password id with user.item.html in all templates except
7575
jinja2. (John Rouillard)
7676
- fix unclosed file when saving index in indexer_dbm.py. (John Rouillard)
7777
- fix task index in devel tracker so it doesn't cause a crash if all
7878
fields are selected. (John Rouillard)
79+
- fix windows install. When using pip share directory is installed in
80+
a directory tree under the lib directory. Fix it so that Lib/share
81+
is used to install the share tree. The lets Roundup find tracker
82+
templates and translation files. (Found by Simon Eigeldinger, fix
83+
John Rouillard)
7984

8085
Features:
8186

setup.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,18 @@ def get_prefix():
8787
if prefix:
8888
return prefix
8989
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+
90102
# start with the platform library
91103
plp = get_path('platlib')
92104
# nuke suffix that matches lib/* and return prefix

0 commit comments

Comments
 (0)