From 1b908ca704656f1e740af22f6ffd3392a8467db3 Mon Sep 17 00:00:00 2001 From: fabcor Date: Tue, 14 Jan 2025 10:42:49 +0100 Subject: [PATCH] Replace python-ldap with openldap in conda env On PyPI, `python-ldap` is distributed as an *sdist* only, not *wheel*. But it still requires a compilation step before installation. Some dependencies installed with conda are rightfully ignored by Poetry. Even when `python-ldap` is pre-installed by conda, Poetry would still need to reinstall it which implies compilation. Indeed there is an issue in how conda packages are created and how they are installed: * * So it does not make much sense to let conda install `python-ldap`. Instead we can instruct conda to install `openldap` only, and pip and Poetry should be able to compile `python-ldap`. GitHub: https://github.com/mxcube/mxcubeweb/issues/1510 GitHub: https://github.com/mxcube/mxcubecore/pull/849#issuecomment-1956126473 GitHub: https://github.com/conda-forge/python-ldap-feedstock/issues/28 GitHub: https://github.com/mxcube/mxcubecore/pull/851 --- conda-environment-dev.yml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/conda-environment-dev.yml b/conda-environment-dev.yml index c3d2864e9d..a3746ed2af 100644 --- a/conda-environment-dev.yml +++ b/conda-environment-dev.yml @@ -2,24 +2,28 @@ --- name: mxcubecore + channels: - conda-forge + dependencies: - ### Runtime dependencies + # Runtime dependencies + # ==================== - python >=3.8,<3.12 - # We install `python-ldap` from conda because it is "hard" to install. - # On PyPI it is not available as *wheel*, only as *sdist* which requires to be built - # with compilation steps that require a compiler and some header files. - # Installing with conda is much "easier". - # - # IMPORTANT: - # Always make sure that `python-ldap` here is pinned to the same version - # as in the Poetry lockfile `poetry.lock` (not the other way around). - - python-ldap=3.4.3 - - ### Development dependencies + # `openldap` is necessary for `python-ldap` but can not be installed by pip or Poetry. + # Note also that on PyPI `python-ldap` is only available as *sdist*, not as *wheel*, + # and that installing it requires a compilation step. + # The `openldap` Conda package should provide enough for this compilation step + # (header files and things like this), but the C compiler itself. + # Make sure that a C compiler is available on the system, + # as it is NOT provided as a dependency in this Conda environment file. + - openldap + + + # Development dependencies + # ======================== - poetry