setuptools

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

大城市里の小女人 提交于 2019-11-29 21:15:56
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 faster. (the login will be stored in /Users/dbr/.pypirc) Save your login (y/N)?y running upload Submitting

How do I write a setup.py for a twistd/twisted plugin that works with setuptools, distribute, etc?

試著忘記壹切 提交于 2019-11-29 20:27:42
The Twisted Plugin System is the preferred way to write extensible twisted applications. However, due to the way the plugin system is structured (plugins go into a twisted/plugins directory which should not be a Python package), writing a proper setup.py for installing those plugins appears to be non-trivial. I've seen some attempts that add 'twisted.plugins' to the 'packages' key of the distutils setup command, but since it is not really a package, bad things happen (for example, an __init__.py is helpfully added by some tools). Other attempts seem to use 'package_data' instead (eg, http:/

Python packages and egg-info directories

不想你离开。 提交于 2019-11-29 20:06:44
Can someone explain how egg-info directories are tied to their respective modules? For example, I have the following: /usr/local/lib/python2.5/site-packages/quodlibet/ /usr/local/lib/python2.5/site-packages/quodlibet-2.0.egg-info/ I'm assuming the egg-info directory is to make the corresponding module visible to setuptools (easy_install), right? If so, how does setuptools tie the egg-info directory to the module directory? Assuming that I'm on the right track, and for the sake of example... If I wanted to make an existing package of mine visible to setuptools, could I just symlink the module

Removing python module installed in develop mode

假装没事ソ 提交于 2019-11-29 19:30:24
Hi I was trying the python packaging using setuptools and to test I installed the module in develop mode. i.e python setup.py develop This has added my modules directory to sys.path. Now I want to remove the module is there any way to do this? Thanks in advance PJ Eby Use the --uninstall or -u option to develop , i.e: python setup.py develop --uninstall This will remove it from easy-install.pth and delete the .egg-link. The only thing it doesn't do is delete scripts (yet). Edit easy-install.pth in your site-packages directory and remove the line that points to your development version of that

setuptools vs. distutils: why is distutils still a thing?

一个人想着一个人 提交于 2019-11-29 18:49:56
Python has a confusing history of tools that can be used to package and describe projects: these include distutils in the Standard Library, distribute , distutils2 , and setuptools (and maybe more). It appears that distribute and distutils2 were discontinued in favor of setuptools , which leaves two competing standards. To my understanding setuptools offers far more options (e.g. declaring dependencies, tests, etc.) than distutils , however it is not included in the Python standard library (yet?). The Python Packaging User Guide [ 1 ] recommends now: Use setuptools to define projects and

setuptools的安装

孤者浪人 提交于 2019-11-29 18:37:49
Python 2.x: sudo apt-get install python-setuptools (python2.x版本执行此命令) Python 3.x: sudo apt- get install python3-setuptools (python3.x版本执行此命令) 来源: https://www.cnblogs.com/elitphil/p/11526472.html

install_requires in setup.py depending on installed Python version

有些话、适合烂在心里 提交于 2019-11-29 13:34:37
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 with if float(sys.version[:3]) < 2.6: but maybe there is a better way to do it. It's just a list, so

Change default dist folder with setuptools

送分小仙女□ 提交于 2019-11-29 11:36:30
问题 I'm using setuptools 0.6 to package my code. By default when I type python setup.py sdist , the tool creates a folder dist directly in the same folder of my script. What I can do to change this default folder? Edit: Another question is, if my setup script and my package folder are not in the same folder, what can I do to specify the exact path of the package? Thanks 回答1: Use the --dist-dir=[differentdir] option. From python setup.py sdist --help : --dist-dir (-d) directory to put the source

installing only .pyc (python compiled) with setuptools

我的梦境 提交于 2019-11-29 11:17:45
问题 I want to run python setup.py install (the setup script uses setuptools), and I want only the .pyc files to be included in the resulting egg or directory. all .py files must not be present. How can I do this ? 回答1: not with install , but a possibility is to run the following command python setup.py bdist_egg --exclude-source-files and install the resulting egg in dist with easy_install easy_install dist/eggname.egg Note that according to the manual install is nothing but a shortcut to easy

How can I make setuptools install a package from another source that's also available on pypi with the same version number?

牧云@^-^@ 提交于 2019-11-29 10:57:50
问题 It's a similar question to How can I make setuptools install a package that's not on PyPI? but not the same. As I would like to use the forked version of some package, setuptools ignore the dependency link (as it has the same version number). Is there a way to force using the link from the dependency_links? Or is the only way to change the version number in the forked repo? requires = [ ... 'pyScss==1.1.3' ... dependencies = [ 'https://github.com/nadavshatz/pyScss/zipball/master#egg=pyScss-1