Include icons in package data

This commit is contained in:
Sumner Evans
2020-06-01 09:56:13 -06:00
parent ca565cf719
commit da694387df

View File

@@ -1,20 +1,26 @@
import codecs
import os
from pathlib import Path
from setuptools import find_packages, setup
here = os.path.abspath(os.path.dirname(__file__))
here = Path(__file__).parent.resolve()
with codecs.open(os.path.join(here, "README.rst"), encoding="utf-8") as f:
with open(here.joinpath("README.rst"), encoding="utf-8") as f:
long_description = f.read()
# Find the version
with codecs.open(os.path.join(here, "sublime/__init__.py"), encoding="utf-8") as f:
with open(here.joinpath("sublime", "__init__.py")) as f:
for line in f:
if line.startswith("__version__"):
version = eval(line.split()[-1])
break
icons_dir = here.joinpath("sublime", "ui", "icons")
icon_filenames = []
for icon in icons_dir.iterdir():
if not str(icon).endswith(".svg"):
continue
icon_filenames.append(str(icon))
setup(
name="sublime-music",
version=version,
@@ -49,6 +55,7 @@ setup(
"dbus/mpris_specs/org.mpris.MediaPlayer2.Player.xml",
"dbus/mpris_specs/org.mpris.MediaPlayer2.Playlists.xml",
"dbus/mpris_specs/org.mpris.MediaPlayer2.TrackList.xml",
*icon_filenames,
]
},
install_requires=[