setuptools

Can I define optional packages in setuptools?

独自空忆成欢 提交于 2020-01-22 14:17:36
问题 Currently one of my packages requires a JSON parser/encoder, and is designed to use simplejson if available falling back to the json module (in the standard library) if necessary (as benchmarks show simplejson is faster). However, recently it's been hit & miss as to whether simplejson will install when using zc.buildout - something with the move to github, I believe. Which got me wondering; is it possible to define optional packages in my setup.py file which, if unavailable, won't stop the

Python Setuptools and PBR - how to create a package release using the git tag as the version?

家住魔仙堡 提交于 2020-01-21 19:42:27
问题 How do I actually create a release/distro of a python package that uses a git repo tag for the versioning, using setuptools and pbr ? There is plenty of information on the basic setup and configuration required: SetupTools Documentation - setup() and setup.py configuration Python Packaging User Guide - Installing Packages PBR v3.1.1 documentation StackOverflow: How to use version info generated using setuptools and pbr But where is the simple info on how to actually create the distro? i.e. I

Excluding source files from built rpm distribution with setuptool

谁都会走 提交于 2020-01-16 07:56:50
问题 I have a typical project structure that looks as follows: EngineEmulator src ship engine emulator mapping tests emulator mapping utils common doc .... tools .... setup.py MANIFEST.in setup.cfg README.rst My setup.py looks as follows: from setuptools import setup, find_packages setup( name='Engine', version=1.0.0, description='Engine Project', package_dir={'': 'src'}, packages=find_packages( 'src', exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), install_requires =['pycrypto', 'kombu >=1

Linux 安装pip-python

故事扮演 提交于 2020-01-16 02:19:16
1、先说一下什么是pip pip 是“A tool for installing and managing Python packages.”,也就是说pip是python的软件安装工具 2、下面介绍怎么在linux下安装pip 下载pip到/usr/local/srccd /usr/local/sr wget "https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz#md5=834b2904f92d46aaa333267fb1c922bb" -- no - check - certificate 如果提示:-bash: wget: command not found 那么安装wget,执行如下: yum - y install wget 解夺安装pip tar - xzvf pip - 1 . 5 . 4 . tar . gz cd pip - 1 . 5 . 4 python setup . py install 如果安装报下面的错: Traceback (most recent call last): File “setup.py”, line 6, in from setuptools import setup, find_packages ImportError: No module named

Python Packaging multiple subpackages with different data directories

独自空忆成欢 提交于 2020-01-15 12:03:12
问题 I have a structure of the directory as such with foobar and alphabet data directories together with the code something.py : \mylibrary \packages \foobar foo.zip bar.zip \alphabet abc.zip xyz.zip something.py setup.py And the goal is such that users can pip install the module as such: pip install mylibrary[alphabet] And that'll only include the data from the packages/alphabet/* data and the python code. Similar behavior should be available for pip install mylibrary[foobar] . If the user

Python Packaging multiple subpackages with different data directories

别说谁变了你拦得住时间么 提交于 2020-01-15 12:02:52
问题 I have a structure of the directory as such with foobar and alphabet data directories together with the code something.py : \mylibrary \packages \foobar foo.zip bar.zip \alphabet abc.zip xyz.zip something.py setup.py And the goal is such that users can pip install the module as such: pip install mylibrary[alphabet] And that'll only include the data from the packages/alphabet/* data and the python code. Similar behavior should be available for pip install mylibrary[foobar] . If the user

exception when installing setuptools on python 2.7.6

坚强是说给别人听的谎言 提交于 2020-01-15 05:37:09
问题 I'm installing setuptools for Python 2.7.6 on Windows 7 64-bit machine and get the following error C:\Python27\install_scripts>python ez_setup.py Extracting in c:\users\p\appdata\local\temp\tmpqhpyyh Now working in c:\users\p\appdata\local\temp\tmpqhpyyh\setuptools-2.1 Installing Setuptools Traceback (most recent call last): File "setup.py", line 17, in <module> exec(init_file.read(), command_ns) File "<string>", line 8, in <module> File "c:\users\p\appdata\local\temp\tmpqhpyyh\setuptools-2.1

Python 3.4 setuptools namespace setup does not work

馋奶兔 提交于 2020-01-15 05:00:09
问题 I am trying to create namespace packages for a modular project. The core system has the following packages homie homie.api homie.events homie.mods I want to install the respective modules as sub-packages of homie.mods . Therefor I provided the respective homie.__init__.py and homie.mods.__init__.py with the following content: from pkg_resources import declare_namespace declare_namespace(__name__) My testing module is structured as follows: homie homie/__init__.py homie/mods homie/mods/__init_

ImportError when using console_scripts in setuptools

纵饮孤独 提交于 2020-01-14 18:54:13
问题 I am trying to build a program called dnsrep in Python, I am using setuptools so that I can call the dnsrep module without using the command python dnsrep . The setup.py script I wrote is given below: from setuptools import setup, find_packages setup( name='dnsrep', version='0.1', description='Program that gives a reputation score to url\'s\n.', entry_points = { 'console_scripts': ['dnsrep = dnsrep:main'] }, zip_safe=True, ) I install the module by using the command: python setup.py install

ImportError when using console_scripts in setuptools

最后都变了- 提交于 2020-01-14 18:53:29
问题 I am trying to build a program called dnsrep in Python, I am using setuptools so that I can call the dnsrep module without using the command python dnsrep . The setup.py script I wrote is given below: from setuptools import setup, find_packages setup( name='dnsrep', version='0.1', description='Program that gives a reputation score to url\'s\n.', entry_points = { 'console_scripts': ['dnsrep = dnsrep:main'] }, zip_safe=True, ) I install the module by using the command: python setup.py install