Note that there are some explanatory texts on larger screens.

plurals
  1. POOverride setup.cfg options to achieve default behavior
    text
    copied!<p>I have a setup.cfg containing Linux installation options,</p> <pre><code>[install] prefix=/opt/foo install-lib=/opt/foo </code></pre> <p>which corresponds to the default directory layout this project has under Linux.</p> <p>Now the same project uses py2exe for Windows installation. Currently, I'm using a .bat file to move this setup.cfg out of the way while running <code>python setup.py py2exe</code> in order not to confuse py2exe with those setting, which I think amounts to distutils/py2exe using default parameters.</p> <p>I'd much rather invoke <code>python setup.py py2exe</code> with some extra arguments to override those specified in setup.cfg, but using <code>--prefix= --install-lib=</code> gives me</p> <pre><code>[...] *** copy data files *** Traceback (most recent call last): File "setup.py", line 158, in &lt;module&gt; **platformOptions) File "C:\Python27\lib\distutils\core.py", line 152, in setup dist.run_commands() File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands self.run_command(cmd) File "C:\Python27\lib\distutils\dist.py", line 972, in run_command cmd_obj.run() File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 243, in run self._run() File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 312, in _run self.create_binaries(py_files, extensions, dlls) File "C:\Python27\lib\site-packages\py2exe\build_exe.py", line 560, in create_binaries install_data.ensure_finalized() File "C:\Python27\lib\distutils\cmd.py", line 109, in ensure_finalized self.finalize_options() File "C:\Python27\lib\distutils\command\install_data.py", line 41, in finalize_options ('force', 'force'), File "C:\Python27\lib\distutils\cmd.py", line 298, in set_undefined_options src_cmd_obj.ensure_finalized() File "C:\Python27\lib\distutils\cmd.py", line 109, in ensure_finalized self.finalize_options() File "C:\Python27\lib\distutils\command\install.py", line 353, in finalize_options 'userbase', 'usersite') File "C:\Python27\lib\distutils\command\install.py", line 504, in convert_paths setattr(self, attr, convert_path(getattr(self, attr))) File "C:\Python27\lib\distutils\util.py", line 199, in convert_path raise ValueError, "path '%s' cannot be absolute" % pathname ValueError: path '/opt/trelby' cannot be absolute </code></pre> <p>which is the same behavior as when not trying to override setup.cfg parameters at all, so something seems to go wrong.</p> <p>I'm also willing to alternatively set <code>distutils.core.setup()</code>'s <code>options</code> parameter in setup.py, if necessary, but the main question seems to be: to what value, in order to achieve default py2exe behavior?</p> <p>BTW, code is found at <a href="https://github.com/oskusalerma/trelby" rel="nofollow">https://github.com/oskusalerma/trelby</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload