Fixed some packaging issues.

master
Pacman Ghost 2 years ago
parent fc42e1ddc0
commit 403ef6cdc1
  1. 9
      MANIFEST.in
  2. 0
      asl_rulebook2/extract/__init__.py
  3. 1
      asl_rulebook2/webapp/data/doc
  4. 3
      asl_rulebook2/webapp/data/doc.txt
  5. 15
      asl_rulebook2/webapp/doc.py
  6. 2
      asl_rulebook2/webapp/run_server.py
  7. 3
      setup.py

@ -0,0 +1,9 @@
recursive-include asl_rulebook2/webapp/config *.*
recursive-include asl_rulebook2/webapp/data *.*
recursive-include asl_rulebook2/webapp/static *.*
recursive-include asl_rulebook2/webapp/templates *.*
recursive-include asl_rulebook2/extract/data *.*
recursive-include asl_rulebook2/webapp/tests/fixtures *.*
recursive-include asl_rulebook2/bin *.*

@ -0,0 +1,3 @@
The doc/ symlink is to allow documents in the root doc/ directory to be served, even if this package has been installed in non-editable mode (i.e. into site-packages).
See get_doc() for more details.

@ -16,10 +16,19 @@ def get_doc( path ):
"""Return the specified documentation file."""
# locate the documentation file
doc_dir = os.path.join( os.path.dirname( __file__ ), "../../doc/" )
fname = safe_join( doc_dir, path )
dname = os.path.join( os.path.dirname( __file__ ), "../../doc/" )
fname = safe_join( dname, path )
if not os.path.isfile( fname ):
abort( 404 )
# FUDGE! If this package has been installed in non-editable mode (i.e. into site-packages, while it's possible
# to get the root doc/ directory included in the installation (by adding a __init__.py file :-/, then including
# it in MANIFEST.in), it ends up in asl-rulebook2's parent directory (i.e. the main site-packages directory),
# which is definitely not what we want.
# We work-around this my creating a symlink to the doc/ directory, which will get followed when the package
# is installed. This won't work on Windows, but we'll do the necessary penance, and just live with it... :-/
dname = os.path.join( os.path.dirname( __file__ ), "data/doc/" )
fname = safe_join( dname, path )
if not os.path.isfile( fname ):
abort( 404 )
# check if the file is Markdown
if os.path.splitext( path )[1] == ".md":

@ -20,7 +20,7 @@ from asl_rulebook2.webapp import app, globvars
@click.option( "--force-init-delay", default=0, help="Force the webapp to initialize (#seconds delay)." )
@click.option( "--debug","flask_debug", is_flag=True, default=False, help="Run Flask in debug mode." )
def main( bind_addr, data_dir, force_init_delay, flask_debug ):
"""Run the webapp server."""
"""Run the asl-rulebook2 webapp server."""
# initialize
flask_port = None

@ -40,4 +40,7 @@ setup(
data_files = [
( "asl-rulebook2", ["LICENSE.txt"] ),
],
entry_points = {
"console_scripts": "asl-rulebook2 = asl_rulebook2.webapp.run_server:main",
}
)

Loading…
Cancel
Save