Skip to content

Update to emojilib 3 - #49

Merged
hugovk merged 2 commits into
masterfrom
update-emojilib
May 24, 2021
Merged

hugovk merged 2 commits into
masterfrom
update-emojilib

Conversation

@hugovk

@hugovk hugovk commented Mar 28, 2021 •

Copy link
Copy Markdown
Owner

More emoji have been added to emojilib 3.0.2 since the last update to 2.4.0 in 2018 (and updated here in 2019 9171272).

However, 3.0.0 was a breaking change: muan/emojilib#178

Notably, the data structure and contents have changed, from:

  "pie": {
    "keywords": ["food", "dessert", "pastry"],
    "char": "🥧",
    "fitzpatrick_scale": false,
    "category": "food_and_drink"
  },
  "cake": {
    "keywords": ["food", "dessert"],
    "char": "🍰",
    "fitzpatrick_scale": false,
    "category": "food_and_drink"
  },

to:

  "🥧": [
    "pie",
    "food",
    "dessert",
    "pastry"
  ],
  "🍰": [
    "shortcake",
    "food",
    "dessert"
  ],

fitzpatrick_scale is gone but it was never used. We no longer have a distinct category.

The data is simpler: the "name" has basically been moved to the first keyword.

I've refactored the code to accommodate, and have aimed to have the same behaviour: em pie returns 🥧, and em -s food returns a long list of food.

However, there are some differences in the data, with the primary keyword changed in some cases. For example, "cake" is now "shortcake", and this matches https://emojipedia.org/shortcake/

I think this is fine, and means the emoji can be updated in the future as new emojilib updates come out. However, it's probably best to consider this a breaking change.

Please let me know if something now works differently that shouldn't (i.e. logic change rather than data change).

@hugovk hugovk added enhancement New feature or request changelog: Changed For changes in existing functionality labels Mar 28, 2021
@codecov

codecov Bot commented Mar 28, 2021 •

Copy link
Copy Markdown

Codecov Report

Merging #49 (7e1b9cf) into master (d3b14c0) will decrease coverage by 0.12%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #49      +/-   ##
==========================================
- Coverage   97.29%   97.16%   -0.13%     
==========================================
  Files           2        2              
  Lines         111      106       -5     
==========================================
- Hits          108      103       -5     
  Misses          3        3              
Flag Coverage Δ
GHA_Ubuntu 94.33% <100.00%> (-0.26%) ⬇️
GHA_Windows 94.33% <100.00%> (-0.26%) ⬇️
GHA_macOS 94.33% <100.00%> (-0.26%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
em/__init__.py 95.65% <100.00%> (-0.30%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3b14c0...7e1b9cf. Read the comment docs.

@hugovk hugovk changed the title Update to emojilib 3.0.1 Update to emojilib 3 May 24, 2021
@hugovk
hugovk merged commit a92e931 into master May 24, 2021
@hugovk
hugovk deleted the update-emojilib branch May 24, 2021 13:30
@hugovk hugovk removed the enhancement New feature or request label May 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog: Changed For changes in existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant