Given these two facts:
- micropipenv is able to parse all the .lock and pyproject files and
- micropipenv is not able to create a Python virtual environment
it might make sense to implement a new command get-python-version. The new command would basically just print out the information about the Python version the configuration is prepared for.
Let's say I'd like to use micropipenv instead of pipenv in an automated script for deploying applications. I'm able to create my own virtual environment for the application but I need to know which Python version to use. And this is the spot micropipenv can help me. All the logic to find the proper file and parse all the JSONs or TOMLs is already there so this new feature would enable us to do something like:
PYTHON_VERSION=`micropipenv get-python-version`
python$PYTHON_VERSION -m venv venv
source venv/bin/activate
micropipenv install
@encukou I hope that I described your idea correctly.
This is slightly related to #187
Possible problems to solve:
requirements.txt files do not contain Python version, what to return in this case?
- poetry can use version specifiers like
==3.6.7 or >=3.6.7 or worse ^3.7, what version return in case of such ranges?
- pipfile should contain only one version and it's generated there automatically but the specification is kinda vague and it seems to me that a pipfile without
python_version is valid and pipenv works fine in that case without any issues of warnings.
Given these two facts:
it might make sense to implement a new command
get-python-version. The new command would basically just print out the information about the Python version the configuration is prepared for.Let's say I'd like to use micropipenv instead of pipenv in an automated script for deploying applications. I'm able to create my own virtual environment for the application but I need to know which Python version to use. And this is the spot micropipenv can help me. All the logic to find the proper file and parse all the JSONs or TOMLs is already there so this new feature would enable us to do something like:
@encukou I hope that I described your idea correctly.
This is slightly related to #187
Possible problems to solve:
requirements.txtfiles do not contain Python version, what to return in this case?==3.6.7or>=3.6.7or worse^3.7, what version return in case of such ranges?python_versionis valid and pipenv works fine in that case without any issues of warnings.