Browse Source

Merge branch 'setup_merge' into ACMEv2

Daniel Roesler 7 years ago
parent
commit
51ab579635
5 changed files with 58 additions and 1 deletions
  1. 1 1
      acme_tiny.py
  2. 2 0
      setup.cfg
  3. 30 0
      setup.py
  4. 1 0
      tests/__init__.py
  5. 24 0
      tests/test_install.py

+ 1 - 1
acme_tiny.py

@@ -160,7 +160,7 @@ def get_crt(account_key, csr, acme_dir, log=LOGGER, CA=DEFAULT_CA, disable_check
     log.info("Certificate signed!")
     log.info("Certificate signed!")
     return certificate_pem
     return certificate_pem
 
 
-def main(argv):
+def main(argv=None):
     parser = argparse.ArgumentParser(
     parser = argparse.ArgumentParser(
         formatter_class=argparse.RawDescriptionHelpFormatter,
         formatter_class=argparse.RawDescriptionHelpFormatter,
         description=textwrap.dedent("""\
         description=textwrap.dedent("""\

+ 2 - 0
setup.cfg

@@ -0,0 +1,2 @@
+[wheel]
+universal=True

+ 30 - 0
setup.py

@@ -0,0 +1,30 @@
+from setuptools import setup
+
+setup(
+    name="acme-tiny",
+    use_scm_version=True,
+    url="https://github.com/diafygi/acme-tiny",
+    author="Daniel Roesler",
+    author_email="diafygi@gmail.com",
+    description="A tiny script to issue and renew TLS certs from Let's Encrypt",
+    license="MIT",
+    py_modules=['acme_tiny'],
+    entry_points={'console_scripts': [
+        'acme-tiny = acme_tiny:main',
+    ]},
+    setup_requires=['setuptools_scm'],
+    classifiers = [
+        'Development Status :: 5 - Production/Stable',
+        'Intended Audience :: System Administrators',
+        'License :: OSI Approved :: MIT License',
+        'Operating System :: OS Independent',
+        'Programming Language :: Python',
+        'Programming Language :: Python :: 2',
+        'Programming Language :: Python :: 2.7',
+        'Programming Language :: Python :: 3',
+        'Programming Language :: Python :: 3.3',
+        'Programming Language :: Python :: 3.4',
+        'Programming Language :: Python :: 3.5',
+        'Programming Language :: Python :: 3.6',
+    ]
+)

+ 1 - 0
tests/__init__.py

@@ -1 +1,2 @@
 from .test_module import TestModule
 from .test_module import TestModule
+from .test_install import TestInstall

+ 24 - 0
tests/test_install.py

@@ -0,0 +1,24 @@
+import unittest
+import os
+import tempfile
+import shutil
+import subprocess
+
+
+class TestInstall(unittest.TestCase):
+    def setUp(self):
+        self.tempdir = tempfile.mkdtemp()
+        subprocess.check_call(["virtualenv", self.tempdir])
+
+    def tearDown(self):
+        shutil.rmtree(self.tempdir)
+
+    def virtualenv_bin(self, cmd):
+        return os.path.join(self.tempdir, "bin", cmd)
+
+    def test_install(self):
+        subprocess.check_call([self.virtualenv_bin("python"), "setup.py", "install"])
+
+    def test_cli(self):
+        self.test_install()
+        subprocess.check_call([self.virtualenv_bin("acme-tiny"), "-h"])