我正在尝试从我的源代码创建一个conda包,但是我遇到了build/entry_points
配置文件的meta.yaml
部分。
说明:
以下是我的setup.py
文件,该文件可与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='me@me.com',
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']
}
)
这是conda配方中的meta.yaml
文件。
package:
name: wopmars
version: "1.1.0"
build:
entry_points:
- wopmars = src.main.fr.tagc.wopmars.wopmars:main
requirements:
build:
- python
- setuptools
run:
- python
文件build.sh
也存在且包含$PYTHON setup.py install
。
然后我构建了conda包:
(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
这里开始讨论这个问题:我不明白为什么会输出关于pyinstrument
包的很多信息,而关于我的包wopmars
(pyinstrument
包的信息很少已经在conda
)
但我继续前进,并尝试安装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%
一切似乎都没问题IMO但是:
(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
(找不到这种类型的文件或目录)
我可能错过了什么,但我无法弄清楚这里有什么问题。
请问,如何在entry_points
包中指定项目的conda
?
答案 0 :(得分:3)
Conda正在打包pyinstruments
而不是您的项目wopmars
,如构建日志中所示(以源代码树开头的行):
(...)
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
(...)
在meta.yaml
尝试添加source section。假设您的meta.yaml
与Python源文件位于同一目录中,您可以使用:
source:
path: .