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

Improve clarity of environment manipulation #931

Merged
merged 1 commit into from
Jun 1, 2024
Merged

Conversation

mvz
Copy link
Contributor

@mvz mvz commented Jun 1, 2024

Summary

Cleans up code related to environment manipulation.

Details

This does two things:

  • It avoids having two methods #with_environment that, apart from operating at a different level, also use their arguments differently: one takes changes to the environment as an argument, the other takes a full replacement environment.

  • It decouples LocalEnvironment from the global platform singleton. This is neater because it makes the dependency go only one way.

Motivation and Context

I just spent quite some time looking at the wrong #with_environment and wondering how any environment variables could be left inside the block.

How Has This Been Tested?

CI will test it.

Types of changes

  • Internal change (refactoring, test improvements, developer experience or update of dependencies)

@mvz mvz enabled auto-merge June 1, 2024 06:52
@mvz mvz force-pushed the refactor-with-environment branch from aad9626 to 4ee2ab7 Compare June 1, 2024 09:40
This does two things:
- Avoid having two methods #with_environment that, apart from operating
  at a different level, also use their arguments differently: one takes
  changes to the environment as an argument, the other takes a full
  replacement environment.
- Decouple LocalEnvironment from the global platform singleton. This is
  neater because it makes the dependency go only one way.
@mvz mvz force-pushed the refactor-with-environment branch from 4ee2ab7 to 279d217 Compare June 1, 2024 10:49
@mvz mvz merged commit c56cebb into main Jun 1, 2024
18 checks passed
@mvz mvz deleted the refactor-with-environment branch June 1, 2024 11:11
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.

1 participant