1. Ian Bicking
  2. PasteScript

Pull requests

#12 Merged

Add tox.ini

  1. Marc Abramowitz
marca@marca-mac:~/dev/hg-repos/pastescript$ tox
  py26: commands succeeded
  py27: commands succeeded
ERROR:   py32: commands failed
ERROR:   py33: commands failed
  pypy: commands succeeded
  • Learn about pull requests

Comments (15)

  1. Marc Abramowitz author

    Cheetah is an old template system that hasn't been active in years. It doesn't work on Python 3. Cheetah is an optional dependency; it's for some templating feature of PasteScript that I've never used.

    I actually started on porting it to Python 3 but only got partially done and then people started suggesting that I should not bother.

    1. Marc Abramowitz author

      I agree. I have never used Cheetah myself. I am most familiar with Jinja2. Mako is another popular choice.

      I'd probably start with Jinja2 if I cared about whatever feature of PasteScript is using templates - maybe it's the project scaffold system which I rarely use because if I need a scaffold I tend to look to cookiecutter, which is more modern and actively maintained than Paste.

      Paste is an old project and it was very ambitious so I think it has a lot of features that most people don't use.

      The main feature of PasteScript that I think a lot of people use are the ability to do paster serve to serve a web app from an ini file. Even that isn't so important anymore because in Pyramid at least, they long ago added their own pserve command that does the job of paster serve but is Python 3 compatible. Pyramid in general works well in Python 3.

      1. Marc Abramowitz author

        Ah, here's the docs on the templating feature which indeed can optionally use cheetah.


        I feel like PasteScript templates were in vogue a few years ago, but not so much anymore though maybe that's just me.

        I remember when I first encountered the whole Paste system that it was very confusing because it does so many things. It's an ini file format. It's a way to compose WSGI apps with filters and composites and stuff. It's a web server. It's a command to launch your web server. It's a way to create new projects from scaffolds. That last one is the strangest to me as it seems most different from the others.

        Probably the factor that it can use only string.Template or Cheetah makes it not so appealing anymore. So there have been a bunch of others since like Templar, cookiecutter, etc.

        I guess I wouldn't worry too much about Cheetah or templating in Python 3.

        1. Victor Stinner

          I guess I wouldn't worry too much about Cheetah or templating in Python 3.

          I don't like having a feature only available on Python 2. You should at least deprecate the feature, as done for modules removed in Python 3 standard library. Example of such warning: https://docs.python.org/2/library/mimetools.html

          It's ok to keep the code forever if it has a deprecation warning somewhere (at least in the doc, or better with a warning at runtime).

  2. Marc Abramowitz author

    Victor Stinner: What motivated you to port Paste and PasteScript to Python 3? I'm wondering if OpenStack or some other project that you're interested in depends on these? I'm just curious what features are important to you and others. Because there may also be other projects that fit your needs. For example, people used to use paster serve (which comes from PasteScript) with Pyramid apps but because they wanted Pyramid to support Python 3 and PasteScript showed no signs of supporting that, the Pyramid folks created their own pserve command:


    Likewise, they replaced paster create with pcreate:


    So Pyramid projects don't really need PasteScript these days.

    Maybe if there are non-Pyramid projects that need this too, pserve could be extracted out of Pyramid into a separate package.

    Or for PasteDeploy stuff (starting up apps from ini files), there is Montague, though I don't know if that's production-ready. Last I looked, inklesspen was still heavily developing and refactoring and it wasn't quite ready to be used, but that was a while ago and it may very well be much more mature now.

  3. Marc Abramowitz author

    BTW, here is the templating/scaffolding feature in action, so it's clear what we're talking about when we're talking about Cheetah, which is used for templates/scaffolds:

    $ paster create --template=paste_deploy helloworld version=0.1 description="Dummy app" long_description="Just a test" keywords="" author="me" author_email="nobody@nowhere.com" url="http://localhost" license_name="Crap License" zip_safe=False
    Selected and implied templates:
      PasteScript#basic_package  A basic setuptools-enabled package
      PasteDeploy#paste_deploy   A web application deployed through paste.deploy
      author:            me
      author_email:      nobody@nowhere.com
      description:       Dummy app
      egg:               helloworld
      license_name:      Crap License
      long_description:  Just a test
      package:           helloworld
      project:           helloworld
      url:               http://localhost
      version:           0.1
      zip_safe:          False
    Creating template basic_package
    Creating directory ./helloworld
      Recursing into +package+
        Creating ./helloworld/helloworld/
        Copying __init__.py to ./helloworld/helloworld/__init__.py
      Copying setup.cfg to ./helloworld/setup.cfg
      Copying setup.py_tmpl to ./helloworld/setup.py
    Creating template paste_deploy
      Recursing into +package+
        Copying sampleapp.py_tmpl to ./helloworld/helloworld/sampleapp.py
        Copying wsgiapp.py_tmpl to ./helloworld/helloworld/wsgiapp.py
      Recursing into docs
        Creating ./helloworld/docs/
        Copying devel_config.ini_tmpl to ./helloworld/docs/devel_config.ini
    Updating ./helloworld/setup.py
    Updating ./helloworld/setup.py
    ************************************************************************* Run "paster serve docs/devel_config.ini" to run the sample application* on http://localhost:8080************************************************************************Running /Users/marca/dev/hg-repos/pastescript/.tox/py27/bin/python setup.py egg_info
    Manually creating paster_plugins.txt (deprecated! pass a paster_plugins keyword to setup() instead)
    Adding PasteDeploy to paster_plugins.txt
    $ tree helloworld
    ├── docs
    │   └── devel_config.ini
    ├── helloworld
    │   ├── __init__.py
    │   ├── sampleapp.py
    │   └── wsgiapp.py
    ├── helloworld.egg-info
    │   ├── PKG-INFO
    │   ├── SOURCES.txt
    │   ├── dependency_links.txt
    │   ├── entry_points.txt
    │   ├── paster_plugins.txt
    │   ├── requires.txt
    │   ├── top_level.txt
    │   └── zip-safe
    ├── setup.cfg
    └── setup.py
    3 directories, 14 files
  4. Victor Stinner

    Victor Stinner: What motivated you to port Paste and PasteScript to Python 3? I'm wondering if OpenStack or some other project that you're interested in depends on these?

    I mostly see OpenStack as a blackbox when I'm working on porting it to Python 3. I just saw that many projects use Paste and PasteDeploy, so I ported Paste to Python 3. Since I don't know Paste, I don't know how hard it is to replace it with something else. I understood that OpenStack uses Paste to stack WSGI middlewares. Example with nova: https://github.com/openstack/nova/blob/master/etc/nova/api-paste.ini