Skip to content

Commit

Permalink
Update setup.py for Python 3
Browse files Browse the repository at this point in the history
Apparently you can no longer install arbitrary binaries using
`scripts`. Instead you need to use `data_files` now.

Discussion of error in Python 3 when trying to use `scripts` to
install binaries here:
pypa/setuptools#210. Basically, you get an
error about a failed parse when setup tools tries to rad the binary as
a Python or #! script :P
  • Loading branch information
ntc2 committed Dec 24, 2018
1 parent 4cb62e3 commit f503dd5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions download-xflux.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def download_xflux():
tarchive = "/tmp/xflux.tgz"
subprocess.call(['wget', url, '-O', tarchive])
subprocess.call(['tar', '-xvf', tarchive])
subprocess.call(['chmod', 'a+x', 'xflux*'])

if __name__ == '__main__':
download_xflux()
5 changes: 3 additions & 2 deletions setup.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@
('share/applications', ['desktop/fluxgui.desktop'])]

scripts = ['fluxgui']

if (os.path.exists("xflux")):
scripts.append('xflux')
data_files.append(('bin', ['xflux']))
else:
print("""WARNING: if you are running 'python setup.py' manually, and not as
part of Debian package creation, then you need to download the 'xflux'
binary separately. You can do this by running
python ./download-xflux.py
./download-xflux.py
before running 'setup.py'.""")

Expand Down

0 comments on commit f503dd5

Please sign in to comment.