Reputation: 11565
Is it possible to indicate that a specific file will become setup.py during the building process (e.g., python setup.py sdist
) when using distutils
(or distribute
, or else) ?
I would like to be able to do python setup-specificbuild.py sdist
and have something (either in setup-specificbuild.py
or as a command line argument) that would rename setup-specificbuild.py
to setup.py
in the package tarball build in dist/
.
Upvotes: 1
Views: 306
Reputation: 11565
There is an answer on SO about a similar problem (create different distribution types). Custom command line parsing seems to be a decent workaround, and then eventual distribution-specific logic can be pushed to separate modules, only imported if found, and only included when needed.
Upvotes: 1
Reputation: 26160
setup.py
is ultimately just an entry point to a Python program, so if you want to implement branching build behaviors, just have your standard setup.py
parse command line arguments and dispatch the actual build process to whatever modules you want. That's much preferable to trying to dynamically re-name files with some pre-build script step.
Upvotes: 0