setuptools

Provide a complex condition in install_requires ( Python setuptools's setup.py )

≡放荡痞女 提交于 2019-12-13 05:42:18
问题 Does anybody know how I can provide a complex condition in the "install_requires" section of setup.py? Something like this: install_requires = ['project1 >= 0.0.1 or project2 >=0.0.2', 'project3==0.9.0'] 回答1: You can write something like this: def choose_proper_prject( requires ): import pkg_resources for req in requires: try: pkg_resources.require( req ) return [ req ] except pkg_resources.DistributionNotFound : pass pass print “There are no proper project installation available” print “To

How to update git metadata in a Python Packages using Setuptools and PBR

一曲冷凌霜 提交于 2019-12-13 04:36:30
问题 Working with versions generated from git repo tags by pbr I'm having issues getting the version info from my package, which is setup as a normal Python package using setuptools with the pbr extension. pbr will pull the version info from the tags in a git repo so there is a single source of truth. I did get the basics working - see this Q&A for more info. It is working overall, if I make a full distribution of the package. For example: py setup.py sdist will create a full distribution and the

Install module to site-packages with setuptools

痞子三分冷 提交于 2019-12-13 03:25:34
问题 I'm trying to upload a CLI to PIP that, once installed, will run when the user types myscript My folder structure is like this: lib myscript __init__.py (empty) __main__.py (code that needs to run) utilities.py (needs to be imported from main) scripts myscript setup.py My setup.py should install the lib.myscript package and install myscript as a command-line module setup.py import setuptools setuptools.setup( name='myscript', version='1.0', scripts=['./scripts/myscript'], packages=['lib

How do you make an entry point to a script in a virtual environment available system-wide?

醉酒当歌 提交于 2019-12-13 03:18:02
问题 I'm using setuptools for python packaging where I define console script entry points the usual way in the setup.py file: setup.py # -*- coding: utf-8 -*- from setuptools import setup, find_packages setup(... name='my_project', entry_points={'console_scripts':['my_entry_name=my_package.scripts.my_python_script:main' ]}, ... ) After installing the package, I can call this entry point from a batch file like this: my_CURRENT_batch_file.command #!/bin/bash cd "$(dirname "$0")" # set the working

Why is an egg-info file created when I'm using distutils?

孤街浪徒 提交于 2019-12-12 19:08:19
问题 Below is my setup.py. I don't use anything from setuptools in my code and my project has no external dependencies #!/usr/bin/env python from distutils.core import setup setup(name='dots', ... packages=['dots','dots.configs','dots.management','dots.utils','dots.test'], scripts=['dots/dots.py'] ) When I run python setup.py install , I get the following running install running build running build_py running build_scripts running install_lib running install_scripts changing mode of /Users

appscript on OSX 10.6.3 / Python 2.6.1

柔情痞子 提交于 2019-12-12 18:23:31
问题 I am having some trouble getting appscript installed on OS/X 10.6.3 / Python 2.6.1. When I issue sudo easy_install appscript I get "unable to execute gcc-4.2: No such file or directory". Even when I do export CC=/Developer/usr/bin/gcc-4.2 (a valid gcc-4.2 executable), easy_install barks. What could be the issue? Disclaimer: OS/X newbie at the helm... 回答1: Rerun the Xcode installer and check "UNIX Development" - it will put compilers in /usr/bin in addition to /Developer. 回答2: I don't think

How can I use pbr version from source?

你。 提交于 2019-12-12 16:32:04
问题 My goal: I want to keep coherent versions in my GIT repository, my distribution on pypi repository, and in my source using the __version__ variable. Details: I tried to use pbr , which generates the distro version from git tags, so these two versions will be coherent. However, I cannot find out how to keep the __version__ variable coherent with them in my source. (There are several ways to fetch the version from source, but how will it be connected to git/distro?) Is it possible to generate a

setup.py's sdist, bdist and install behaving differently regarding data_files

☆樱花仙子☆ 提交于 2019-12-12 15:22:09
问题 I'm trying to distribute web assets along with a web app that I'm trying to package, but I'm failing miserably. I don't understand why I have a different list of files installed or packages when I run bdist, sdist, or install. Project Layout The project runs with python 3 on Arch. The results are the same with Py3 on Raspbian. I've done a very trimmed down version to make things simpler, which I describe here. The files layout is as follow : data/index.html MANIFEST.in mylib.py setup.py The

setuptools and passing options to dependencies

一世执手 提交于 2019-12-12 13:07:53
问题 I'm trying to package a module for pypi and I have mercurial as one of the dependencies. The target machines may or may not have build tools so I'd like to install mercurial with the --pure option in place, but I couldn't find a way to instruct setup.py to install the dependencies in a specified manner. Other than installing the deps separately, I couldn't find a way to do this. The best I have so far is https://groups.google.com/forum/?fromgroups#!topic/turbogears/t9rZAMSj_NQ Which although

Cx_Freeze cannot find pkg_resources/*.*'

主宰稳场 提交于 2019-12-12 12:14:02
问题 I'm trying to build an EXE using a cx_Freeze setup.py file with the following command: python setup.py bdist_msi The command's output ends with: Copying data from package pkg_resources... error: [Error 3] The system cannot find the path specified: 'C:\Program Files\Anaconda2\lib\site-packages\setuptools-27.2.0-py2.7.egg\pkg_resources/*.*' I'm not sure what to make of it. I've checked and the setuptools' egg exists, and inside it there is a pgk_resources library, and I'm not sure what to do. I