4

I am trying to create a conda package from my sources but I get the stuck with the build/entry_points part of the meta.yaml configuration file.

Explanations:

Here is my setup.py file which works correctly with pip :

from setuptools import setup, find_packages
from codecs import open
from os import path

here = path.abspath(path.dirname(__file__))

with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
    long_description = f.read()

with open('requirements.txt') as f:
    required = f.read().splitlines()

setup(
    name='myproject',
    version='1.1.0',
    description='My project',
    long_description=long_description,
    url='',
    author='Me',
    author_email='[email protected]',
    license='',
    classifiers=[
        'Development Status :: 2 - Pre-Alpha',
        'Programming Language :: Python :: 3.4',
        'Intended Audience :: Developers',
        'Intended Audience :: Science/Research',
        #todo License::
        'Environment :: Console',
        'Natural Language :: English',
        'Operating System :: POSIX :: Linux',
        'Programming Language :: Python :: 3.4',
        'Topic :: Database :: Front-Ends',
        'Topic :: Adaptive Technologies',
        'Topic :: Scientific/Engineering :: Bio-Informatics',
        'Topic :: Software Development',
    ],
    keywords='workflow manager python object-oriented reproducible science database framework',
    packages=find_packages(exclude=['log', 'doc', '*.test.*', 'soutenance', 'rapport']),
    install_requires=required,
    package_data={},
    data_files=[],
    entry_points={
        'console_scripts':['wopmars=src.main.fr.tagc.wopmars.wopmars:main']
    }
)

Here is my meta.yaml file in conda recipe.

package:
  name: wopmars
  version: "1.1.0"

build:
  entry_points:
    - wopmars = src.main.fr.tagc.wopmars.wopmars:main

requirements:
  build:
    - python
    - setuptools

  run:
    - python

The file build.sh is present too and contains $PYTHON setup.py install.

Then I build the conda package:

(test_wop) luc@everest:~/Documents/WORK/wopmars$ conda build .
Removing old build environment
BUILD START: wopmars-1.1.0-py35_0
Fetching package metadata .........
Solving package specifications: ..........

The following NEW packages will be INSTALLED:

    openssl:    1.0.2h-1     
    pip:        8.1.2-py35_0 
    python:     3.5.2-0      
    readline:   6.2-2        
    setuptools: 23.0.0-py35_0
    sqlite:     3.13.0-0     
    tk:         8.5.18-0     
    wheel:      0.29.0-py35_0
    xz:         5.2.2-0      
    zlib:       1.2.8-3      

