Skip to content
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

MINOR: Emoji library parameter being deprecated #611

Open
eugeneromero opened this issue Mar 24, 2022 · 10 comments
Open

MINOR: Emoji library parameter being deprecated #611

eugeneromero opened this issue Mar 24, 2022 · 10 comments
Assignees
Labels

Comments

@eugeneromero
Copy link

Description

Since a few days ago, running terraform-compliance (docker image, have not tested other versions) shows these deprecation warnings on almost every line (where there used to be emojis before):

/usr/local/lib/python3.7/site-packages/terraform_compliance/common/defaults.py:52: DeprecationWarning: The parameter 'use_aliases' in emoji.emojize() is deprecated and will be removed in version 2.0.0. Use language='alias' instead.
To hide this warning, pin/downgrade the package to 'emoji~=1.6.3'
  self.warning_icon = emojize(':exclamation:', use_aliases=True)

To Reproduce

Run terraform compliance.

Running via Docker:
Yes

Error Output:

/usr/local/lib/python3.7/site-packages/terraform_compliance/common/defaults.py:52: DeprecationWarning: The parameter 'use_aliases' in emoji.emojize() is deprecated and will be removed in version 2.0.0. Use language='alias' instead.
To hide this warning, pin/downgrade the package to 'emoji~=1.6.3'
  self.warning_icon = emojize(':exclamation:', use_aliases=True)

Expected Behavior:
Some nice emoticons, no errors.

Tested Versions:

  • terraform-compliance version: 1.3.32
@eerkunt
Copy link
Member

eerkunt commented Mar 24, 2022

Oh wow, thanks for the issue. Fixing this. :)

@eerkunt
Copy link
Member

eerkunt commented Mar 24, 2022

Weirdly, I couldn't reproduce this. What is the emoji version you have installed on your system ?

Could it be installed separately ?

@eugeneromero
Copy link
Author

I do not see the issue on my own (Ubuntu) machine. However, the issue happens in the Microsoft hosted Ubuntu 20.04 machines that we use for our CI/CD pipelines.

Here is the list of all software installed on those machines. We don't add anything additional to them, so that should give you a good idea of what's in there...

@eerkunt
Copy link
Member

eerkunt commented Mar 24, 2022

super weird. Will try to release a beta version for you

@eugeneromero
Copy link
Author

Thank you!

@eerkunt
Copy link
Member

eerkunt commented Mar 24, 2022

Released 1.3.33b1, give few minutes to be released automatically then lets have go :)

@eugeneromero
Copy link
Author

I can confirm that this new version works as expected :) no errors thrown in the pipeline run. Feel free to close this one when you move it out of beta :D thanks for the quick help @eerkunt !

@michaelact
Copy link

When will 1.3.33b1 version be available on pypi?

@dj-wasabi
Copy link

Hi, not wanting to hijack this issue, but is 1.3.33b1 solving this issue as well as it is related to emoji?

$ terraform-compliance -f ../ --planfile planfile
Traceback (most recent call last):
  File "/Users/wdijkerman/.venv3101/bin/terraform-compliance", line 5, in <module>
    from terraform_compliance.main import cli
  File "/Users/wdijkerman/.venv3101/lib/python3.10/site-packages/terraform_compliance/main.py", line 29, in <module>
    print('{} v{} initiated\n'.format(__app_name__, Defaults().yellow(__version__)))
  File "/Users/wdijkerman/.venv3101/lib/python3.10/site-packages/terraform_compliance/common/defaults.py", line 51, in __init__
    self.info_icon = emojize(':bulb:', language='alias')
  File "/Users/wdijkerman/.venv3101/lib/python3.10/site-packages/emoji/core.py", line 77, in emojize
    EMOJI_UNICODE = unicode_codes.EMOJI_UNICODE[language]
KeyError: 'alias'
$  pip freeze | grep -i terraform-compliance
terraform-compliance==1.3.33

Thank you!

@idanmiara
Copy link

idanmiara commented Oct 26, 2023

Hi,

I've solved a related bug and wanted to share: emoji.emojize(): kwarg use_aliases=True was removed in emoji>=2. It was replaced with language='alias' that is available since emoji>=1.7.
So if you are getting KeyError: 'alias' it is probably you are using emoji<1.7 and if you use use_aliases you would get an error if using emoji>=2.

carpedm20/emoji#195 (comment)
carpedm20/emoji#200
carpedm20/emoji#203
carpedm20/emoji#205

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants