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

Add spack env activate --temp #25388

Merged
merged 1 commit into from Oct 11, 2021
Merged

Conversation

haampie
Copy link
Member

@haampie haampie commented Aug 12, 2021

Creates an environment in a temporary directory and activates it, which
is useful for a quick ephemeral environment:

$ spack env activate -p --temp
[spack-1a203lyg] $ spack add zlib
==> Adding zlib to environment /tmp/spack-1a203lyg
==> Updating view at /tmp/spack-1a203lyg/.spack-env/view

@spackbot-app spackbot-app bot added the tests General test capability(ies) label Aug 31, 2021
@haampie
Copy link
Member Author

haampie commented Sep 1, 2021

This pr requires #25729 (which is merged)

@haampie haampie closed this Sep 3, 2021
@haampie haampie reopened this Sep 3, 2021
@haampie
Copy link
Member Author

haampie commented Sep 26, 2021

Review would be appreciated

@haampie haampie added this to In progress in Spack 0.17.0 Release via automation Sep 26, 2021
@tldahlgren
Copy link
Contributor

Any chance of getting at least a unit test for create_temp_env_directory?

@tldahlgren
Copy link
Contributor

tldahlgren commented Sep 30, 2021

Force re-running checks due to odd 'failure' in required shell test. (Possibly patch coverage related?)

@tldahlgren tldahlgren closed this Sep 30, 2021
Spack 0.17.0 Release automation moved this from In progress to Done Sep 30, 2021
@tldahlgren tldahlgren reopened this Sep 30, 2021
Spack 0.17.0 Release automation moved this from Done to In progress Sep 30, 2021
@haampie
Copy link
Member Author

haampie commented Oct 1, 2021

Hi Tamara, I introduced that create_temp_env_directory as a small / separate function so that I could avoid running tempfile.mkdtemp in the unit tests 😅

The code should be covered with the shell test... not sure why it's failing though.

@haampie
Copy link
Member Author

haampie commented Oct 1, 2021

The shell test failure was a legitimate one.

I couldn't convince argparse to accept either --temp OR a required env name / dir, so all options were optional, and the input validation should then be done by hand.

With the last commit:

$ spack env activate
==> Error: spack env activate requires an environment name, directory, or --temp

Edit: thx @tldahlgren, there actually was a missing shell test for spack env activate --temp... hopefully coverage goes up now.

Creates an environment in a temporary directory and activates it, which
is useful for a quick ephemeral environment:

```
$ spack env activate -p --temp
[spack-1a203lyg] $ spack add zlib
==> Adding zlib to environment /tmp/spack-1a203lyg
==> Updating view at /tmp/spack-1a203lyg/.spack-env/view
```
Spack 0.17.0 Release automation moved this from In progress to Review in progress Oct 11, 2021
@sethrj sethrj merged commit c0c9ab1 into spack:develop Oct 11, 2021
Spack 0.17.0 Release automation moved this from Review in progress to Done Oct 11, 2021
@haampie haampie deleted the feature/activate--temp branch October 11, 2021 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commands shell-support tests General test capability(ies)
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants