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

Allow use of the original working directory for tasks #161

Merged
merged 9 commits into from
Aug 13, 2023

Conversation

Spiffyk
Copy link
Contributor

@Spiffyk Spiffyk commented Aug 3, 2023

For some tasks, it may be useful to use the working directory from which the task has been executed, since they may be meant to operate on some files that the user points them to. This commit introduces a special '$exec_cwd' value for the 'cwd' task option, which does exactly that. Existing use-cases are unaffected by this addition and work as usual.

Copy link
Owner

@nat-n nat-n left a comment

Choose a reason for hiding this comment

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

Hi @Spiffyk, thanks for the PR, I think this feature is a good idea!

I left some comments about things that need to be improved before this can be merged. We also need to cover this feature with a test, and the CI is failing on coding standards (poe format should fix it).

If you're keen to own this then great (and please let me know), otherwise I should have some time soon to fix it up before merging.

poethepoet/context.py Outdated Show resolved Hide resolved
poethepoet/context.py Outdated Show resolved Hide resolved
docs/tasks/options.rst Outdated Show resolved Hide resolved
@Spiffyk
Copy link
Contributor Author

Spiffyk commented Aug 6, 2023

Hi, @nat-n, I'll be happy to own this and fix it up. Thanks for the review, I'll look into all of it soon!

Copy link
Owner

@nat-n nat-n left a comment

Choose a reason for hiding this comment

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

Nice work, it's almost there :)

tests/test_includes.py Show resolved Hide resolved
docs/index.rst Outdated Show resolved Hide resolved
tests/fixtures/cwd_project/pyproject.toml Show resolved Hide resolved
poethepoet/env/manager.py Outdated Show resolved Hide resolved
@Spiffyk Spiffyk changed the base branch from main to development August 8, 2023 06:22
Spiffyk and others added 6 commits August 8, 2023 09:55
For some tasks, it may be useful to use the working directory from which
the task has been executed, since they may be meant to operate on some
files that the user points them to. This commit introduces a special
'$exec_cwd' value for the 'cwd' task option, which does exactly that.
Existing use-cases are unaffected by this addition and work as usual.
@nat-n nat-n added the enhancement New feature or request label Aug 9, 2023
poethepoet/app.py Outdated Show resolved Hide resolved
poethepoet/app.py Outdated Show resolved Hide resolved
poethepoet/env/manager.py Outdated Show resolved Hide resolved
poethepoet/env/manager.py Outdated Show resolved Hide resolved
docs/tasks/options.rst Outdated Show resolved Hide resolved
tests/test_includes.py Outdated Show resolved Hide resolved
tests/test_includes.py Outdated Show resolved Hide resolved
tests/test_includes.py Outdated Show resolved Hide resolved
@Spiffyk Spiffyk requested a review from nat-n August 12, 2023 09:55
Copy link
Owner

@nat-n nat-n 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 the fast turn around. Just one little issue, then I think it'll be good to go.

poethepoet/env/manager.py Outdated Show resolved Hide resolved
Spiffyk and others added 2 commits August 12, 2023 17:08
Co-authored-by: Nat Noordanus <[email protected]>
Remove extra lines
Copy link
Owner

@nat-n nat-n 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 contributing this feature @Spiffyk 🙂

It’ll be included in the next release.

@nat-n nat-n merged commit e185a56 into nat-n:development Aug 13, 2023
@Spiffyk
Copy link
Contributor Author

Spiffyk commented Aug 13, 2023

Thanks for the help to get this in properly! 🙂

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

Successfully merging this pull request may close these issues.

2 participants