|
29 | 29 | # POSSIBILITY OF SUCH DAMAGE.
|
30 | 30 |
|
31 | 31 | import re
|
32 |
| -from distutils.core import Extension, setup |
| 32 | +from setuptools import Extension, setup |
33 | 33 |
|
34 | 34 | CLASSIFIERS = [
|
35 | 35 | "Development Status :: 5 - Production/Stable",
|
|
56 | 56 | ]
|
57 | 57 | KEYWORDS = "c calculation computation extension primecount primes"
|
58 | 58 | GITHUB_REPOSITORY = "https://github.com/hearot/primecount/blob/v%s/"
|
| 59 | +GITHUB_URL = "https://github.com/hearot/primecount" |
59 | 60 | LICENSE = "BSD2"
|
60 | 61 | PACKAGE_NAME = "primecount"
|
61 | 62 | SOURCE_FILE = "primecount.c"
|
|
80 | 81 | long_description = f.read().replace("./", GITHUB_REPOSITORY % version)
|
81 | 82 |
|
82 | 83 |
|
83 |
| -setup( |
84 |
| - author=author, |
85 |
| - author_email=author_email, |
86 |
| - classifiers=CLASSIFIERS, |
87 |
| - description=description, |
88 |
| - ext_modules=[primecount_module], |
89 |
| - keywords=KEYWORDS, |
90 |
| - license="BSD2", |
91 |
| - long_description=long_description, |
92 |
| - long_description_content_type="text/markdown", |
93 |
| - name=PACKAGE_NAME, |
94 |
| - project_urls={ |
95 |
| - "Tracker": "https://github.com/hearot/primecount/issues", |
96 |
| - "Source": "https://github.com/hearot/primecount", |
97 |
| - }, |
98 |
| - python_requires=">=3.6.*", |
99 |
| - url=url, |
100 |
| - version=version, |
101 |
| -) |
| 84 | +try: |
| 85 | + setup( |
| 86 | + author=author, |
| 87 | + author_email=author_email, |
| 88 | + classifiers=CLASSIFIERS, |
| 89 | + description=description, |
| 90 | + ext_modules=[primecount_module], |
| 91 | + keywords=KEYWORDS, |
| 92 | + license="BSD2", |
| 93 | + long_description=long_description, |
| 94 | + long_description_content_type="text/markdown", |
| 95 | + name=PACKAGE_NAME, |
| 96 | + project_urls={ |
| 97 | + "Tracker": GITHUB_URL + "/issues", |
| 98 | + "Source": GITHUB_URL, |
| 99 | + }, |
| 100 | + python_requires=">=3.6.*", |
| 101 | + url=url, |
| 102 | + version=version, |
| 103 | + ) |
| 104 | +except SystemExit: |
| 105 | + print( |
| 106 | + "\nIt seems the installation didn't end well.\n" |
| 107 | + "Have you installed primecount as library?\n" |
| 108 | + f"Follow the guide on {GITHUB_URL}." |
| 109 | + ) |
0 commit comments