Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent PythonAction from modifying task attributes by passing copies #129

Closed

Conversation

rbeagrie
Copy link
Contributor

Currently, if a PythonAction calls pop() or otherwise modifies dependencies, targets or changed, these changes are reflected in the task itself. This leads to the dependency or target in question not being added to the doit database properly after execution has finished.

@schettino72
Copy link
Member

Actually PythonAction being able to modify task attributes is a feature 😀

It is even documented: https://github.com/pydoit/doit/blame/master/doc/tasks.rst#L205

We should add unit tests for that...

@schettino72
Copy link
Member

It is a quite powerful feature.. if you search the mailing list you can find some use cases for that.

@rbeagrie
Copy link
Contributor Author

Ah sorry I missed that in the docs! It would only take me 10 minutes to invert the unit tests I wrote and test the correct behaviour, if you think that would be helpful?

@schettino72
Copy link
Member

It would only take me 10 minutes to invert the unit tests I wrote and test the correct behaviour, if you think that would be helpful?

that would be cool. thanks

I was also thinking about a simple example. Like creating a target where the filename includes the timestamp. It is a simple example but show how this feature can be powerful...

@schettino72 schettino72 reopened this Apr 3, 2016
@coveralls
Copy link

Coverage Status

Coverage increased (+0.0003%) to 99.788% when pulling 778e498 on rbeagrie:pyactions_cannot_modify_tasks into 773a4a4 on pydoit:master.

@rbeagrie rbeagrie force-pushed the pyactions_cannot_modify_tasks branch from 778e498 to 6656d04 Compare April 3, 2016 08:18
@coveralls
Copy link

Coverage Status

Changes Unknown when pulling 6656d04 on rbeagrie:pyactions_cannot_modify_tasks into * on pydoit:master*.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants