setup.py: renaming src package to project name

You could fix it by putting Python package files into proj/ directory: proj/ src/ proj/ __init__.py xyz.py abc.py setup.py And changing setup.py to: # … setup( name=”proj”, packages=[‘proj’], package_dir={”:’src’} ) It is not required by distutils but other tools might expect the parent directory name of __init__.py file to be the same as Python package … Read more

How may I override the compiler (GCC) flags that setup.py uses by default?

Prepend CFLAGS=”-O0″ before you run setup.py: % CFLAGS=”-O0″ python ./setup.py The -O0 will be appended to CFLAGS while compiling, therefore will override previous -O2 setting. Another way is add -O0 to extra_compile_args in setup.py: moduleA = Extension(‘moduleA’, ….., include_dirs = [‘/usr/include’, ‘/usr/local/include’], extra_compile_args = [“-O0”], ) If you want to remove all default flags, use: … Read more

pip ignores dependency_links in setup.py

This answer should help. In a nutshell, you need to specify the version (or “dev”) for the #egg=python-s3 so it looks like #egg=python-s3-1.0.0. Updates based on @Cerin’s comment: Pip 1.5.x has a flag to enable dependency-links processing: –process-dependency-links. I haven’t tested it because I agree with the point below. This discussion seems to indicate that … Read more

distutils: How to pass a user defined parameter to setup.py?

As Setuptools/Distuils are horribly documented, I had problems finding the answer to this myself. But eventually I stumbled across this example. Also, this similar question was helpful. Basically, a custom command with an option would look like: from distutils.core import setup, Command class InstallCommand(Command): description = “Installs the foo.” user_options = [ (‘foo=’, None, ‘Specify … Read more

How to copy directory recursively in python and overwrite all?

Notice: distutils has been deprecated and will be removed in Python 3.12. Consider looking for other answers at this question if you are looking for a post-3.12 solution. Original answer: You can use distutils.dir_util.copy_tree. It works just fine and you don’t have to pass every argument, only src and dst are mandatory. However in your … Read more

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