Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup.py missing test_suite support #11

Open
eighthave opened this issue Oct 19, 2012 · 5 comments
Open

setup.py missing test_suite support #11

eighthave opened this issue Oct 19, 2012 · 5 comments

Comments

@eighthave
Copy link

The setup.py file does not include the test script. That is the standard interface for running the tests, and means that things that wrap setup.py will automatically run the tests. Such things include Debian packaging, pip, etc.

This patch adds test support while maintaining distutils compatibility:

diff --git a/setup.py b/setup.py
index 4bbca27..fc7eed2 100644
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,7 @@
-from distutils.core import setup
+try:
+    from setuptools import setup
+except ImportError:
+    from distutils.core import setup

 from pgpdump import __version__, __author__

@@ -21,5 +24,6 @@ setup(
     url = 'https://github.com/toofishes/python-pgpdump',
     keywords = 'pgp gpg rfc2440 rfc4880 crypto cryptography',
     classifiers = classifiers,
-    packages = ['pgpdump']
+    packages = ['pgpdump'],
+    test_suite='pgpdump.test'
 )
@toofishes
Copy link
Owner

How do most other packages handle this? This warning is rather annoying:

$ python2 setup.py check
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'test_suite'
  warnings.warn(msg)

@eighthave
Copy link
Author

I haven't found a very clear standard in the way that people are incorporating tests. There is a pure distutils approach that I've seen, but it looked a lot more complicated. So I've used this approach. Having setuptools installed makes the warning go away.

@abeluck
Copy link
Contributor

abeluck commented Oct 23, 2012

Fyi, @eighthave is creating a python-pgpdump package in Debian, hence this ;)

@eighthave
Copy link
Author

its done and already in Debian: http://packages.qa.debian.org/p/python-pgpdump.html :-D

@dkg
Copy link

dkg commented Sep 15, 2019

I'd like this to be merged as well, or at least something comparable to make it straightforward to run the tests in a standard way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants