setuptools

Execute a Python script post install using distutils / setuptools

女生的网名这么多〃 提交于 2019-11-26 22:10:56
I'm trying to add a post-install task to Python distutils as described in How to extend distutils with a simple post install script? . The task is supposed to execute a Python script in the installed lib directory . This script generates additional Python modules the installed package requires. My first attempt is as follows: from distutils.core import setup from distutils.command.install import install class post_install(install): def run(self): install.run(self) from subprocess import call call(['python', 'scriptname.py'], cwd=self.install_lib + 'packagename') setup( ... cmdclass={'install':

Copy configuration file on installation

北战南征 提交于 2019-11-26 21:55:12
问题 I am trying to package my Python project, which comes with a configuration dotfile that I want copied into the user's home directory on installation. The quick guide to packaging says that this can be done using the data_files argument to setuptools.setup . So this is what I have: data_files = [(os.path.expanduser("~"), [".my_config"])] This appears to work fine if I use python setup.py install , but when I upload my package to PyPI and run pip install the dotfile isn't copied. FWIW, I've put

setuptools and pip: choice of minimal and complete install

会有一股神秘感。 提交于 2019-11-26 20:40:30
问题 We've made a library which depends on other libraries. But there are necessary (e.g. for server batch processing) and optional dependencies (e.g. for clients with GUI). Is something like this possible: pip install mylib.tar.gz # automatically downloads and installs with the minimal set of dependencies pip install mylib.tar.gz --install-option="complete" # automatically installs with all dependencies I've found the extra_require flag, but how can I tell pip to use them? The setup.py looks like

How can I include package_data without a MANIFEST.in file?

喜你入骨 提交于 2019-11-26 20:23:08
问题 How can I include package_data for sdist without a MANIFEST.in file? My setup.py looks like this: import setuptools setuptools.setup( name='foo', version='2015.3', license='commercial', packages=setuptools.find_packages(), package_data={'': ['foo/bar.txt']}, ) Versions: user@host> python Python 2.7.6 (default, Mar 22 2014, 22:59:56) >>> import setuptools >>> setuptools.version.__version__ '3.6' I just can't get foo/bar.txt included. Or is this blog post still true? http://blog.codekills.net

python setuptools install_requires is ignored when overriding cmdclass

旧城冷巷雨未停 提交于 2019-11-26 20:11:41
问题 I have a setup.py that looks like this: from setuptools import setup from subprocess import call from setuptools.command.install import install class MyInstall(install): def run(self): call(["pip install -r requirements.txt --no-clean"], shell=True) install.run(self) setup( author='Attila Zseder', version='0.1', name='entity_extractor', packages=['...'], install_requires=['DAWG', 'mrjob', 'cchardet'], package_dir={'': 'modules'}, scripts=['...'], cmdclass={'install': MyInstall}, ) I need

pip ignores dependency_links in setup.py

时光总嘲笑我的痴心妄想 提交于 2019-11-26 19:45:09
I have dependency_links in my setup.py: ... dependency_links = ['http://github.com/robot-republic/python-s3/tarball/master.tar.gz#egg=python-s3'], ... But it doesn't work. However install_requires works fine. Maybe there are another method to set up git repo as required for setup.py? Laur Ivan This answer should help. In a nutshell, you need to specify the version (or "dev") for the #egg=python-s3 so it looks like #egg=python-s3-1.0.0 . Updates based on @Cerin's comment: Pip 1.5.x has a flag to enable dependency-links processing: --process-dependency-links . I haven't tested it because I agree

Why can I not create a wheel in python?

别来无恙 提交于 2019-11-26 18:52:53
问题 Here are the commands I am running: $ python setup.py bdist_wheel usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: setup.py --help [cmd1 cmd2 ...] or: setup.py --help-commands or: setup.py cmd --help error: invalid command 'bdist_wheel' $ pip --version pip 1.5.6 from /usr/local/lib/python3.4/site-packages (python 3.4) $ python -c "import setuptools; print(setuptools.__version__)" 2.1 $ python --version Python 3.4.1 $ which python /usr/local/bin/python Also, I am

Is it possible to require PyQt from setuptools setup.py?

99封情书 提交于 2019-11-26 18:22:38
问题 I'm building a small app that uses PyQt and tought it'd be nice to declare that dependency in setup.py. However, according to this blog (first hit on google for pyqt setuptools) says it can't be done, and the last paragraph here doens't try to do it either. Ideas? Perhaps I should switch to PySide which is on PyPi? Update: The obvious install_requires = [ 'pyqt >= 0.7' ] in setup.py gives me: D:\3rd\BuildBotIcon\my-buildboticon\python>setup.py test running test install_dir . Checking .pth

Why is pip installing an old version of my package?

泪湿孤枕 提交于 2019-11-26 18:00:41
问题 I've just uploaded a new version of my package to PyPi (1.2.1.0-r4): I can download the egg file and install it with easy_install, and the version checks out correctly. But when I try to install using pip, it installs version 1.1.0.0 instead. Even if I explicitly specify the version to pip with pip install -Iv tome==1.2.1.0-r4 , I get this message: Requested tome==1.2.1.0-r4, but installing version 1.1.0.0 , but I don't understand why. I double checked with parse_version and confirmed that

How do I set up Setuptools for Python 2.6 on Windows?

偶尔善良 提交于 2019-11-26 17:56:00
问题 Is there any way to install Setuptools for Python 2.6 in Windows without having an exe installer? There isn't one built at the moment, and the maintainer of Setuptools has stated that it will probably be a while before he'll get to it. Does anyone know of a way to install it anyway? 回答1: First Option - Online Installation (i.e. remaining connected to the Internet during the entire installation process): Download setuptools-0.6c9.tar.gz Use 7-zip to extract it to a folder(directory) outside