setuptools

pip install test dependencies for tox from setup.py

情到浓时终转凉″ 提交于 2019-11-27 23:23:58
问题 I made my project with setuptools and I want to test it with tox . I listed dependencies in a variable and added to setup() parameter ( tests_require and extras_require ). My project needs to install all of the dependencies listed in tests_require to test but pip install is not installing them. I tried this but it did not work: install_command = pip install {opts} {packages}[tests] How can I install test dependencies without having to manage multiple dependency lists (i.e. Having all

Determining the location of distutils data files programmatically in Python

雨燕双飞 提交于 2019-11-27 21:18:59
问题 I'm trying to include data files in distutils for my package and then refer to them using relative paths (following http://docs.python.org/distutils/setupscript.html#distutils-additional-files) My dir structure is: myproject/ mycode.py data/ file1.dat the code in mycode.py , which is actually a script in the package. It relies on accessing data/file1.dat , refer to it using that relative path. In setup.py , I have: setup( ... scripts = "myproject/mycode.py" data_files = [('data', 'myproject

Installing numpy as a dependency with setuptools

允我心安 提交于 2019-11-27 21:14:42
问题 This might be a follow up question of this one. I am using setuptools to install a package of mine. As a dependency I have listed numpy. I am using Python2.7 and when I do python setup.py install with this setup.py file: from setuptools import setup setup(name = "test_pack", install_requires = ["numpy"]) I end up with this error message: ImportError: No module named numpy.distutils What do I need to do in order to include numpy as a dependency and install it without having python-dev

python setuptools install_requires is ignored when overriding cmdclass

廉价感情. 提交于 2019-11-27 20:08:35
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 MyInstall because I want to install some libraries from github and I didn't want to use dependency_links

How to distribute `.desktop` files and icons for a Python package in Gnome (with distutils or setuptools)?

十年热恋 提交于 2019-11-27 18:17:39
问题 Currently I'm using the auto-tools to build/install and package a project of mine, but I would really like to move to something that feels more "pythonic". My project consists of two scripts, one module, two glade GUI descriptions, and two .desktop files. It's currently a pure python project, though that's likely to change soon-ish. Looking at setuptools I can easily see how to deal with everything except the .desktop files; they have to end up in a specific directory so that Gnome can find

Managing resources in a Python project

纵然是瞬间 提交于 2019-11-27 17:42:16
I have a Python project in which I am using many non-code files. Currently these are all images, but I might use other kinds of files in the future. What would be a good scheme for storing and referencing these files? I considered just making a folder "resources" in the main directory, but there is a problem; Some images are used from within sub-packages of my project. Storing these images that way would lead to coupling, which is a disadvantage. Also, I need a way to access these files which is independent on what my current directory is. You may want to use pkg_resources library that comes

setuptools troubles — excluding packages, including data files

霸气de小男生 提交于 2019-11-27 17:33:23
问题 I'm fairly new to setuptools. I've seen a few similar questions and it drives a little bit insane that I've seemed to follow advice I saw but setuptools still does something different than what I want. Here is the structure of my project: . .. package1/ __init__.py abc.py ... tests/ __init__.py test_package1.py LICENSE README.md RELEASE setup.py And here is the contents of my setup.py: #!/usr/bin/env python import os #from distutils.core import setup from setuptools import setup, find

Questions about Setuptools and alternatives

心不动则不痛 提交于 2019-11-27 17:32:28
I've seen a good bit of setuptools bashing on the internets lately. Most recently, I read James Bennett's On packaging post on why no one should be using setuptools. From my time in #python on Freenode, I know that there are a few souls there who absolutely detest it. I would count myself among them, but I do actually use it. I've used setuptools for enough projects to be aware of its deficiencies, and I would prefer something better. I don't particularly like the egg format and how it's deployed. With all of setuptools' problems, I haven't found a better alternative. My understanding of tools

Why can I not create a wheel in python?

为君一笑 提交于 2019-11-27 17:11:15
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 running a mac with homebrewed python Here is my setup.py script: https://gist.github.com/cloudformdesign

Enforcing python version in setup.py

岁酱吖の 提交于 2019-11-27 17:09:21
问题 Currently, we are setting\installing up some packages on system by mentioning their version and dependencies in setup.py under install_requires attribute. Our system requires python 2.7. Sometimes, users are having multiple versions of python say 2.6.x and 2.7, some packages it says are available already but actually on the system available under 2.6 site packages list. Also some users has 2.6 only, how to enforce from setup.py or is there any other way to say to have only python 2.7 and all