Pyramid: pkg_resources.DistributionNotFound: <projectname>

When trying to start the built-in WSGI server in Pyramid after starting a new project, pserve refused to do anything useful with my project. Turns out I had forgot to run setup.py in my projects virtual environment to set up all the dependencies:

From my projects folder:

    ../bin/python setup.py develop

.. of course, you’ll remember this if you read the README.txt that the pyramid setup creates for you in your project directory.

PHP and Annotations

After hacking together some code to solve an issue that came up on an IRC channel I’m up today about how to provide a URL mapping for individual methods — and keeping the responsibility in the method itself, I stumbled across addendum. Addendum implements annotations parsing for PHP and works by using the reflection API in PHP 5.1+. This allows you to add annotations which indicate to your framework which methods should be exposed to the web and which should be kept private. There are loads of other ways to do this (both dynamically and statically), but this is one way that may appeal to someone.