|
1 | 1 | import setuptools |
| 2 | +import os |
| 3 | +import bz2 |
2 | 4 |
|
3 | 5 |
|
4 | 6 | with open('readme.md') as fh: |
5 | 7 | long_description = fh.read() |
6 | 8 |
|
7 | | -setuptools.setup( |
8 | | - name='yoficator', |
9 | | - version='0.1.6', |
10 | | - description='A Russian text yoficator (ёфикатор)', |
11 | | - long_description=long_description, |
12 | | - long_description_content_type='text/markdown', |
13 | | - license='License :: OSI Approved :: MIT License', |
14 | | - packages=['yoficator'], |
15 | | - package_data={ |
16 | | - 'yoficator': ['_data/dictionary.ru_RU.txt'], |
17 | | - }, |
18 | | - include_package_data=True, |
19 | | - classifiers=[ |
20 | | - 'Programming Language :: Python :: 3', |
21 | | - 'License :: OSI Approved :: MIT License', |
22 | | - 'Operating System :: OS Independent', |
23 | | - ], |
24 | | - python_requires='>=3', |
25 | | -) |
| 9 | + |
| 10 | +def create_zip(): |
| 11 | + with open('yoficator/_data/dictionary.ru_RU.txt', 'rb') as source: |
| 12 | + with bz2.BZ2File('yoficator/_data/dictionary.ru_RU.txt.bz2', 'w') as stream: |
| 13 | + stream.write(source.read()) |
| 14 | + |
| 15 | + |
| 16 | +try: |
| 17 | + create_zip() |
| 18 | + setuptools.setup( |
| 19 | + name='yoficator', |
| 20 | + version='0.1.7', |
| 21 | + description='A Russian text yoficator (ёфикатор)', |
| 22 | + long_description=long_description, |
| 23 | + long_description_content_type='text/markdown', |
| 24 | + license='License :: OSI Approved :: MIT License', |
| 25 | + packages=['yoficator'], |
| 26 | + package_data={ |
| 27 | + 'yoficator': ['_data/dictionary.ru_RU.txt.bz2'], |
| 28 | + }, |
| 29 | + include_package_data=True, |
| 30 | + classifiers=[ |
| 31 | + 'Programming Language :: Python :: 3', |
| 32 | + 'License :: OSI Approved :: MIT License', |
| 33 | + 'Operating System :: OS Independent', |
| 34 | + ], |
| 35 | + python_requires='>=3', |
| 36 | + ) |
| 37 | +finally: |
| 38 | + try: |
| 39 | + os.remove('yoficator/_data/dictionary.ru_RU.txt.bz2') |
| 40 | + except FileNotFoundError: |
| 41 | + pass |
0 commit comments