Pylons / pastedeploy

provides code to load WSGI applications and servers from URIs
MIT License
23 stars 14 forks source link

Make 'python setup.py test' work #5

Closed cdent closed 5 years ago

cdent commented 5 years ago

Packagers sometimes like to use 'python setup.py test'. This change adjusts setup.py and setup.cfg to allow this to work with pytest instead of nose. To make things work, the settings for coverage need to be moved into tox.ini.

A SkipTest in test_config_middleware is changed to its pytest equivalent.

mmerickel commented 5 years ago

I'll note that Pyramid and most other projects I maintain don't support setup.py test any longer. The expectation there is that tests should be run through tox. Even with the alias, setuptools is still going to install the dependencies instead of pip which is a huge source of pain.

cdent commented 5 years ago

I don't mind if we don't do this, but what was there (using nose) was broken, so I figured it should at least be fixed. If we remove it that's cool, but we shouldn't leave it broken.

I did this because within hours of me adopting paste, someone came along and requested it because of packaging issues, but definitely not something I'm to which I'm wed or really care that much about. Habit, basically.

cdent commented 5 years ago

Also, not that I would object to anyone else doing more, my intention with pastedeploy and paste is to change it as little as possible. Simply keep it on life support. Neither are really things that are the best choice for their use cases, any more.

mmerickel commented 5 years ago

Are you aware of a better option than pastedeploy for configuring a wsgi app? Pyramid still uses it quite heavily.

cdent commented 5 years ago

By configuring do you mean assembling the list of optional middlewares and apps using an external config file, like paste.ini, or something else?

In my experience making the WSGI stack configurable in the first place, or separate from the rest of the app's configuration leads to challenges especially if one is hoping for consistent behaviour between different instances of the same app.

If one need a file for configuring the app, in the way that paste.ini files allow, then yes, pastedeploy is the way, but I'm not sure it is the ideal way of doing things, now.

mmerickel commented 5 years ago

I don't mind if we don't do this, but what was there (using nose) was broken, so I figured it should at least be fixed. If we remove it that's cool, but we shouldn't leave it broken.

Ok, well the main thing I'd suggest is to avoid documenting that setup.py test is the way to run the tests. It looks like the tox.ini is using usedevelop = True which should also be removed.

cdent commented 5 years ago

It looks like the tox.ini is using usedevelop = True which should also be removed.

That went in when I tuned up the tox.ini to get travis working, it's another habitual thing, but probably bad. If you'd like to remove it, go for it. After this brief flurry of activity I now need to get back to that thing I was working on last night, which I thought I had working but apparently that was all lies.