setuptools

Compiling & installing C executable using python's setuptools/setup.py?

淺唱寂寞╮ 提交于 2019-12-04 10:36:25
问题 I've got a python module that calls an external binary, built from C source. The source for that external executable is part of my python module, distributed as a .tar.gz file. Is there a way of unzipping, then compiling that external executable, and installing it using setuptools/setup.py? What I'd like to achieve is: installing that binary into virtual environments manage compilation/installation of the binary using setup.py install , setup.py build etc. making the binary part of my python

Using easy_install inside a python script?

狂风中的少年 提交于 2019-12-04 10:12:27
问题 easy_install python extension allows to install python eggs from console like: easy_install py2app But is it possible to access easy_install functionality inside a python script? I means, without calling os.system( "easy_install py2app" ) but instead importing easy_install as a python module and using it's native methods? 回答1: When I look at the setup tools source, it looks like you can try the following. from setuptools.command import easy_install easy_install.main( ["-U","py2app"] ) 回答2:

How can I make setuptools ignore subversion inventory?

ぐ巨炮叔叔 提交于 2019-12-04 10:03:00
问题 When packaging a Python package with a setup.py that uses the setuptools: from setuptools import setup ... the source distribution created by: python setup.py sdist not only includes, as usual, the files specified in MANIFEST.in, but it also, gratuitously, includes all of the files that Subversion lists as being version controlled beneath the package directory. This is vastly annoying. Not only does it make it difficult to exercise any sort of explicit control over what files get distributed

Python's setup.py installed CLI script doesn't allow importing same module

非 Y 不嫁゛ 提交于 2019-12-04 08:59:41
I want to create a python app named knife that can be executed from CLI, the problem is that it can't import the modules. I followed the same folder structure as the Django project for reference. My directory structure is like this: knife/ knife/ bin/ knife-cli.py core/ main/ __init__.py __init__.py __init__.py setup.py My setup.py looks like this: #!/usr/bin/env python from setuptools import setup, find_packages exclude = ['knife.bin'] setup(name='Knife', version='0.3', description='Very cool project', author='John Doe', author_email='author@email.com', packages=find_packages(exclude=exclude)

Can you set conditional dependencies for Python 2 and 3 in setuptools?

为君一笑 提交于 2019-12-04 08:20:20
问题 When releasing a Python egg with support for both Python 2 and 3, can you specify dependencies that change depending on which version you're using? For example, if you use dnspython for Python 2, there is a Python 3 version that is called dnspython3 . Can you write your setuptools.setup() function in such a way that your egg is useable to both versions if that is the only roadblock, i.e., if you have run 2to3 to ensure that the rest of your library is compatible with both versions. I have

Create a python executable using setuptools

冷暖自知 提交于 2019-12-04 08:05:44
问题 I have a small python application that I would like to make into a downloadable / installable executable for UNIX-like systems. I am under the impression that setuptools would be the best way to make this happen but somehow this doesn't seem to be a common task. My directory structure looks like this: myappname/ |-- setup.py |-- myappname/ | |-- __init__.py | |-- myappname.py | |-- src/ | |-- __init__.py | |-- mainclassfile.py | |-- morepython/ | |-- __init__.py | |-- extrapython1.py | |--

setup.py check if non-python library dependency exists

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 07:29:01
I'm trying to make a setup.py for cgal-bindings . To install this, the user needs to have at least a certain version of CGAL. In addition, CGAL has a few optional targets that should be built if the user has some libraries (like Eigen3). Is there a cross-platform way in Python to check for this? I can use find_library in ctypes.util to check if the library exists, but I don't see any easy way to get the version . <-- This doesn't actually work all the time, some libraries are header-only like eigen3, which is a C++ template library. Using the install_requires argument of setup() only works for

Setuptools not passing arguments for entry_points

天大地大妈咪最大 提交于 2019-12-04 05:20:27
I'm using setuptools for a Python script I wrote After installing, I do: $ megazord -i input -d database -v xx-xx -w yy-yy Like I would if I was running it ./like_this However, I get: Traceback (most recent call last): File "/usr/local/bin/megazord", line 9, in <module> load_entry_point('megazord==1.0.0', 'console_scripts', 'megazord')() TypeError: main() takes exactly 1 argument (0 given) Which looks like setuptools is not sending my arguments to main() to be parsed (by optparse) Here's my setuptools config for entry_points: entry_points = { 'console_scripts': [ 'megazord = megazord.megazord

install pyopencv with pip on Mac OS X

最后都变了- 提交于 2019-12-04 05:17:35
I am trying to install pyopencv with pip in OS X Mountain Lion and it fails by import setuptools. Following is my work. what is "Library" in setuptools? I have not seen that before. I already installed opencv via homebrew and other things. In doucmentation of pyopencv, it doesn't explain installation with pip only source install, (img2)appleparan@LiamMac src $ brew install cmake Warning: cmake-2.8.11.2 already installed (img2)appleparan@LiamMac src $ brew install cmake --upgrade Warning: cmake-2.8.11.2 already installed (img2)appleparan@LiamMac src $ brew install opencv Warning: opencv-2.4.6.1

Python - Is there any way to get pip without setuptools?

半城伤御伤魂 提交于 2019-12-04 04:50:47
Seems kinda weird that they'd require a package manager to install a package manager. I'm on Windows BTW. Pip does require setuptools. Pip is really just a wrapper around setuptools to provide a better installer than easy_install and some nicer installation behaviors, plus uninstall, requirements files, etc. Even if you somehow got pip installed without setuptools it still won't run without it. You can use Distribute instead of setuptools : it installs a package called setuptools (it's a fork of the latter). You can install Distribute by downloading and running distribute_setup.py . Update: As