How can I bundle other files when using cx_freeze?

Figured it out. from cx_Freeze import setup,Executable includefiles = [‘README.txt’, ‘CHANGELOG.txt’, ‘helpers\uncompress\unRAR.exe’, , ‘helpers\uncompress\unzip.exe’] includes = [] excludes = [‘Tkinter’] packages = [‘do’,’khh’] setup( name=”myapp”, version = ‘0.1’, description = ‘A general enhancement utility’, author=”lenin”, author_email=”le…@null.com”, options = {‘build_exe’: {‘includes’:includes,’excludes’:excludes,’packages’:packages,’include_files’:includefiles}}, executables = [Executable(‘janitor.py’)] ) Note: include_files must contain “only” relative paths to the setup.py script … Read more

Automatic version number both in setup.py (setuptools) AND source code?

You could also reverse the dependency: put the version in mylib/__init__.py, parse that file in setup.py to get the version parameter, and use git tag $(setup.py –version) on the command line to create your tag. git tag -a v$(python setup.py –version) -m ‘description of version’ Is there anything more complicated you want to do that … Read more

Why does “python setup.py sdist” create unwanted “PROJECT-egg.info” in project root directory?

This directory is created intentionally as part of the build process for a source distribution. A little gander at the developer guide for setuptools gives you a hint as to why: But, be sure to ignore any part of the distutils documentation that deals with MANIFEST or how it’s generated from MANIFEST.in; setuptools shields you … Read more

Managing resources in a Python project

You may want to use pkg_resources library that comes with setuptools. For example, I’ve made up a quick little package “proj” to illustrate the resource organization scheme I’d use: proj/setup.py proj/proj/__init__.py proj/proj/code.py proj/proj/resources/__init__.py proj/proj/resources/images/__init__.py proj/proj/resources/images/pic1.png proj/proj/resources/images/pic2.png Notice how I keep all resources in a separate subpackage. “code.py” shows how pkg_resources is used to refer to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)