KBNLresearch / iromlab

Loader software for automated imaging of optical media with Nimbie disc robot
Apache License 2.0
31 stars 5 forks source link

Add installer script, pip install #18

Closed bitsgalore closed 7 years ago

bitsgalore commented 7 years ago

Main challenge here is how to handle config.xml. It looks like by default resource in data_files are installed inside the egg file on the target system, not in the actual directory! See:

http://peak.telecommunity.com/DevCenter/setuptools#non-package-data-files

Some additional suggestions here:

http://stackoverflow.com/questions/7567642/where-to-put-a-configuration-file-in-python

Best installation location (Windows) is probably somewhere in user's home dir, which can be accessed using:

os.path.expanduser('~')

(e.g. C:\Users\johan)

bitsgalore commented 7 years ago

UPDATE: as of https://github.com/KBNLresearch/iromlab/commit/2f6ef601f68da4e3a7d773814b9d296a14f7814f config installation now works from dev location, but when installing with setup.py resource_filename(Requirement.parse('iromlab'),'conf/config.xml') returns C:\Python27\Scripts\conf\config.xml, which does not exist!

bitsgalore commented 7 years ago

Done: https://github.com/KBNLresearch/iromlab/commit/47eecd7baa743067c9db72cac94a6da606fc930c, inexplicably fails when setup.py is used without pip b/c egg file is not unpacked in that case. So better use pip.