Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Install icu in our docker images #14705

Closed
anoadragon453 opened this issue Dec 19, 2022 · 3 comments
Closed

Install icu in our docker images #14705

anoadragon453 opened this issue Dec 19, 2022 · 3 comments
Labels
A-Docker Docker images, or making it easier to run Synapse in a container. T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.

Comments

@anoadragon453
Copy link
Member

#14464 added icu as a new, optional native dependency to improve user directory search for non-English languages. If the python module is installed, then the new user search code is used, otherwise it will fall back to the old code.

It would be nice to include this in our docker images by default as it allows for enhanced functionality. Really all this means is:

  1. Install libicu-dev
  2. Ensure pyicu is installed via poetry
@anoadragon453 anoadragon453 added A-Docker Docker images, or making it easier to run Synapse in a container. T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. labels Dec 19, 2022
@ankit-pn
Copy link

ankit-pn commented Jan 2, 2023

it has been done in #14712

@DMRobertson
Copy link
Contributor

I sanity checked this as follows:

$ docker exec -it synapse python -ic "import icu"
>>> icu
<module 'icu' from '/usr/local/lib/python3.9/site-packages/icu/__init__.py'>
>>> dir(icu)
['AlphabeticIndex', 'AnnualTimeZoneRule', 'BasicTimeZone', 'Bidi', 'BidiTransform', 'BreakIterator', 'BytesTrie', 'BytesTrieBuilder', 'BytesTrieIterator', 'BytesTrieState', 'Calendar', 'CanonicalIterator', 'CaseMap', 'Char', 'CharacterIterator', 'CharsetDetector', 'CharsetMatch', 'ChoiceFormat', 'CollationElementIterator', 'CollationKey', 'Collator', 'CompactDecimalFormat', 'ConstrainedFieldPosition', 'CurrencyAmount', 'CurrencyPluralInfo', 'CurrencyPrecision', 'CurrencyUnit', 'DateFormat', 'DateFormatSymbols', 'DateInterval', 'DateIntervalFormat', 'DateIntervalInfo', 'DateRuleType', 'DateTimePatternGenerator', 'DateTimeRule', 'DecimalFormat', 'DecimalFormatSymbols', 'DictionaryBasedBreakIterator', 'Edits', 'EditsIterator', 'FLOATING_TZNAME', 'FieldPosition', 'FilteredNormalizer2', 'FloatingTZ', 'Format', 'Formattable', 'FormattedDateInterval', 'FormattedList', 'FormattedNumber', 'FormattedNumberRange', 'FormattedRelativeDateTime', 'FormattedValue', 'ForwardCharacterIterator', 'FractionPrecision', 'GenderInfo', 'GregorianCalendar', 'ICUError', 'ICU_MAX_MAJOR_VERSION', 'ICU_VERSION', 'ICUtzinfo', 'IDNA', 'IDNAInfo', 'ImmutableIndex', 'IncrementPrecision', 'InitialTimeZoneRule', 'IntegerWidth', 'InvalidArgsError', 'ListFormatter', 'Locale', 'LocaleBuilder', 'LocaleData', 'LocaleMatcher', 'LocaleMatcherBuilder', 'LocaleMatcherResult', 'LocalizedNumberFormatter', 'LocalizedNumberRangeFormatter', 'Measure', 'MeasureFormat', 'MeasureUnit', 'MessageFormat', 'MessagePattern', 'MessagePattern_Part', 'NoUnit', 'Normalizer', 'Normalizer2', 'Notation', 'NumberFormat', 'NumberFormatter', 'NumberRangeFormatter', 'NumberingSystem', 'PY_VERSION', 'ParsePosition', 'PluralFormat', 'PluralRules', 'Precision', 'PythonReplaceable', 'RegexMatcher', 'RegexPattern', 'Region', 'RelativeDateTimeFormatter', 'Replaceable', 'ResourceBundle', 'RuleBasedBreakIterator', 'RuleBasedCollator', 'RuleBasedNumberFormat', 'RuleBasedTimeZone', 'Scale', 'ScientificNotation', 'Script', 'SearchIterator', 'SelectFormat', 'Shape', 'SimpleDateFormat', 'SimpleFormatter', 'SimpleTimeZone', 'SpoofChecker', 'StringCharacterIterator', 'StringEnumeration', 'StringSearch', 'StringTrieBuilder', 'TimeArrayTimeZoneRule', 'TimeRuleType', 'TimeUnit', 'TimeUnitAmount', 'TimeUnitFormat', 'TimeZone', 'TimeZoneRule', 'TimeZoneTransition', 'Transliterator', 'UAcceptResult', 'UAlphabeticIndexLabelType', 'UBiDiDirection', 'UBiDiMirroring', 'UBiDiOrder', 'UBiDiReorderingMode', 'UBiDiReorderingOption', 'UBidiPairedBracketType', 'UBlockCode', 'UCalendarAMPMs', 'UCalendarDateFields', 'UCalendarDaysOfWeek', 'UCalendarMonths', 'UCharCategory', 'UCharCharacterIterator', 'UCharDirection', 'UCharNameChoice', 'UCharsTrie', 'UCharsTrieBuilder', 'UCharsTrieIterator', 'UCharsTrieState', 'UCollAttribute', 'UCollAttributeValue', 'UCollationResult', 'UCurrNameStyle', 'UCurrencySpacing', 'UCurrencyUsage', 'UDateAbsoluteUnit', 'UDateDirection', 'UDateFormatBooleanAttribute', 'UDateRelativeDateTimeFormatterStyle', 'UDateRelativeUnit', 'UDateTimePatternConflict', 'UDateTimePatternField', 'UDateTimePatternMatchOptions', 'UDisplayContext', 'UDisplayContextType', 'UFieldCategory', 'UGender', 'UGraphemeClusterBreak', 'UHangulSyllableType', 'UIndicPositionalCategory', 'UIndicSyllabicCategory', 'UJoiningGroup', 'ULineBreak', 'UListFormatterField', 'ULocDataLocaleType', 'ULocMatchDemotion', 'ULocMatchDirection', 'ULocMatchFavorSubtag', 'ULocaleDataDelimiterType', 'ULocaleDataExemplarSetType', 'UMatchDegree', 'UMeasureUnitComplexity', 'UMeasurementSystem', 'UMemory', 'UMessagePatternApostropheMode', 'UMessagePatternArgType', 'UMessagePatternPartType', 'UNICODE_VERSION', 'UNORM_INPUT_IS_FCD', 'UNormalizationCheckResult', 'UNormalizationMode', 'UNormalizationMode2', 'UNumberCompactStyle', 'UNumberDecimalSeparatorDisplay', 'UNumberFormatAttribute', 'UNumberFormatFields', 'UNumberFormatRoundingMode', 'UNumberFormatStyle', 'UNumberGroupingStrategy', 'UNumberRangeCollapse', 'UNumberRangeIdentityFallback', 'UNumberRangeIdentityResult', 'UNumberSignDisplay', 'UNumberUnitWidth', 'UObject', 'UProperty', 'UPropertyNameChoice', 'URBNFRuleSetTag', 'URegexpFlag', 'URegionType', 'URelativeDateTimeFormatterField', 'URelativeDateTimeUnit', 'UResType', 'URestrictionLevel', 'USET_ADD_CASE_MAPPINGS', 'USET_CASE_INSENSITIVE', 'USET_IGNORE_SPACE', 'UScriptCode', 'UScriptUsage', 'USearchAttribute', 'USearchAttributeValue', 'USetSpanCondition', 'USpoofChecks', 'UStringTrieBuildOption', 'UStringTrieResult', 'UTimeUnitFields', 'UTimeUnitFormatStyle', 'UTransDirection', 'UTransPosition', 'UVerticalOrientation', 'UWordBreak', 'UWordBreakValues', 'U_COMPARE_CODE_POINT_ORDER', 'U_COMPARE_IGNORE_CASE', 'U_EDITS_NO_RESET', 'U_FOLD_CASE_DEFAULT', 'U_FOLD_CASE_EXCLUDE_SPECIAL_I', 'U_OMIT_UNCHANGED_TEXT', 'U_TITLECASE_ADJUST_TO_CASED', 'U_TITLECASE_NO_BREAK_ADJUSTMENT', 'U_TITLECASE_NO_LOWERCASE', 'U_TITLECASE_SENTENCES', 'U_TITLECASE_WHOLE_STRING', 'UnicodeFilter', 'UnicodeFunctor', 'UnicodeMatcher', 'UnicodeSet', 'UnicodeSetIterator', 'UnicodeString', 'UnlocalizedNumberFormatter', 'UnlocalizedNumberRangeFormatter', 'VERSION', 'VTimeZone', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '_icu_']

Ensure pyicu is installed via poetry

Note that this should be done for free: we effectively poetry install --extras all and user-search was added to all.

@DMRobertson
Copy link
Contributor

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Docker Docker images, or making it easier to run Synapse in a container. T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.
Projects
None yet
Development

No branches or pull requests

3 participants