check_pyicu.py

View code on Github

Check to see if the requirements of the emoji process are installed.

Examples

>>> python3 src/scribe_data/check/check_pyicu.py
scribe_data.check.check_pyicu.check_if_pyicu_installed()[source]

Check to see if PyICU is installed or not.

Returns:
bool

Whether PyICU is installed.

scribe_data.check.check_pyicu.get_python_version_and_architecture()[source]

Get the current Python version and architecture.

Returns:
python_versionstr

The Python version in the format ‘cpXY’.

architecturestr

The architecture type (‘amd64’ or ‘win32’).

scribe_data.check.check_pyicu.fetch_wheel_releases()[source]

Fetch the release data for PyICU from GitHub with error handling for rate limits.

Returns:
available_wheelslist

A list of tuples containing wheel file names and their download URLs.

total_size_mbfloat

The total size of all available wheels in MB.

scribe_data.check.check_pyicu.download_wheel_file(wheel_url, output_dir)[source]

Download the wheel file from the given URL.

Parameters:
wheel_urlstr

The URL of the wheel file to download.

output_dirstr

The directory to save the downloaded file.

Returns:
str

Path to the downloaded wheel file.

scribe_data.check.check_pyicu.find_matching_wheel(wheels, python_version, architecture)[source]

Find the matching wheel file based on Python version and architecture.

Parameters:
wheelslist

The list of available wheels.

python_versionstr

The Python version (e.g., ‘cp311’).

architecturestr

The architecture type (e.g., ‘win_amd64’).

Returns:
str

The download URL of the matching wheel or None if not found.

scribe_data.check.check_pyicu.check_and_install_pyicu()[source]

Check whether PyICU is installed and install it if it’s not already.

Returns:
bool

Whether PyICU is installed.