mxcube / mxcubecore

Backend used by MXCuBE
http://mxcube.github.io/mxcube/
GNU Lesser General Public License v3.0
11 stars 52 forks source link

Do we need a range for the Python version in `conda-environment-dev.yml`? #845

Closed fabcor-maxiv closed 8 months ago

fabcor-maxiv commented 8 months ago

I wrote:

I am not sure we need to have a version range for Python in the conda-environment-dev.yml file. Maybe it is better to choose a version (major minor, for example 3.10), and then use the same for pre-commit hooks and everywhere else it makes sense.

@rhfogh wrote:

Before we change the python version specified, we need to make sure that all installations are OK with that version. Essentially whatever version is specified in conda-environment-dev.yml would count as a de facto minimum version for installations, no?

@marcus-oscarsson wrote:

The reason for the version range is that not all institutes support/use the same version for python on their beamlines.


My intention is not to change the Python version range in Poetry pyproject.toml which is the one that declares what Python versions are supported by this library.

The way I see it, conda-environment-dev.yml is only to set up a development environment quickly. Is there a way with the current version of this file to choose something else than Python 3.10 when creating the conda environment?

marcus-oscarsson commented 8 months ago

You are right that one would like to use this for whatever python version one intends to use, so the range is maybe not really necessary. One needs to either pass python version via command line or edit the file to get the wanted result.

fabcor-maxiv commented 8 months ago

Seems like something like this works:

conda create --file conda-environment-dev.yml python=3.9

and this fails (as we would want):

conda create --file conda-environment-dev.yml python=3.7
marcus-oscarsson commented 8 months ago

Yeah, thats what I had in mind, but not sure that passing python version will override whats i the yaml, did you try ?

fabcor-maxiv commented 8 months ago

Yes, that is what I meant. I tried both the commands in my previous message.

We could document this somewhere, although I assume it is kind of basic conda knowledge. On mxcubecore we do not really have a good place to document this, but we could do it for mxcubeweb at least.

marcus-oscarsson commented 8 months ago

:+1: ok sounds good. It is basic conda knowledge and its, I would say, the expected behavior

fabcor-maxiv commented 8 months ago

Let's close this. See the following instead:

marcus-oscarsson commented 8 months ago

:+1: Thanks !