conda / conda-build

Commands and tools for building conda packages
https://docs.conda.io/projects/conda-build/
Other
381 stars 423 forks source link

noarch: python will not include "scripts" as exe files on windows #4385

Closed k-dominik closed 1 year ago

k-dominik commented 2 years ago

Actual Behavior

when building noarch packages including a script (via setup.py, see example repo here), the script file will not be included in noarch builds. For proper "win" builds, an .exe file would be included (if the script doesn't have an a file extension, otherwise only the .py file will be included - no exe).

In the "example" repo above I also included a script via entry-point. This produces a .exe file for both, win and noarch builds.

Side note, I checked what happens on OSX. Interestingly there, only noarch builds would include the entrypoint (both from script (maintaining the file extension) and via entry_points in bin...)

Expected Behavior

I'm not sure I should actually expect an .exe file in any case, for noarch, and "proper" win builds. At least I'd expect the docs to actively discourage using "scripts".

Steps to Reproduce

(or run this little script from the repository root)

```python import subprocess subprocess.check_call(["conda", "build", "-c", "conda-forge", "recipe"]) for bld_type in ["noarch", "arch"]: for bld_with in ["setup", "pip"]: for script_ext in ["py", "noext"]: bld_str = f"{bld_with}_{bld_type}_{script_ext}" bld = f"fortytwo=*={bld_str}" subprocess.check_call([ "conda", "create", "-y", "-n", f"ft-{bld_str}" "-c", "local", "-c", "conda-forge", bld, ]) ```
Output of conda info
     active environment : base
    active env location : <abbreviated>\AppData\Local\mambaforge
            shell level : 1
       user config file : <abbreviated>\.condarc
 populated config files : <abbreviated>\AppData\Local\mambaforge\.condarc
                          <abbreviated>\.condarc
          conda version : 4.11.0
    conda-build version : 3.21.8
         python version : 3.9.7.final.0
       virtual packages : __win=0=0
                          __archspec=1=x86_64
       base environment : <abbreviated>\AppData\Local\mambaforge  (writable)
      conda av data dir : <abbreviated>\AppData\Local\mambaforge\etc\conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : <abbreviated>\Miniconda3\pkgs
       envs directories : <abbreviated>\Miniconda3\envs
                          <abbreviated>\AppData\Local\mambaforge\envs
                          <abbreviated>\.conda\envs
                          <abbreviated>\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/4.11.0 requests/2.27.1 CPython/3.9.7 Windows/10 Windows/10.0.19042
          administrator : False
             netrc file : None
           offline mode : False
github-actions[bot] commented 1 year ago

Hi there, thank you for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this issue to remain open please:

  1. Verify that you can still reproduce the issue at hand
  2. Comment that the issue is still reproducible and include:
    • What OS and version you reproduced the issue on
    • What steps you followed to reproduce the issue

NOTE: If this issue was closed prematurely, please leave a comment.

Thanks!