Browse Source

[setup] Data is included differently depending on platform

We cannot manage to make `hgtools` work on windows. So it's the default,
excepted on windows where we use and alternate method.
pull/168/head
Louis 9 years ago
parent
commit
99957c20d3
  1. 17
      setup.py

17
setup.py

@ -4,13 +4,25 @@
$ python setup.py install $ python setup.py install
""" """
from patacrep import __version__, __DATADIR__, files from patacrep import __version__
from setuptools import setup, find_packages from setuptools import setup, find_packages
import sys
setup_kwargs = {
'setup_requires': [],
}
if sys.platform[0:3] == 'win':
from patacrep import __DATADIR__, files
# List the data files # List the data files
data_files = files.recursive_find(__DATADIR__) data_files = files.recursive_find(__DATADIR__)
data_files = ["data/" + d for d in data_files] data_files = ["data/" + d for d in data_files]
setup_kwargs['package_data'] = {'patacrep': data_files}
else:
setup_kwargs['setup_requires'].append('hgtools')
setup_kwargs['include_package_data'] = True
setup( setup(
name='patacrep', name='patacrep',
@ -24,8 +36,6 @@ setup(
install_requires=[ install_requires=[
"unidecode", "jinja2", "ply", "unidecode", "jinja2", "ply",
], ],
setup_requires=["hgtools"],
package_data={'patacrep': data_files},
entry_points={ entry_points={
'console_scripts': [ 'console_scripts': [
"songbook = patacrep.songbook.__main__:main", "songbook = patacrep.songbook.__main__:main",
@ -45,4 +55,5 @@ setup(
platforms=["GNU/Linux", "Windows", "MacOsX"], platforms=["GNU/Linux", "Windows", "MacOsX"],
test_suite="test.suite", test_suite="test.suite",
long_description = open("README.rst", "r").read(), long_description = open("README.rst", "r").read(),
**setup_kwargs
) )

Loading…
Cancel
Save