Skip to content

Commit

Permalink
Use a pattern for adding package data, fixes missing fixtures on pack…
Browse files Browse the repository at this point in the history
…ages
  • Loading branch information
ingenieroariel committed Aug 30, 2016
1 parent 3c111d2 commit aff43c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 42 deletions.
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
include README README.rst LICENSE
recursive-exclude ./geonode/static/.components
recursive-include geonode/static *
recursive-include geonode *.js *.css *.png *.eot *.woff *.tff *.svg *.html *.xml *.json

43 changes: 2 additions & 41 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,48 +20,10 @@

from distutils.core import setup
from distutils.command.install import INSTALL_SCHEMES
from setuptools import find_packages
import os


def fullsplit(path, result=None):
"""
Split a pathname into components (the opposite of os.path.join) in a
platform-neutral way.
"""
if result is None:
result = []
head, tail = os.path.split(path)
if head == '':
return [tail] + result
if head == path:
return result
return fullsplit(head, [tail] + result)

# Tell distutils not to put the data_files in platform-specific installation
# locations. See here for an explanation:
# http://groups.google.com/group/comp.lang.python/browse_thread/thread/35ec7b2fed36eaec/2105ee4d9e8042cb
for scheme in INSTALL_SCHEMES.values():
scheme['data'] = scheme['purelib']

# Compile the list of packages available, because distutils doesn't have
# an easy way to do this.
packages, data_files = [], []
root_dir = os.path.dirname(__file__)
if root_dir != '':
os.chdir(root_dir)
geonode_dir = 'geonode'

for dirpath, dirnames, filenames in os.walk(geonode_dir):
# Ignore dirnames that start with '.'
for i, dirname in enumerate(dirnames):
if dirname.startswith('.'):
del dirnames[i]
if '__init__.py' in filenames:
packages.append('.'.join(fullsplit(dirpath)))
elif filenames:
data_files.append([dirpath, [os.path.join(dirpath, f) for f in filenames]])


setup(name='GeoNode',
version=__import__('geonode').get_version(),
description="Application for serving and sharing geospatial data",
Expand All @@ -73,8 +35,7 @@ def fullsplit(path, result=None):
author_email='[email protected]',
url='http://geonode.org',
license='GPL',
packages=packages,
data_files=data_files,
packages=find_packages(),
include_package_data=True,
install_requires=[
# # The commented name next to the package
Expand Down

0 comments on commit aff43c0

Please sign in to comment.