setuptools

“setup.py upload” is failing with “Upload failed (401): You must be identified to edit package information”

冷暖自知 提交于 2019-12-18 10:26:51
问题 When running.. python setup.py sdist register upload ..I get the following output: running register We need to know who you are, so please choose either: 1. use your existing login, 2. register as a new user, 3. have the server generate a new password for you (and email it to you), or 4. quit Your selection [default 1]: 1 Username: example Password: ... Registering mypackage to http://pypi.python.org/pypi Server response (200): OK I can store your PyPI login so future submissions will be

Do python projects need a MANIFEST.in, and what should be in it?

你说的曾经没有我的故事 提交于 2019-12-18 09:58:40
问题 The "Python Distribute" guide (was at python-distribute.org, but that registration has lapsed) tells me to include doc/txt files and .py files are excluded in MANIFEST.in file The sourcedist documentation tells me only sdist uses MANIFEST.in and only includes file you specify and to include .py files. It also tells me to use: python setup.py sdist --manifest-only to generate a MANIFEST , but python tells me this doesn't exist I appreciate these are from different versions of python and the

install_requires in setup.py depending on installed Python version

我与影子孤独终老i 提交于 2019-12-18 07:45:13
问题 My setup.py looks something like this: from distutils.core import setup setup( [...] install_requires=['gevent', 'ssl', 'configobj', 'simplejson', 'mechanize'], [...] ) Under Python 2.6 (or higher) the installation of the ssl module fails with: ValueError: This extension should not be used with Python 2.6 or later (already built in), and has not been tested with Python 2.3.4 or earlier. Is there a standard way to define dependencies only for specific python versions? Of course I could do it

Difference between extras_require() and install_requires() in setup.py?

爷,独闯天下 提交于 2019-12-18 05:27:21
问题 I am trying to understand the difference between extras_require() and install_requires() in setup.py but couldn't get it. Both are used for installing Python dependencies, but what's the difference between them? 回答1: According to the setuptools documentation, extras_require A dictionary mapping names of “extras” (optional features of your project) to strings or lists of strings specifying what other distributions must be installed to support those features. and install_requires A string or

Add numpy.get_include() argument to setuptools without preinstalled numpy

南楼画角 提交于 2019-12-18 04:52:41
问题 I am currently developing a python package that uses cython and numpy and I want the package to be installable using the pip install command from a clean python installation. All dependencies should be installed automatically. I am using setuptools with the following setup.py : import setuptools my_c_lib_ext = setuptools.Extension( name="my_c_lib", sources=["my_c_lib/some_file.pyx"] ) setuptools.setup( name="my_lib", version="0.0.1", author="Me", author_email="me@myself.com", description=

setup.py exclude some python files from bdist

半世苍凉 提交于 2019-12-18 04:46:11
问题 I have a django project with this kind of architecture : setup.py project/ __init__.py manage.py settings/ __init__.py base.py dev.py urls/ __init__.py base.py dev.py I wanted to deploy it in a .egg without my 'dev.py' files. I tried different ways : first, with a find_packages(exclude=['*.dev','dev']) , then with a MANIFEST.in which contains : global-exclude dev.py The second solution seems to work when I do a sdist - with this warning when I install it : warning: no previously-included

Difference between setup.py install and setup.py develop

佐手、 提交于 2019-12-18 04:12:41
问题 I am trying to improve my workflow when developing python modules and have a rather basic question. What exactly happens when choosing either option. To my knowledge develop leaves the files in place so I can modify them and play around with the package whereas install copies them in the site-packages folder of my python installation. How is the package linked to my python installation when using the develop option. 回答1: develop creates an .egg-link file in the site-packages directory, which

ImportError: No module named extern

自闭症网瘾萝莉.ら 提交于 2019-12-18 03:57:09
问题 I'm getting this error when trying to install any package with pip. I have two pip instances, one with Python 2.7 and other with Python 3. Could not import setuptools which is required to install from a source distribution. Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 375, in setup_py import setuptools # noqa File "/usr/local/lib/python2.7/dist-packages/setuptools/__init__.py", line 11, in <module> from setuptools.extern.six

Distribute a Python package with a compiled dynamic shared library

喜夏-厌秋 提交于 2019-12-17 23:47:31
问题 How do I package a Python module together with a precompiled .so library? Specifically, how do I write setup.py so that when I do this in Python >>> import top_secret_wrapper It can easily find top_secret.so without having to set LD_LIBRARY_PATH ? In my module development environment, I have the following file structure: . ├── top_secret_wrapper │ ├── top_secret.so │ └── __init__.py └── setup.py Inside __init__.py , I have something like: import top_secret Here's my setup.py from setuptools

Packaging resources with setuptools/distribute

人走茶凉 提交于 2019-12-17 22:52:34
问题 I'm developing an Python egg that has several .txt dependencies (they're templates used to generate files by the egg itself), and I'm struggling to get those dependencies copied to site-packages during setup.py install . According to the distribute documentation... Filesystem of my package: setup.py package |--- __init__.py |--- main.py |--- binary (calls main.py with pkg_resources.load_entry_point) |--- templates |--file1.txt |--file2.txt In setup.py: setup( [...] eager_resources = [