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

Wrapper without the need to activate environment #111

Open
saraedum opened this issue May 12, 2020 · 7 comments
Open

Wrapper without the need to activate environment #111

saraedum opened this issue May 12, 2020 · 7 comments
Labels
stale::recovered [bot] recovered after being marked as stale type::documentation request for improved documentation

Comments

@saraedum
Copy link
Contributor

Sometimes I find myself wanting to package a binary or a Python script that works in a certain conda environment for users that I don't want to bother with opening a shell and activating the environment. Instead it's nice to just give them a zip file containing a click-here.bat/sh that takes care of that.

I couldn't find anything in the documentation related to that use case. If you think it would be a good addition, I'd try to add a section about this.

For example, we just packaged a simple python script that converts files it's given on the command line. If I add the following convert.bat to my conda pack zip file, users can just unzip the archive and create a lnk to convert.bat in their SendTo in Windows to be able to run that converter from the context menu in Explorer.

REM go to the root directory of the conda pack zip file
pushd "%~dp0"

call Scripts\activate

REM https://serverfault.com/questions/22443/do-windows-batch-files-have-a-construction
set args=%1
shift
:start
if [%1] == [] goto done
set args=%args% %1
shift
goto start
:done

python converter.py %args%
@saraedum
Copy link
Contributor Author

cc @DunklesArchipel

@mcg1969
Copy link
Contributor

mcg1969 commented Jul 3, 2020

That's a really interesting concept. How would you propose to include it in conda-pack? Keep in mind it would really have to be a pretty generic offering. And even then, it might be better suited for some sort of wrapper around conda-pack.

@saraedum
Copy link
Contributor Author

saraedum commented Jul 5, 2020

@mcg1969 thanks for having a look at this. I agree that it will be difficult to produce anything that is very generic here. Instead I am proposing to just add a section to the documentation that exemplifies some tricks like this one.

@mcg1969
Copy link
Contributor

mcg1969 commented Jul 5, 2020

That would be fantastic!

@mcg1969
Copy link
Contributor

mcg1969 commented Sep 20, 2020

@saraedum I just wanted to ping you here. I'm welcome to accept a documentation PR for this.

@github-actions
Copy link

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include:
    - What OS and version you reproduced the issue on
    - What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label Mar 15, 2022
@saraedum
Copy link
Contributor Author

The Linux bit has been added to the documentation. Not sure if there's any interest in writing the Windows part.

@github-actions github-actions bot added stale::recovered [bot] recovered after being marked as stale and removed stale [bot] marked as stale due to inactivity labels Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale::recovered [bot] recovered after being marked as stale type::documentation request for improved documentation
Projects
Status: No status
Development

No branches or pull requests

2 participants