def _post_install(): from stringify import stringify_py stringify_py(source_path='pygame_gui/data', destination_file='pygame_gui/core/_string_data.py')
# provide correct path for version __version__ = None here = os.path.dirname(os.path.dirname(__file__)) try: exec(open(os.path.join(here, 'tk_tools/version.py')).read()) except FileNotFoundError: # this is the path when installing into venv through pycharm exec(open(os.path.join(here, 'tk_tools/tk_tools/version.py')).read()) with open('readme.md', 'r') as f: readme = f.read() # archive the _image files into 'tk_tools/images.py' try: stringify_py('images', 'tk_tools/images.py') except NameError: print('warning: stringify not present at time of install,' ' you may wish to run this script if tk_tools.images' ' needs to be regenerated') setup(name='tk_tools', version=__version__, description='Tkinter-native toolset and widget library', long_description=readme, long_description_content_type='text/markdown', author='Jason R. Jones', author_email='*****@*****.**', url='https://github.com/slightlynybbled/tk_tools', packages=['tk_tools'], include_package_data=True,
import logging from stringify import stringify, stringify_py, unstringify logging.basicConfig(level=logging.DEBUG) # print the stringified representation of the yellow-dot.png file print(stringify('binary_files/yellow-dot.png')) # creates a python file 'images.py' from # which one may import 'yellow_dot' to get the image data stringify_py('binary_files/yellow-dot.png', destination_file='images.py') # creates a single python file called # 'my_directory.py' which contains string representations # of 'yellow-dot.png' and 'green-dot.png' which accessible # as variables 'yellow_dot' and 'green_dot' stringify_py('binary_files', destination_file='my_img_directory.py') stringify_py('text_files', destination_file='my_text_directory.py') # going the other direction from my_text_files import text0, text1 print(unstringify(text0)) print(unstringify(text1))
from setuptools import setup from stringify import stringify_py # will only run when calling: python setup.py install and not when running: pip install . -U # that is actually the behaviour we want. stringify_py(source_path='pygame_gui/data', destination_file='pygame_gui/core/_string_data.py') setup( name='pygame_gui', version='0.4.0', description='A GUI module for pygame 2', long_description= "Helps create GUIs for games made using pygame 2. Features HTML-style text formatting, " "theme files to control the look and a system to manage multiple windows of GUI stuff.", keywords=["pygame", "gui", "ui"], url='https://github.com/MyreMylar/pygame_gui', download_url='https://github.com/MyreMylar/pygame_gui/archive/v_040.tar.gz', author='Dan Lawrence', author_email='*****@*****.**', license='MIT', packages=[ 'pygame_gui', 'pygame_gui.core', 'pygame_gui.elements', 'pygame_gui.elements.text', 'pygame_gui.windows' ], zip_safe=False, python_requires='>=3.5', setup_requires=['stringify', 'pytest'], install_requires=['pygame>=1.9.3'], include_package_data=True, classifiers=[
here = os.path.dirname(os.path.dirname(__file__)) exec(open(os.path.join(here, 'jockey/version.py')).read()) requirements = [ "subdue >= 0.1.6", "tk_tools" ] setup_requires = [ 'stringify' ] with open('readme.md', 'r') as f: long_description = f.read() stringify_py(source_path='images/app', destination_file='jockey/images.py') setup( name='jockey', version=__version__, description='Easy creation of hardware-oriented tests', long_description=long_description, author='Jason R. Jones', author_email='*****@*****.**', url='https://github.com/slightlynybbled/subdue', license='MIT', keywords='test labview visa instrument hardware', packages=find_packages(), include_package_data=True, install_requires=requirements, setup_requires=setup_requires,