Repository: conda/conda-build

Issue:
entry_points cannot be specified without spaces in noarch: python packages
If a `build/entry_points` element is specified in a `noarch: python`recipe without spaces (`foo=module.func` vs `foo = module.func`) the build fails with a FileNotFoundError.

Minimal example:

``` yaml
package:
  name: chardet
  version: 2.3.0

source:
  fn: chardet-2.3.0.tar.gz
  url: https://pypi.io/packages/source/c/chardet/chardet-2.3.0.tar.gz
  sha256: e53e38b3a4afe6d1132de62b7400a4ac363452dc5dfcf8d88e8e0cce663c68aa

build:
  number: 0
  noarch: python
  script: python setup.py install --single-version-externally-managed --record=record.txt
  entry_points:
    - chardetect=chardet.chardetect:main

requirements:
  build:
    - python
    - setuptools
  run:
    - python

test:
  imports:
    - chardet
  commands:
    - chardetect --help
```

Trying to build this recipe results in the following traceback:

```
INFO conda_build.build:bundle_conda(656): Packaging chardet-2.3.0-pyha3ad5bd_0
number of files: 44
Fixing permissions
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/jhelmus/devel/conda-build/conda_build/cli/main_build.py", line 323, in main
    execute(sys.argv[1:])
  File "/home/jhelmus/devel/conda-build/conda_build/cli/main_build.py", line 314, in execute
    noverify=args.no_verify)
  File "/home/jhelmus/devel/conda-build/conda_build/api.py", line 170, in build
    need_source_download=need_source_download, config=config, variants=variants)
  File "/home/jhelmus/devel/conda-build/conda_build/build.py", line 1377, in build_tree
    built_packages=built_packages)
  File "/home/jhelmus/devel/conda-build/conda_build/build.py", line 982, in build
    built_package = bundlers[output_d.get('type', 'conda')](output_d, m, env)
  File "/home/jhelmus/devel/conda-build/conda_build/build.py", line 679, in bundle_conda
    files = post_process_files(metadata, initial_files)
  File "/home/jhelmus/devel/conda-build/conda_build/build.py", line 639, in post_process_files
    noarch_python.populate_files(m, pkg_files, m.config.build_prefix, entry_point_script_names)
  File "/home/jhelmus/devel/conda-build/conda_build/noarch_python.py", line 109, in populate_files
    os.unlink(src)
FileNotFoundError: [Errno 2] No such file or directory: '/home/jhelmus/anaconda3/conda-bld/chardet_1491058843473/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pl/bin/chardetect=chardet.chardetect:mai'
```


Discussion:

Resolving patch:
diff --git a/conda_build/build.py b/conda_build/build.py
--- a/conda_build/build.py
+++ b/conda_build/build.py
@@ -466,7 +466,7 @@ def write_no_link(m, config, files):
 def get_entry_point_script_names(entry_point_scripts):
     scripts = []
     for entry_point in entry_point_scripts:
-        cmd = entry_point[:entry_point.find("= ")].strip()
+        cmd = entry_point[:entry_point.find("=")].strip()
         if utils.on_win:
             scripts.append("Scripts\\%s-script.py" % cmd)
             scripts.append("Scripts\\%s.exe" % cmd)


Test patch: