summaryrefslogtreecommitdiff
blob: c7e2c08a7c6e4a51b6faaaa6c6f6233415df309b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
From 9bc3865d8c86392ca115ffb64a9389e92e00e861 Mon Sep 17 00:00:00 2001
From: Jonas Haag <jonas@lophus.org>
Date: Tue, 29 Dec 2015 14:14:49 +0100
Subject: [PATCH 1/3] Add setup.py

---
 acme_tiny.py          |  2 +-
 setup.py              | 28 ++++++++++++++++++++++++++++
 tests/__init__.py     |  1 +
 tests/test_install.py | 24 ++++++++++++++++++++++++
 4 files changed, 54 insertions(+), 1 deletion(-)
 create mode 100644 setup.py
 create mode 100644 tests/test_install.py

diff --git a/acme_tiny.py b/acme_tiny.py
index f54db0c..ca9ad3d 100644
--- a/acme_tiny.py
+++ b/acme_tiny.py
@@ -165,7 +165,7 @@ def _send_signed_request(url, payload):
     return """-----BEGIN CERTIFICATE-----\n{0}\n-----END CERTIFICATE-----\n""".format(
         "\n".join(textwrap.wrap(base64.b64encode(result).decode('utf8'), 64)))
 
-def main(argv):
+def main(argv=None):
     parser = argparse.ArgumentParser(
         formatter_class=argparse.RawDescriptionHelpFormatter,
         description=textwrap.dedent("""\
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..9ed597e
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,28 @@
+from setuptools import setup
+
+setup(
+    name="acme-tiny",
+    version="1.0.0",
+    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',
+    ]},
+    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',
+    ]
+)
diff --git a/tests/__init__.py b/tests/__init__.py
index ce89619..5ade34c 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -1 +1,2 @@
 from .test_module import TestModule
+from .test_install import TestInstall
diff --git a/tests/test_install.py b/tests/test_install.py
new file mode 100644
index 0000000..005f36c
--- /dev/null
+++ b/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"])

From cdf1bde83d6b640a8896722557386b6d9b6a9fbb Mon Sep 17 00:00:00 2001
From: Rob Speed <speed.rob@gmail.com>
Date: Wed, 10 Feb 2016 21:53:24 -0500
Subject: [PATCH 2/3] Added setuptools_scm for automatic versioning based on
 tags.

---
 setup.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index 9ed597e..7ec7ef1 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@
 
 setup(
     name="acme-tiny",
-    version="1.0.0",
+    use_scm_version=True,
     url="https://github.com/diafygi/acme-tiny",
     author="Daniel Roesler",
     author_email="diafygi@gmail.com",
@@ -12,6 +12,7 @@
     entry_points={'console_scripts': [
         'acme-tiny = acme_tiny:main',
     ]},
+    setup_requires=['setuptools_scm'],
     classifiers = [
         'Development Status :: 5 - Production/Stable',
         'Intended Audience :: System Administrators'

From edcaee1fa841d49a3fa488288faa8e6573269413 Mon Sep 17 00:00:00 2001
From: Matthias Bach <marix@marix.org>
Date: Mon, 22 Feb 2016 22:53:06 +0100
Subject: [PATCH 3/3] Mark wheels of acme-tiny as universal

Ensure that wheels created from the acme-tiny source are marked as universal.
---
 setup.cfg | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 setup.cfg

diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..434559d
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,2 @@
+[wheel]
+universal=True