Skip to content

Commit

Permalink
fix: windows install using pip mislocates share directory
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rouilj committed Nov 6, 2023
1 parent 954218b commit e146fbf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,18 @@ Fixed:
Noschvie on github.com)
- support dicttoxml2.py for Roundup running on 3.7 and
newer. dicttoxml uses a type alias: collection.Iterator that is
dropped in Python 3.10. (found by Norbert SCHLEMMER, fix John
dropped in Python 3.10. (found by Norbert Schlemmer, fix John
Rouillard)
- fix repeated password id with user.item.html in all templates except
jinja2. (John Rouillard)
- fix unclosed file when saving index in indexer_dbm.py. (John Rouillard)
- fix task index in devel tracker so it doesn't cause a crash if all
fields are selected. (John Rouillard)
- fix windows install. When using pip share directory is installed in
a directory tree under the lib directory. Fix it so that Lib/share
is used to install the share tree. The lets Roundup find tracker
templates and translation files. (Found by Simon Eigeldinger, fix
John Rouillard)

Features:

Expand Down
12 changes: 12 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,18 @@ def get_prefix():
if prefix:
return prefix
else:
if sys.platform.startswith('win'):
# on windows, using pip to install and
# prefixing data file paths with c:\path\a\b\...
# results in treatment as a relative path.
# The result is files are buried under:
# platlib\path\a\b\...\share\ and not findable by
# Roundup. So return no prefix which places the files at
# platlib\share\{doc,locale,roundup} where roundup can
# find templates/translations etc.
# sigh....
return ""

# start with the platform library
plp = get_path('platlib')
# nuke suffix that matches lib/* and return prefix
Expand Down

0 comments on commit e146fbf

Please sign in to comment.