Browse Source

Prevent 'files' import (fails windows build)

pull/231/head
Oliverpool 9 years ago
parent
commit
5a9c48e551
  1. 20
      setup.py

20
setup.py

@ -14,10 +14,26 @@ setup_kwargs = {
} }
if sys.platform[0:3] == 'win': if sys.platform[0:3] == 'win':
from patacrep import __DATADIR__, files from patacrep import __DATADIR__
def recursive_find(root_directory):
"""Recursively find files from a root_directory.
Return a list of files matching those conditions.
Arguments:
- `root_directory`: root directory of the search.
"""
if not os.path.isdir(root_directory):
return
with chdir(root_directory):
for root, __ignored, filenames in os.walk(os.curdir):
for filename in filenames:
yield os.path.join(root, filename)
# List the data files # List the data files
data_files = files.recursive_find(__DATADIR__) data_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} setup_kwargs['package_data'] = {'patacrep': data_files}
else: else:

Loading…
Cancel
Save