Skip to content

shell: Hide early warnings from the import

Feedback from @holger.witsch

Warnings are often displayed on top of the BLISS session, before the logo. It is due to changes on external library which is often pointless for end users.

/nobackup/lvalls1/valls/Software/miniconda3/envs/blissenv/bin/python3.7 -m bliss.shell.cli.start_bliss_repl demo_session WARN material 1                                                                           [21/21]
valls@lvalls:~/workspace/bliss.git(early-warnings-integration-in-shell)$ /nobackup/lvalls1/valls/Software/miniconda3/envs/blissenv/bin/python3.7 -m bliss.shell.cli.start_bliss_repl demo_session WARN material 1         
/nobackup/lvalls1/valls/Software/miniconda3/envs/blissenv/lib/python3.7/site-packages/tango/utils.py:181: DeprecationWarning: `np.str` is a deprecated alias for the builtin `str`. To silence this warning, use `str` by 
itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.str_` here.                                                                                        
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations                                                                                                 
  CmdArgType.DevString: numpy.str,                                                                                                                                                                                        
/nobackup/lvalls1/valls/Software/miniconda3/envs/blissenv/lib/python3.7/site-packages/tango/gevent.py:36: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.                    
  if distutils.version.StrictVersion(gevent_version) < "1.0":                                                                                                                                                             
                       __         __   __                                                                                                                                                                                 
                      |__) |   | /__` /__`                                                                                                                                                                                
                      |__) |__ | .__/ .__/                                                                                                                                                                                
                                                                                                                                                                                                                          
                                                                                                                                                                                                                          
Welcome to BLISS version 1.9.0+399-g0f5dea1fb running on lvalls (in blissenv Conda environment)                                                                                                                           
Copyright (c) 2015-2022 Beamline Control Unit, ESRF                                                                                                                                                                       

This MR reworks the logging system to catch and filter early warnings displayed during the import of the application.

A single comment is displayed. Starting the session with --debug will display the warnings, as shown above.

Connected to Beacon server on lvalls (port /tmp/beacon_vg_ynski.sock)

During the import 2 warnings were ignored. Restart BLISS with --debug to display them.
demo_session: Loading config...

Merge request reports