Linking packages ...
[      COMPLETE      ]|#######################################################################################################################################################################################| 100%
Package: wopmars-1.1.0-py35_0
source tree in: /home/luc/bin/anaconda3/conda-bld/work/pyinstrument-0.13.1
+ source activate /home/luc/bin/anaconda3/envs/_build
++ [[ -n 4.3.42(1)-release ]]
++ _SCRIPT_LOCATION=/home/luc/bin/anaconda3/envs/_build/bin/activate
++ SHELL=bash
+++ dirname /home/luc/bin/anaconda3/envs/_build/bin/activate
++ _CONDA_DIR=/home/luc/bin/anaconda3/envs/_build/bin
++ '[' 1 -gt 1 ']'
++ case "$(uname -s)" in
+++ uname -s
++ EXT=
++ [[ -n 4.3.42(1)-release ]]
+++ basename /home/luc/bin/anaconda3/conda-bld/work/pyinstrument-0.13.1/conda_build.sh
++ [[ conda_build.sh == \a\c\t\i\v\a\t\e ]]
++ '[' 1 -eq 0 ']'
++ args=/home/luc/bin/anaconda3/envs/_build
++ /home/luc/bin/anaconda3/envs/_build/bin/conda ..checkenv bash /home/luc/bin/anaconda3/envs/_build
++ ((  0 != 0  ))
++ source /home/luc/bin/anaconda3/envs/_build/bin/deactivate
+++ [[ -n 4.3.42(1)-release ]]
+++ _SCRIPT_LOCATION=/home/luc/bin/anaconda3/envs/_build/bin/deactivate
+++ SHELL=bash
++++ dirname /home/luc/bin/anaconda3/envs/_build/bin/deactivate
+++ _CONDA_DIR=/home/luc/bin/anaconda3/envs/_build/bin
+++ case "$(uname -s)" in
++++ uname -s
+++ EXT=
+++ [[ 1 > 0 ]]
+++ key=/home/luc/bin/anaconda3/envs/_build
+++ case $key in
+++ shift
+++ [[ 0 > 0 ]]
+++ [[ -n 4.3.42(1)-release ]]
++++ basename /home/luc/bin/anaconda3/conda-bld/work/pyinstrument-0.13.1/conda_build.sh
+++ [[ conda_build.sh == \d\e\a\c\t\i\v\a\t\e ]]
+++ [[ -z '' ]]
+++ [[ -n 4.3.42(1)-release ]]
++++ basename /home/luc/bin/anaconda3/conda-bld/work/pyinstrument-0.13.1/conda_build.sh
+++ [[ conda_build.sh == \d\e\a\c\t\i\v\a\t\e ]]
+++ return 0
+++ /home/luc/bin/anaconda3/envs/_build/bin/conda ..activate bash /home/luc/bin/anaconda3/envs/_build
++ _NEW_PART=/home/luc/bin/anaconda3/envs/_build/bin
++ ((  0 == 0  ))
++ export CONDA_PATH_BACKUP=/home/luc/bin/anaconda3/envs/_build/bin:/home/luc/bin/anaconda3/envs/test_wop/bin:/home/luc/bin:/home/luc/bin/anaconda3/bin:/home/luc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
++ CONDA_PATH_BACKUP=/home/luc/bin/anaconda3/envs/_build/bin:/home/luc/bin/anaconda3/envs/test_wop/bin:/home/luc/bin:/home/luc/bin/anaconda3/bin:/home/luc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
++ export CONDA_PS1_BACKUP=
++ CONDA_PS1_BACKUP=
++ export PATH=/home/luc/bin/anaconda3/envs/_build/bin:/home/luc/bin/anaconda3/envs/_build/bin:/home/luc/bin/anaconda3/envs/test_wop/bin:/home/luc/bin:/home/luc/bin/anaconda3/bin:/home/luc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
++ PATH=/home/luc/bin/anaconda3/envs/_build/bin:/home/luc/bin/anaconda3/envs/_build/bin:/home/luc/bin/anaconda3/envs/test_wop/bin:/home/luc/bin:/home/luc/bin/anaconda3/bin:/home/luc/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
++ [[ '' == */* ]]
++ export CONDA_DEFAULT_ENV=/home/luc/bin/anaconda3/envs/_build
++ CONDA_DEFAULT_ENV=/home/luc/bin/anaconda3/envs/_build
++ firstpath=/home/luc/bin/anaconda3/envs/_build/bin
+++ echo /home/luc/bin/anaconda3/envs/_build/bin
+++ sed 's|/bin$||'
++ export CONDA_PREFIX=/home/luc/bin/anaconda3/envs/_build
+++ /home/luc/bin/anaconda3/envs/_build/bin/conda ..changeps1
++ '[' 1 = 1 ']'
+++ grep -q CONDA_DEFAULT_ENV
++ export 'PS1=(/home/luc/bin/anaconda3/envs/_build) '
++ PS1='(/home/luc/bin/anaconda3/envs/_build) '
++ _CONDA_D=/home/luc/bin/anaconda3/envs/_build/etc/conda/activate.d
++ [[ -d /home/luc/bin/anaconda3/envs/_build/etc/conda/activate.d ]]
++ unset CONDA_PATH
++ [[ -n 4.3.42(1)-release ]]
++ hash -r
+ /home/luc/bin/anaconda3/envs/_build/bin/python setup.py install
running install
running bdist_egg
running egg_info
writing dependency_links to pyinstrument.egg-info/dependency_links.txt
writing pyinstrument.egg-info/PKG-INFO
writing top-level names to pyinstrument.egg-info/top_level.txt
writing entry points to pyinstrument.egg-info/entry_points.txt
reading manifest file 'pyinstrument.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pyinstrument.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/pyinstrument
copying build/lib/pyinstrument/profiler.py -> build/bdist.linux-x86_64/egg/pyinstrument
creating build/bdist.linux-x86_64/egg/pyinstrument/resources
copying build/lib/pyinstrument/resources/profile.js -> build/bdist.linux-x86_64/egg/pyinstrument/resources
copying build/lib/pyinstrument/resources/jquery-1.11.0.min.js -> build/bdist.linux-x86_64/egg/pyinstrument/resources
copying build/lib/pyinstrument/resources/style.css -> build/bdist.linux-x86_64/egg/pyinstrument/resources
copying build/lib/pyinstrument/__init__.py -> build/bdist.linux-x86_64/egg/pyinstrument
copying build/lib/pyinstrument/__main__.py -> build/bdist.linux-x86_64/egg/pyinstrument
copying build/lib/pyinstrument/middleware.py -> build/bdist.linux-x86_64/egg/pyinstrument
byte-compiling build/bdist.linux-x86_64/egg/pyinstrument/profiler.py to profiler.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/pyinstrument/__init__.py to __init__.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/pyinstrument/__main__.py to __main__.cpython-35.pyc
byte-compiling build/bdist.linux-x86_64/egg/pyinstrument/middleware.py to middleware.cpython-35.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying pyinstrument.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pyinstrument.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pyinstrument.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pyinstrument.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pyinstrument.egg-info/not-zip-safe -> build/bdist.linux-x86_64/egg/EGG-INFO
copying pyinstrument.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
creating 'dist/pyinstrument-0.13.1-py3.5.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing pyinstrument-0.13.1-py3.5.egg
creating /home/luc/bin/anaconda3/envs/_build/lib/python3.5/site-packages/pyinstrument-0.13.1-py3.5.egg
Extracting pyinstrument-0.13.1-py3.5.egg to /home/luc/bin/anaconda3/envs/_build/lib/python3.5/site-packages
Adding pyinstrument 0.13.1 to easy-install.pth file
Installing pyinstrument script to /home/luc/bin/anaconda3/envs/_build/bin

Installed /home/luc/bin/anaconda3/envs/_build/lib/python3.5/site-packages/pyinstrument-0.13.1-py3.5.egg
Processing dependencies for pyinstrument==0.13.1
Finished processing dependencies for pyinstrument==0.13.1
found egg dir: /home/luc/bin/anaconda3/envs/_build/lib/python3.5/site-packages/pyinstrument-0.13.1-py3.5.egg
number of files: 19
Fixing permissions
Detected hard-coded path in text file bin/pyinstrument
Detected hard-coded path in text file bin/wopmars
Fixing permissions
BUILD END: wopmars-1.1.0-py35_0
Nothing to test for: wopmars-1.1.0-py35_0
# If you want to upload this package to anaconda.org later, type:
#
# $ anaconda upload /home/luc/bin/anaconda3/conda-bld/linux-64/wopmars-1.1.0-py35_0.tar.bz2
#
# To have conda build upload to anaconda.org automatically, use
# $ conda config --set anaconda_upload yes

And here starts the issue: I don't understand why this outputs that much informations about the pyinstrument package and that few about my package, wopmars (the pyinstrument package have been used during the tutorial of conda)

But I keep going and I try to install wopmars:

(test_wop) luc@everest:~/Documents/WORK/wopmars$ conda install --use-local wopmars
Fetching package metadata .........
Solving package specifications: ..........

Package plan for installation in environment /home/luc/bin/anaconda3/envs/test_wop:

The following NEW packages will be INSTALLED:

    wopmars: 1.1.0-py35_0 local

Proceed ([y]/n)? 

Linking packages ...
[      COMPLETE      ]|#######################################################################################################################################################################################| 100%

Everything seems to be ok IMO BUT:

(test_wop) luc@everest:~/Documents/WORK/wopmars$ wopmars
bash: /home/luc/bin/anaconda3/envs/test_wop/bin/wopmars: Aucun fichier ou dossier de ce type

(cannot find this type of file or directory)

I have probably missed something, but I cannot figure out what is the problem here.

Please, how do you specify entry_points of a project in a conda package?

1 Answer 1

3
+25

Conda is packaging pyinstruments instead of your project wopmars as shown in the build log (line starting by source tree):

(...)
Package: wopmars-1.1.0-py35_0
source tree in: /home/luc/bin/anaconda3/conda-bld/work/pyinstrument-0.13.1
+ source activate /home/luc/bin/anaconda3/envs/_build
(...)

In your meta.yaml try adding a source section. Assuming your meta.yaml is in the same directory as your Python source files, you could use:

source:
    path: .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.