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

Install icu in our docker images #14705

Closed

Description

@anoadragon453

#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

Activity

  1. added
    A-DockerDocker images, or making it easier to run Synapse in a container.
    T-TaskRefactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.
    on Dec 19, 2022
  2. ankit-pn commented on Jan 2, 2023

    @ankit-pn

    it has been done in #14712

  3. DMRobertson commented on Jan 9, 2023

    @DMRobertson
    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-DockerDocker images, or making it easier to run Synapse in a container.T-TaskRefactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions