-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot print or log warning message in installation step #2933
Comments
I need the same thing. Found any way to do it ? |
This is not really possible to do without hard failing on install. We purposely remove output because in the 95% case, the output is nothing but confusing to end users. In additional we aggressively try to build wheels once and then reuse those, and in this case those rebuilt wheels won't execute the |
Just FYI, I found a solution who can do that. But user should add
from setuptools import setup
from setuptools.command.install import install
import os
class PostInstallCommand(install):
"""Post-installation for installation mode."""
def run(self):
install.run(self)
os.system("cat testing.egg-info/PKG-INFO")
setup(name='testing',
version='0.1',
description='The simplest setup in the world',
classifiers=[
'Development Status :: 3 - Alpha',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.0',
],
keywords='setup',
author='someone',
author_email='[email protected]',
license='MIT',
packages=['test'],
entry_points={
},
cmdclass={
'install': PostInstallCommand,
},
zip_safe=False) See https://stackoverflow.com/questions/38933402/python-setup-py-how-to-show-message-after-install |
I need to (always) show a message to the user upon installation of a package. In pip 6, it seemed OK; I would print to stderr. In pip 7 (7.0.3), I can't figure out any way to do it.
Things I have tried:
(1) Variations on overriding
setuptools.command.install
ordistutils.command.install
For example ...
That works OK with
python setup.py install
and IIRC, it worked with pip 6 (as long as you're printing to stderr).(2) Using the
logger
from theinstall
command file, and logging at WARNING or ERROR level (source code)And that displays warnings in several ways if run with pip 6, but pip 7 swallows it all.
Is there a supported way to print/log messages to stderr or stdout, during
install
?The text was updated successfully, but these errors were encountered: