conda-forge / python-ldap-feedstock

A conda-smithy repository for python-ldap.
BSD 3-Clause "New" or "Revised" License
0 stars 2 forks source link

Distributions contain `direct_url.json` file #28

Open fabcor-maxiv opened 9 months ago

fabcor-maxiv commented 9 months ago

Solution to issue cannot be found in the documentation.

Issue

As far as I can tell the distributions contain a direct_url.json file (/lib/python3.9/site-packages/python_ldap-3.4.3.dist-info/direct_url.json), although direct_url.json should not be in the distributions. When the distribution gets installed this file gets installed as well and its presence causes confusion for other installers (at least for Poetry).

A bit more details about our concrete case. We use conda and Poetry in combination. We first create a conda environment in which we install python-ldap pinned to version 3.4.3. Then inside the conda environment we run poetry install for a project where python-ldap is also pinned to 3.4.3. Seeing the obviously faulty content of the direct_url.json file, Poetry legitimately considers that poetry-ldap does not fulfill the requirements and must be reinstalled, which fails.

In our case Poetry can not install python-ldap itself, because on PyPI it is only distributed as sdist (no wheel), which needs to be built, which requires a compilation step, which requires a compiler and header files, and we do not have those. That is why we install python-ldap with conda in the first place.

Removing the direct_url.json file before running poetry install fixes the issue.

As far as I can tell, the presence of the unwanted direct_url.json file is not an issue specific to this feedstock, it is a common issue in a lot of other conda packages.

If I understood correctly, this happens because the build process includes a pip install step for a local source tree which leads pip to legitimately create this direct_url.json file. But since the installation is meant to be repackaged in conda distributions for later installation, the feedstock should not place direct_url.json in the distributions.

Related:

Installed packages

python-ldap

Environment info

libmamba version : 1.5.6
     micromamba version : 1.5.6
           curl version : libcurl/8.5.0 OpenSSL/3.2.0 zlib/1.2.13 zstd/1.5.5 libssh2/1.11.0 nghttp2/1.58.0
     libarchive version : libarchive 3.7.2 zlib/1.2.13 bz2lib/1.0.8 libzstd/1.5.5
       envs directories : /home/user/.local/share/mamba/envs
          package cache : /home/user/.local/share/mamba/pkgs
                          /home/user/.mamba/pkgs
            environment : project (active)
           env location : /home/user/.local/share/mamba/envs/project
      user config files : /home/user/.mambarc
 populated config files : /home/user/.condarc
       virtual packages : __unix=0=0
                          __linux=6.1.0=0
                          __glibc=2.36=0
                          __archspec=1=x86_64-v3
               channels : https://conda.maxiv.lu.se/get/maxiv-kits/linux-64
                          https://conda.maxiv.lu.se/get/maxiv-kits/noarch
                          https://conda.maxiv.lu.se/get/mini-conda-forge/linux-64
                          https://conda.maxiv.lu.se/get/mini-conda-forge/noarch
       base environment : /home/user/.local/share/mamba
               platform : linux-64