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

Fixed version restore behaviour when executing 'poetry run' commands on Linux with poetry >= 1.0.0b2 #6

Merged
merged 1 commit into from
Dec 13, 2019

Conversation

lmoretto
Copy link

Hello,
as of version 1.0.0b2, on Linux, the poetry run command uses os.execvp function instead of spawning a new subprocess.

For poetry-dynamic-versioning this change has the side-effect that the atexit hook is no longer called and, as a consequence, the original version string in pyproject.toml is not properly restored.

The proposed solution is to also patch poetry.console.command.run.RunCommand.handle function in order to immediately call deactivate before executing the desired command/script.

Copy link
Owner

@mtkennerly mtkennerly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! Just one minor change I'd like to see before merging.

poetry_dynamic_versioning/__init__.py Show resolved Hide resolved
@mtkennerly mtkennerly merged commit 9d4803b into mtkennerly:master Dec 13, 2019
@lmoretto lmoretto deleted the poetry_run_issue branch December 13, 2019 15:41
@mtkennerly
Copy link
Owner

@lmoretto This is now available in 0.3.2.

@lmoretto
Copy link
Author

Nice, thank you!

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.

2 participants