eoyilmaz / displaycal-py3

DisplayCAL Modernization Project
https://eoyilmaz.github.io/displaycal-py3/
GNU General Public License v3.0
757 stars 56 forks source link

``setup.py`` doesn't install data files and folders #8

Open eoyilmaz opened 2 years ago

eoyilmaz commented 2 years ago

Running python3 setup.py install skips the following files and folders to be included in the installation:

lang
presets
ref
theme
ti1
xrc
eoyilmaz commented 2 years ago

Apparently it is copying the files under the share/DisplayCAL folder. So now the problem converts into that, DisplayCAL can't find them.

eoyilmaz commented 2 years ago

The setup.py definitely needs a modern OOP approach where proper objects per OS are used instead of very very very cumbersome and complex if statements. This issue can definitely benefit from this kind of approach. But for now python setup.py install --install-data $HOME/.local is a working workaround.

eoyilmaz commented 2 years ago

This is fixed in 578ad89

eoyilmaz commented 2 years ago

It seems that this is not properly fixed, the data files are getting installed in to the venv/lib/python3.x/site-packages/DisplayCAL-*.egg/share/DisplayCAL folder where as they should be installed to .local/share/DisplayCAL and referenced from there.

aadm commented 2 years ago

@eoyilmaz thanks for this work you're been doing on displaycal first of all.

I just wanted to add that in my case I installed displaycal with pipx install displaycal and then all the resources are copied to ~/.local/pipx/venvs/displaycal/share/DisplayCAL/ which is not seen from the application for some reason.

I simply copied all the content of the folder above to ~/.local/share/DisplayCAL as you wrote above. I'm sure this will be fixed soon but if others find the same error they now have a temporary solution.

As reference, these are the error messages output to console that I used to have before copying those files:

(base) aadm@psion:~ $ displaycal
XDG: [Errno 2] No translation file found for domain: 'xdg-user-dirs'
Acquired lock file: <DisplayCAL.main.AppLock object at 0x7f9d775c85b0>
displaycal 3.9.6 2022-06-11T22:07:30Z
ubuntu 21.04 hirsute x86_64
Python 3.9.5 (default, Nov 18 2021, 16:00:48) 
[GCC 10.3.0]
Faulthandler 
wxPython 4.1.1 gtk3 (phoenix) wxWidgets 3.1.5
Encoding: utf-8
File system encoding: utf-8
Loading /home/aadm/.config/DisplayCAL/DisplayCAL.ini
listening
writing to lock file: port: 15411
NoneType: None
┌──────────────────────────────────────────────────────────────────────────────┐
│ NoneType: None                                                               │
└──────────────────────────────────────────────────────────────────────────────┘
Traceback (most recent call last):
  File "/home/aadm/.local/pipx/venvs/displaycal/lib/python3.9/site-packages/DisplayCAL/main.py", line 549, in main
    _main(module, name, applockfilename)
  File "/home/aadm/.local/pipx/venvs/displaycal/lib/python3.9/site-packages/DisplayCAL/main.py", line 485, in _main
    raise ResourceError(
DisplayCAL.debughelpers.ResourceError: resources.notfound.error
lang/en.yaml
┌──────────────────────────────────────────────────────────────────────────────┐
│ Traceback (most recent call last):                                           │
│   File                                                                       │
│ "/home/aadm/.local/pipx/venvs/displaycal/lib/python3.9/site-packages/DisplayCAL/main.py", │
│ line 549, in main                                                            │
│     _main(module, name, applockfilename)                                     │
│   File                                                                       │
│ "/home/aadm/.local/pipx/venvs/displaycal/lib/python3.9/site-packages/DisplayCAL/main.py", │
│ line 485, in _main                                                           │
│     raise ResourceError(                                                     │
│ DisplayCAL.debughelpers.ResourceError: resources.notfound.error              │
│ lang/en.yaml                                                                 │
└──────────────────────────────────────────────────────────────────────────────┘
Exiting displaycal
Ran application exit handlers