From: Dmitry Shachnev Date: Thu, 25 Dec 2025 23:36:23 +0300 Subject: Remove use of requests from utils/generate_snowball.py So we can run it during the package build. --- utils/generate_snowball.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/utils/generate_snowball.py b/utils/generate_snowball.py index 181cb01..edc7a8c 100755 --- a/utils/generate_snowball.py +++ b/utils/generate_snowball.py @@ -55,18 +55,9 @@ def regenerate_stopwords() -> None: STOPWORDS_DIR.joinpath('__init__.py').touch() for lang_code, lang_name, url in STOPWORD_URLS: - content = requests.get(url, timeout=5).content - try: - data = content.decode('utf-8') - except UnicodeDecodeError: - if lang_code == 'ru': - data = content.decode('koi8-r') - else: - data = content.decode('latin-1') - # record the original source of the stopwords list txt_path = STOPWORDS_DIR / f'{lang_code}.txt' - txt_path.write_text(data.rstrip() + '\n', encoding='utf-8') + data = txt_path.read_text() # generate the Python stopwords set stopwords = parse_stop_word(data) @@ -134,5 +125,3 @@ def regenerate_javascript() -> None: if __name__ == '__main__': regenerate_stopwords() - if sys.platform != 'win32': - regenerate_javascript()