From c98a43141f6436f2bc41af47769a8615ba1a5d12 Mon Sep 17 00:00:00 2001 From: fabcor Date: Tue, 14 Jan 2025 11:24:47 +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.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/conda-environment.yml b/conda-environment.yml index 0ae2ba14a..8e59e1539 100644 --- a/conda-environment.yml +++ b/conda-environment.yml @@ -1,24 +1,28 @@ --- + name: mxcubeweb channels: - conda-forge dependencies: - # ==================== + # Runtime dependencies # ==================== - ffmpeg # Not directly used by mxcube, but necessary for the video-streamer - python >=3.8,<3.12 # Make sure it matches `pyproject.toml` - # 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". - - python-ldap ==3.4.3 # Make sure it matches `poetry.lock` - # ======================== + # Compile-time dependencies + # ========================= + + # Adding `openldap` here allows Python's pip and Poetry to compile `python-ldap`. + # Indeed on PyPI, `python-ldap` is distributed as *sdist* only + # and it requires compilation before it can be installed. + - openldap + + # Development dependencies # ========================