Skip to content

Commit

Permalink
v1.1.2 Fix package data packaging. Closes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoCeratto committed Apr 14, 2014
1 parent c354090 commit 377bf7e
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 25 deletions.
5 changes: 3 additions & 2 deletions MANIFEST.in
@@ -1,6 +1,7 @@
# Used by setup.py sdist to include files in the source package
include tests/*.py
include setup.py
include README.md
include LICENSE
include views/*.tpl
include static/favicon.ico
#include views/*.tpl
#include static/favicon.ico
26 changes: 4 additions & 22 deletions setup.py
@@ -1,10 +1,8 @@
#!/usr/bin/env python

from glob import glob
from setuptools import setup
import os.path

__version__ = '0.1.1'
__version__ = '0.1.2'

CLASSIFIERS = map(str.strip,
"""Environment :: Console
Expand All @@ -16,21 +14,6 @@
Topic :: Internet :: WWW/HTTP :: WSGI
""".splitlines())

data_files_globs = [
['views', ['*.tpl']],
['static', ['*.ico']],
]


data_files = []
for dirname, globs in data_files_globs:
expanded_fnames = set()
for g in globs:
ffn = os.path.join(dirname, g)
expanded_fnames.update(glob(ffn))

data_files.append((dirname, sorted(expanded_fnames)))

entry_points = {
'console_scripts': [
'shoebill = shoebill:main',
Expand All @@ -57,13 +40,12 @@
'setproctitle>=1.0.1',
],
packages=['shoebill'],
data_files=data_files,
package_dir={'shoebill': 'shoebill'},
platforms=['Linux'],
zip_safe=False,
test_suite='nose.collector',
tests_require=['nose'],
entry_points=entry_points,

package_data = {'': ['*.tpl']},
include_package_data=True,
# Used by setup.py bdist to include files in the binary package
package_data={'shoebill': ['views/*.tpl', 'static/*']},
)
7 changes: 6 additions & 1 deletion shoebill/__init__.py
Expand Up @@ -20,6 +20,7 @@
from base64 import b64encode
from datetime import datetime
from git import Repo, InvalidGitRepositoryError
from pkg_resources import resource_filename
from setproctitle import setproctitle
import argparse
import bottle
Expand All @@ -33,6 +34,10 @@
app = bottle.app()
aaa = None

tpl_path = resource_filename('shoebill', 'views')
bottle.TEMPLATE_PATH.insert(0, tpl_path)
static_path = resource_filename('shoebill', 'static')

try:
from beaker.middleware import SessionMiddleware
from cork import Cork
Expand Down Expand Up @@ -386,7 +391,7 @@ def route_run_make_target(target):

@bottle.route('/favicon.ico')
def serve_favicon():
return bottle.static_file('favicon.ico', root='static/')
return bottle.static_file('favicon.ico', root=static_path)

# Admin-only pages

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 377bf7e

Please sign in to comment.