gforsyth / xonda

DEPRECATED: (previously a thin wrapper around conda for xonsh)
BSD 3-Clause "New" or "Revised" License
11 stars 9 forks source link

Deprecation Warnings and missing env name in prompt #44

Closed meatballs closed 5 years ago

meatballs commented 5 years ago

I've upgraded everything I can think of but I still get some deprecation warnings the first time I attempt to activate an environment:

$ conda activate testenv
/Users/owen/miniconda3/lib/python3.7/site-packages/conda/common/compat.py:91: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Iterable
/Users/owen/miniconda3/lib/python3.7/site-packages/conda/_vendor/auxlib/_vendor/five.py:49: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  from imp import reload                  # noqa
/Users/owen/miniconda3/lib/python3.7/site-packages/socks.py:58: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Callable
WARNING: The conda.install module is deprecated and will be removed in a future release.

and nothing in my prompt where {env_name} is used.

If I deactivate and activate again, the warnings no longer appear, but I still don't see the env name in the prompt.

Here's my xonfig:

+------------------+-----------------+
| xonsh            | 0.8.10          |
| Python           | 3.7.1           |
| PLY              | 3.11            |
| have readline    | True            |
| prompt toolkit   | 2.0.9           |
| shell type       | prompt_toolkit2 |
| pygments         | 2.3.1           |
| on posix         | True            |
| on linux         | False           |
| on darwin        | True            |
| on windows       | False           |
| on cygwin        | False           |
| on msys2         | False           |
| is superuser     | False           |
| default encoding | utf-8           |
| xonsh encoding   | utf-8           |
| encoding errors  | surrogateescape |
+------------------+-----------------+
gforsyth commented 5 years ago

Hey @meatballs -- sorry for the pain. My base python is still 3.6 and I think that's why I'm not seeing some of those errors.

You can silence the DeprecationWarnings using

import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)

In your xonshrc if upgrading packages doesn't work. I'll try to take a look tomorrow at what's causing the error with env_name.

The warning message from conda is probably here to stay for now. Need to take some time to fix their xonsh support...

meatballs commented 5 years ago

No need to apologise for anything at all!

It's definitely a 3.7 issue. I had no problem on 3.6.

gforsyth commented 5 years ago

I have a fix incoming for the unsilenceable warnings -- the missing {env_name} is actually a xonsh + py37 issue that I've reported as xonsh/xonsh#3029

gforsyth commented 5 years ago

Hey @meatballs -- want to try out the fix in #45 and see if it helps?

meatballs commented 5 years ago

Yep - that's got rid of the conda.install deprecation warning for me!

gforsyth commented 5 years ago

Awesome, I'll go ahead and merge that in. Also, the missing env-name has been fixed on xonsh master if you want to pull that down

meatballs commented 5 years ago

Env name all sorted - and now released!!

This one's probably done as much as it can be for now.