setuptools

Packages in same namespace: can't import module in setup script

*爱你&永不变心* 提交于 2019-12-10 11:31:35
问题 I'm curious about the following situation. Let's say I have two projects named project_alpha and project_bravo , both defining a top-level namespace package mymeta . The layout: project_alpha/ -> mymeta/ -> __init__.py -> project_alpha/ -> __init__.py -> version.py -> setup.py project_bravo/ -> mymeta/ -> __init__.py -> project_bravo/ -> __init__.py -> version.py -> setup.py Both mymeta/__init__.py s contain only the line __import__('pkg_resources').declare_namespace(__name__) (according to

Python package setup script install binary executable

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 09:21:38
问题 I have a package awesomepkg with setup.py . I'd like to install a binary executable awesometool to the command line along with the package itself when users run pip install awesomepkg . I have compiled different OS versions for awesometool , which lives in a bin/ folder beside setup.py . However, I can't find a good way to configure setup.py . I have attempted the following: Use the scripts=[] keyword in setup() . Unfortunately, the "executable" must be a python script. So I try to wrap the

源码安装python及paramikon的初步试用

邮差的信 提交于 2019-12-10 05:19:54
Auth: jin Date: 20140314 OS: CentOS release 5.5 (Final) 默认2.4版本 莫 1.download wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz 2.install python tar -zxvf Python-2.7.6.tgz && cd Python-2.7.6 ./configure --prefix=/usr/local/python27/ make && make install PIPY wget https://pypi.python.org/packages/source/p/pip/pip-1.5.4.tar.gz 由于下载pip是基于https协议的,故需要在wget url后面加上--no-check-certificate,否则不能下载: tar -zxvf pip-1.5.4.tar.gz && cd pip-1.5.4 [root@ZJ-mnt-host-1 pip-1.5.4]# /usr/local/python27/bin/python setup.py build Traceback (most recent call last): File "setup.py", line 6, in <module> from

Distutils appharently fails with a (working) SWIG extension

隐身守侯 提交于 2019-12-10 03:54:02
问题 I am wrapping via SWIG a C library in a python module, here called "myExample". If I compile: $swig -python myExample.i $gcc -c myExample_wrap.c -I /usr/lib/python2.7 -fPIC -std=c99 $ld -shared myExample_wrap.so -llapacke -o _myExample.so I obtain a full working module (liblapacke is necessary for some functions I used). Now I'd like to make this module installable via "pip install". According to the distutils section (https://docs.python.org/2.7/distutils/setupscript.html), I wrote my setup

Install numpy + pandas as dependency in setup.py

拈花ヽ惹草 提交于 2019-12-10 03:36:09
问题 Installing numpy + pandas via setuptools as dependency in setup.py does not work for me. It is not about missing dependencies. If I install numpy via pip install numpy and afterwards python setup.py develop everything works fine. If I understand the setuptools documentation right, all packages are build first and then installed. So numpy is build, but not installed when pandas is build. As a workaround I added numpy to my setup_requires . That works fine, but is obviously not a very clean

Difference between pip3 and `python3 setup.py install` regarding cmdclass argument

白昼怎懂夜的黑 提交于 2019-12-10 03:12:35
问题 I tried to configure my package such that a script is executed on the installation process. Therefore, I inherited from setuptools.command install and created my custom class ActionOnInstall to do stuff when package is installed. This class is called via setuptools setup() argument cmdclass as described here. A minimal example of such a setup.py file looks like from setuptools import find_packages, setup from setuptools.command.install import install class ActionOnInstall(install): def run

Python setuptools is stripping slashes from path arguments on Windows

北城余情 提交于 2019-12-10 02:29:03
问题 I'm trying to install a package with setuptools including console_scripts on Windows 7. I'm trying to change the value of my PYTHONUSERBASE to install into a custom directory with the --user flag. If I use backslashes in the value of PYTHONUSERBASE , as in set PYTHONUSERBASE=C:\testing everything works fine. However, if I use a forward slash, as in set PYTHONUSERBASE=C:/testing the package itself installs to the right place, but the console_scripts (and only the console_scripts ) are

Pyinstaller on a setuptools package

早过忘川 提交于 2019-12-10 02:11:45
问题 I'm attempting to run PyInstaller on a CLI app I am building in Python using the Click library. I'm having trouble building the project using PyInstaller. PyInstaller has a document in their GitHub wiki titled Recipe Setuptools Entry Point, which gives information about how to use PyInstaller with a setuptools package, which I'm using for this project. However, it seems it cannot find the base module when I run pyinstaller --onefile main.spec . My question is: Is the problem simply an issue

setuptools: force version of another package (if present) while not forcing installation of this package (when not present)

落花浮王杯 提交于 2019-12-09 21:09:48
问题 During development of Pylint, we encountered interesting problem related to non-dependency that may break pylint package. Case is following: python-future had a conflicting alias to configparser package. Quoting official docs: This release removes the configparser package as an alias for ConfigParser on Py2 to improve compatibility with Lukasz Langa’s backported configparser package. Previously python-future and the configparser backport clashed, causing various compatibility issues. (Issues

What is the preferred conventional way of incorporating a third party library in Python open source projects?

徘徊边缘 提交于 2019-12-09 18:22:16
问题 I'm working on a new Python authentication library for WSGI frameworks and want to use the python-openid and maybe some other third-party libs too. I see 2 options: Distribute my library with a copy of the third-party library inside (via GIT submodules) Let the user of my library resolve the dependency on the third-party library by himself The question is: What is the preferred conventional way of incorporating a third party library in Python open source projects? 回答1: The preffered way is to