Skip to content

Commit

Permalink
Replace python-ldap with openldap in conda env
Browse files Browse the repository at this point in the history
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:
* <python-poetry/poetry#6408 (comment)>
* <conda-forge/python-ldap-feedstock#28>

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: mxcube#1510
GitHub: mxcube/mxcubecore#849 (comment)
GitHub: conda-forge/python-ldap-feedstock#28
GitHub: mxcube/mxcubecore#851
  • Loading branch information
fabcor-maxiv committed Jan 14, 2025
1 parent 3b8d973 commit c98a431
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions conda-environment.yml
Original file line number Diff line number Diff line change
@@ -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
# ========================

Expand Down

0 comments on commit c98a431

Please sign in to comment.