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

make dev and make environment stack environments if activated #370

Open
bkreider opened this issue Jan 9, 2025 · 3 comments
Open

make dev and make environment stack environments if activated #370

bkreider opened this issue Jan 9, 2025 · 3 comments

Comments

@bkreider
Copy link
Contributor

bkreider commented Jan 9, 2025

See the bad env location here. I still have anaconda-linter activated and the last line shows it is trying to nest/stack the environment.

In fact, if one runs make environment and then make dev it will happily stack environments.

(anaconda-linter) bkreider@MacBookPro anaconda-linter % make dev
rm -rf .coverage
rm -rf htmlcov
rm -rf reports/{*.html,*.png,*.js,*.css,*.json}
rm -rf pytest.xml
rm -rf pytest-coverage.txt
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
conda remove -y -n anaconda-linter --all

EnvironmentLocationNotFound: Not a conda environment: /Users/bkreider/anaconda3/envs/anaconda-linter/envs/anaconda-linter
@schuylermartin45
Copy link
Collaborator

I've never seen conda successfully recover from deleting the environment while the environment is activated. I don't think this is the responsibility of this project to fix that, that sounds like a conda issue to me. I would think conda would be smart enough to deactivate for you in the event you try to delete the active environment.

We use this pattern in a number of our internal and external projects that get set up via make. I always just deactivate first and run make dev.

@bkreider
Copy link
Contributor Author

bkreider commented Jan 9, 2025

I guess my concern is that when running the make commands, the user might not know it is activating, deactivating, or removing the conda environment.

Shouldn't the make command either fail when the conditions aren't correct or deactivate first and then do the command?

@schuylermartin45
Copy link
Collaborator

Is that some state I can query from conda? I actually have no idea

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

No branches or pull requests

2 participants