gforsyth / xonda

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

Tab completion gives Deprecation Warning #43

Closed wedyat closed 5 years ago

wedyat commented 5 years ago

Every first time after opening a new terminal, when I type "conda activate" then first letter of environment's name and press tab (or just run whole "conda activate "), I get the Deprecation Warning below. Seems to be just an import issue. Everything else seems to work fine. I'm using Arch linux (python 3.7.2, xonsh 0.8.8, xonda 0.8.0, python-conda 4.5.11). At the same time while running "source activate " from bash, I get no warning, which makes it look like a xonsh- or xonda-related problem

DeprecationWarning: usr/lib/python3.7/site-packages/conda/common/compat.py:86: 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 /usr/lib/python3.7/site-packages/conda/_vendor/auxlib/collection.py:5: 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 Mapping, Set /usr/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 /usr/lib/python3.7/site-packages/conda/_vendor/auxlib/decorators.py:2: 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 Hashable /usr/lib/python3.7/site-packages/conda/_vendor/boltons/setutils.py:17: 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 MutableSet /usr/lib/python3.7/site-packages/conda/_vendor/auxlib/entity.py:240: 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 Mapping, Sequence

gforsyth commented 5 years ago

Thanks for reporting @wedyat -- the deprecation warnings are being raised from xonsh itself, although it looks like the trigger is conda. You can try to update conda and see if they go away. Otherwise, you can put the following into you xonshrc to silence the warnings:

import warnings
warnings.filterwarnings("ignore",category=DeprecationWarning)
wedyat commented 5 years ago

Thanks! Maybe I'll try reporting that issue to xonsh developers then? Updating conda to either 4.5.12 or 4.6.0rc1 didn't help. So I silenced them as you advised.

Conda 4.6.0rc1 additionally returns a new warning (this time impossible to turn off) that might interest you: "WARNING: The conda.install module is deprecated and will be removed in a future release."

pyeguy commented 5 years ago

getting the same un-silenceable warning and additionally don't have the environment name popping up in parens after activation, don't know if those are related..

gforsyth commented 5 years ago

Hey @pyeguy -- conda has changed around a bunch of internals. I'm working on getting proper xonsh support built directly in to conda. I don't think the env name is related, but the deprecation warning isn't a proper warning in the python sense, which is why the fix above doesn't silence it. I'll try to figure out a temporary workaround. Can you open a separate issue for the env name display? Thanks!

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 @wedyat @pyeguy -- can you try out #45 and see if that fixes the errors on your end? (not the regular deprecation warnings, but it should handle the un-silenceable one)

gforsyth commented 5 years ago

Ok, the recently merged PR should fix the warning printed to stderr and the env-name not showing up has been fixed on xonsh master. I'll cut a release of xonda now, expect a xonsh release soonish.