Browse Source

fix for setup.py leaving version number around

adam j hartz 3 months ago
parent
commit
08e5d3260e
1 changed files with 42 additions and 37 deletions
  1. 42
    37
      setup.py

+ 42
- 37
setup.py View File

@@ -98,43 +98,48 @@ def main():
98 98
     with open(os.path.join(os.path.dirname(__file__), "README.md"), "r") as f:
99 99
         readme = f.read()
100 100
 
101
-    dirty_version()
102
-
103
-    setup(
104
-        name="catsoop",
105
-        version=CS_VERSION,
106
-        author="CAT-SOOP Contributors",
107
-        author_email="catsoop-dev@mit.edu",
108
-        packages=["catsoop", "catsoop.test", "catsoop.thirdparty", "catsoop.scripts"],
109
-        scripts=[],
110
-        url="https://catsoop.mit.edu",
111
-        license="AGPLv3+",
112
-        description="CAT-SOOP is a tool for automatic collection and assessment of online exercises.",
113
-        long_description=readme,
114
-        long_description_content_type="text/markdown",
115
-        include_package_data=True,
116
-        entry_points={
117
-            "console_scripts": ["catsoop = catsoop.main:command_line_interface"]
118
-        },
119
-        install_requires=requirements,
120
-        package_dir={"catsoop": "catsoop"},
121
-        package_data={"catsoop": ["scripts/*"]},
122
-        test_suite="catsoop.test",
123
-        classifiers=[
124
-            "Development Status :: 4 - Beta",
125
-            "Intended Audience :: Education",
126
-            "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
127
-            "Programming Language :: Python :: 3.5",
128
-            "Programming Language :: Python :: 3.6",
129
-            "Programming Language :: Python :: 3.7",
130
-            "Topic :: Education",
131
-            "Topic :: Internet :: WWW/HTTP :: WSGI",
132
-        ],
133
-    )
134
-
135
-    if ORIGINAL_VERSION is not None:
136
-        with open(VERSION_FNAME, "w") as f:
137
-            f.write(ORIGINAL_VERSION)
101
+    try:
102
+        dirty_version()
103
+        setup(
104
+            name="catsoop",
105
+            version=CS_VERSION,
106
+            author="CAT-SOOP Contributors",
107
+            author_email="catsoop-dev@mit.edu",
108
+            packages=[
109
+                "catsoop",
110
+                "catsoop.test",
111
+                "catsoop.thirdparty",
112
+                "catsoop.scripts",
113
+            ],
114
+            scripts=[],
115
+            url="https://catsoop.mit.edu",
116
+            license="AGPLv3+",
117
+            description="CAT-SOOP is a tool for automatic collection and assessment of online exercises.",
118
+            long_description=readme,
119
+            long_description_content_type="text/markdown",
120
+            include_package_data=True,
121
+            entry_points={
122
+                "console_scripts": ["catsoop = catsoop.main:command_line_interface"]
123
+            },
124
+            install_requires=requirements,
125
+            package_dir={"catsoop": "catsoop"},
126
+            package_data={"catsoop": ["scripts/*"]},
127
+            test_suite="catsoop.test",
128
+            classifiers=[
129
+                "Development Status :: 4 - Beta",
130
+                "Intended Audience :: Education",
131
+                "License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
132
+                "Programming Language :: Python :: 3.5",
133
+                "Programming Language :: Python :: 3.6",
134
+                "Programming Language :: Python :: 3.7",
135
+                "Topic :: Education",
136
+                "Topic :: Internet :: WWW/HTTP :: WSGI",
137
+            ],
138
+        )
139
+    finally:
140
+        if ORIGINAL_VERSION is not None:
141
+            with open(VERSION_FNAME, "w") as f:
142
+                f.write(ORIGINAL_VERSION)
138 143
 
139 144
 
140 145
 if __name__ == "__main__":

Loading…
Cancel
Save