opened
AlexeySanko
username_0
Into distutils_plugin.py hardcoded ["clean", "--all"] for each distutils_commands. And we cannot  use results one step into next steps.
My particular case: I need specific shebang into script into wheel. But setuptools replace shebang for all scripts by default from build machine. I can avoid it though sequence call:
```
python setup.py build -e '/opt/python2.7/bin/python'
python setup.py bdist_wheel
```
I expected it with next params:
```
project.set_property('distutils_commands', ['build', 'bdist_wheel'])
project.set_property('distutils_command_options', {'build': ('--executable', '/opt/python2.7/bin/python')})
```

By by fact I got next commands
```
python setup.py clean --all build -e '/opt/python2.7/bin/python'
python setup.py clean --all bdist_wheel
```
And bdist_wheel re-build package with incorrect shebang.
I have possibility to call "clean --all" through 'distutils_command_options' property and do not see reasons for hardcode it. Also we have task clean which remove /target directory

distutils_plugin.py
```
...
execute_distutils(project, logger, commands, True)
...
execute_distutils(project, logger, upload_cmd_line, True)
...
def execute_distutils(project, logger, distutils_commands, clean=False):
...
    for command in distutils_commands:
....
        with open(output_file_path, "w") as output_file:
...
            if clean:
                commands.extend(["clean", "--all"])
...
```
Pybuilder clean build derictory after each distutils command
issue
created
AlexeySanko
username_0
Expected result produce next properties:
```
project.set_property('distutils_commands', 'build')
project.set_property('distutils_command_options',
                         {'build': ('-e', '/opt/python2.7/bin/python', 'bdist_wheel')})
```
In this case which advantages of usage different distutils_commands isolated?
comment
created
arcivanov
username_1
Aren't shebangs supposed to be resolved by the installer at the installation time, especially for a wheel (PEP-0427, PEP-0491)?

The reason that `clean --all` is used is to ensure that if you're generating multiple packages (bdist_wheel vs dumb vs bdist) that the "build/" directory doesn't cross-contaminate the builds. Some use absolute paths, some use relative.
comment
created
AlexeySanko
username_0
I expected the same result, but on develop and target machine I had python by /opt/python2.7/bin/python. On build machine (with Jenkins) - basic Python. And on target host I got incorrect interpreter error (shebung was #!python).
So in this case it's expected behavior and we just should add it to documentation [distutils_commands property](http://pybuilder.github.io/documentation/plugins.html#BuildingaPythonpackage). We can add project property which can regular it (like "distutils_clean_between_commands with default True), but it could be overloading of properties.
comment
created
arcivanov
username_1
@username_0 irrespective of this bug, what you probably are experiencing are old versions of setuptools, pip or both.
comment
created
AlexeySanko
username_0
On target host:
pip (8.1.2)
setuptools (22.0.5)
On build:
pip (9.0.1)
setuptools (28.8.0)

In this case target host looks like not a very fresh, :)
comment
created
arcivanov
username_1
To say the least ;) I suspect that's why your shebang doesn't get properly massaged.
comment
created
AlexeySanko
username_0
Anyway hardcoded [clean -all] is unexpected and cannot be managed. How we can at least add it to documentation?
comment
created
arcivanov
username_1
The documentation is very outdated. I'll add this to the queue. Thanks!
comment
created
AlexeySanko
username_0
Created into doc repo: https://github.com/pybuilder/pybuilder.github.io/issues/37
comment
closed
AlexeySanko
username_0
issue