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

Refactor virtualenv generators #5821

Closed
jgsogo opened this issue Sep 26, 2019 · 3 comments
Closed

Refactor virtualenv generators #5821

jgsogo opened this issue Sep 26, 2019 · 3 comments

Comments

@jgsogo
Copy link
Contributor

jgsogo commented Sep 26, 2019

Objectives:

  • Decouple the script to apply the variables from the file declaring them
    • the script should be exactly the same for any environment (only dependant on the cmd platform: ps1, sh, cmd)
    • all the variables should be contained into a .env file (some usage examples: docker, npm dotenv, heroku,...).
  • It should help to simplify the code

It is also needed for the plugins, they need to read environment variables from some file in order to apply them before calling some Conan commands or CMake itself.


Other things to consider (not the first iteration):

  • Should scripts be generated or contained in the Conan codebase (and updated with new versions)? It would allow activation like:
    • $> conan_env <path/to/file.env>, is it possible to use a Conan command for it? Can be created a stack of activated virtualenvs and help the user with it?
    • $> my_local.sh, it will be implemented like <path/to/conan/activate.sh> <path/to/local/file.env>
@jgsogo
Copy link
Contributor Author

jgsogo commented Sep 26, 2019

Testing approach suggested here by @ytimenkov should probably be considered first: #4291

@memsharded
Copy link
Member

Yes, I agree, that has been a long standing open issue, we couldn't move forward it properly (sorry @ytimenkov), if we are doing this, I agree that recovering that effort for better testing the environments would be a great thing.

@jgsogo
Copy link
Contributor Author

jgsogo commented Oct 24, 2019

We've merged the tests (#5828), here I have a POC about using .env file to store the environment variables (https://github.com/conan-io/conan/compare/develop...jgsogo:feat/environment-vars?expand=1). It could be the next step for this issue (needed from the plugins perspective) or we could prioritize some refactor in the generators code to simplify it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants