Kitware / tangelo

A simple, quick, powerful web framework
http:/tangelohub.org/tangelo/
Apache License 2.0
185 stars 35 forks source link

Merge plugin configuration into Tangelo configuration #488

Closed waxlamp closed 9 years ago

waxlamp commented 9 years ago

This unifies plugin and main Tangelo configuration strategies into one, making configuration simpler and reducing code complexity. This also reflects the vision of Tangelo as a unified web application server (addressing in part, #462).

Closes #482.

Closes #481 - omitting the plugin configuration causes no plugins to be loaded

Closes #485 - necessary plugins are specified inline when running in example mode (also, a custom configuration file has been added, allowing the testing infrastructure to launch Tangelo with some plugins in order to test them)

Closes #492 - the package data changes require a newer virtualenv

Closes #490.

Closes #368 - This was a good time to put in docs about making a copy of the examples for personal experimentation.

waxlamp commented 9 years ago

I am investigating the Travis failure... :neckbeard:

waxlamp commented 9 years ago

Ok... Travis was failing because it is yet another example of a "non-standard" Python installation. (I put that in quotes because it appears there truly is no de factor standard way for Python to behave).

After merging the config strategies and eliminating the one-off plugin configuration file that used to serve to load the bundled plugins, I noticed that Tangelo could no longer find the plugins directory when trying to run tests on Travis, using what I thought was a pretty foolproof method of searching them out. When Tangelo works on Arch Linux, Homebrew, Windows, and OS X, but not on Travis running Ubuntu, I consider that the last straw for the old way of doing things.

The solution is to make the bundled plugins, along with the example web materials, into package data rather than data files. Unfortunately, the documentation on the differences between these is pretty sparse, and lives mainly in bug reports on GitHub and upvoted answers on StackOverflow. For Tangelo, it meant first upgrading from distutils to setuptools, changing the abstractions for finding the web and plugin materials, and finally choosing a scheme for versioning the packages built from GitHub sources (see the line note in 4579f13).

Since the web and plugin materials are now "hidden" inside the Tangelo package itself, we may want to add a command line utility to spits out the directory where these things now live. It should be relatively simple to do, and I will open an issue about it.

These are relatively big changes but as far as I can tell they haven't actually changed the external interface to Tangelo at all. Let me know if you see any problems in this changeset, and I then I will go ahead and merge.

jeffbaumes commented 9 years ago

I get this error when performing grunt on my mac. Looks like an extra 0 in the filename? And it is -dev on disk but is looking for .dev.

Running "install" task
Requirement 'sdist/tangelo-0.8.1.dev0.tar.gz' looks like a filename, but the file does not exist
Unpacking ./sdist/tangelo-0.8.1.dev0.tar.gz
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/code/tangelo/venv/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/code/tangelo/venv/lib/python2.7/site-packages/pip/commands/install.py", line 274, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/code/tangelo/venv/lib/python2.7/site-packages/pip/req.py", line 1173, in prepare_files
    self.unpack_url(url, location, self.is_download)
  File "/code/tangelo/venv/lib/python2.7/site-packages/pip/req.py", line 1316, in unpack_url
    return unpack_file_url(link, loc)
  File "/code/tangelo/venv/lib/python2.7/site-packages/pip/download.py", line 356, in unpack_file_url
    unpack_file(source, location, content_type, link)
  File "/code/tangelo/venv/lib/python2.7/site-packages/pip/util.py", line 623, in unpack_file
    or tarfile.is_tarfile(filename)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 2585, in is_tarfile
    t = open(name)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 1660, in open
    return func(name, "r", fileobj, **kwargs)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tarfile.py", line 1722, in gzopen
    fileobj = bltn_open(name, mode + "b")
IOError: [Errno 2] No such file or directory: '/code/tangelo/sdist/tangelo-0.8.1.dev0.tar.gz'

Storing debug log for failure in /Users/jeff/.pip/pip.log
Warning: Could not install Tangelo to virtual environment:
 Use --force to continue.

Aborted due to warnings.
jeff@firebrick:/code/tangelo (merge-configs) $ ls sdist/
tangelo-0.8.0-dev.tar.gz tangelo-0.8.0.tar.gz     tangelo-0.8.1-dev.tar.gz
waxlamp commented 9 years ago

I believe this happens with older versions of setuptools, which come from older versions of virtualenv. We should probably put a requirement notice in for a recent version of virtualenv.

jeffbaumes commented 9 years ago

LGTM other than a few doc issues.