Skip to content

Commit 9d652cf

Browse files
committed
Disallow building cypari2 as egg
1 parent 2548a32 commit 9d652cf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

setup.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sys
22
from setuptools import setup
33
from distutils.command.build_ext import build_ext as _build_ext
4+
from setuptools.command.bdist_egg import bdist_egg as _bdist_egg
45
from setuptools.extension import Extension
56

67

@@ -38,6 +39,12 @@ def finalize_options(self):
3839
_build_ext.finalize_options(self)
3940

4041

42+
class no_egg(_bdist_egg):
43+
def run(self):
44+
from distutils.errors import DistutilsOptionError
45+
raise DistutilsOptionError("The package cypari2 will not function correctly when built as egg. Therefore, it cannot be installed using 'python setup.py install' or 'easy_install'. Instead, use 'pip install' to install cypari2.")
46+
47+
4148
setup(
4249
name='cypari2',
4350
version=open("VERSION").read().strip(),
@@ -51,5 +58,5 @@ def finalize_options(self):
5158
packages=['cypari2'],
5259
package_dir={'cypari2': 'cypari2'},
5360
package_data={'cypari2': ['declinl.pxi', '*.pxd', '*.h']},
54-
cmdclass=dict(build_ext=build_ext)
61+
cmdclass=dict(build_ext=build_ext, bdist_egg=no_egg)
5562
)

0 commit comments

Comments
 (0)