setuptools

Why is dependency links in setup.py deprecated?

六眼飞鱼酱① 提交于 2019-12-03 15:13:14
There are quite a few people wondering for an alternative to dependency links in the setup.py (activated with the pip flag --process-dependency-links ): What is the alternative to using --process-dependency-links with pip , Depend on git repository in setup.py . Basically, I got bitten by the deprecation warning: "DEPRECATION: Dependency Links processing has been deprecated and will be removed in a future release." Some people have suggested using requirements.txt , however that is not an alternative as it is meant to provide an entire environment, usually more associated with development. The

Babel: compile translation files when calling setup.py install

我们两清 提交于 2019-12-03 14:35:00
I'm developing a Flask application using Babel. Thanks to Distutils/Setuptools Integration , all the parameters of compile/extract/... functions are stored in setup.cfg and compiling the i18n files is as easy as ./setup.py compile_catalog Great. Now I would like this to be done automatically when running ./setup.py install In make 's words, that would be letting install target depend on compile_catalog target. The context We store only translation ( .po ) files in the code repository. .gitignore excludes .mo and .pot files from being tracked. When a developer pulls a new revision of the code,

Is `setup.cfg` deprecated?

天大地大妈咪最大 提交于 2019-12-03 13:37:05
It's not completely clear to me, what is the status of setup.cfg . I am looking for solutions for my other question about PEP 508 environment markers, and I became totally confused. To me it seems that setup.cfg is an improvement over setup.py , because it's declarative, does not involve running arbitrary code to make package installable, makes it harder to distribute malicious Python packages, makes it easier to run Python package registries etc. So, here in setuptools docs it's mentioned that setuptools got support for setup.cfg in 30.3.0 (8 Dec 2016) version, which is quite recent. So, this

Can I define optional packages in setuptools?

十年热恋 提交于 2019-12-03 13:01:04
Currently one of my packages requires a JSON parser/encoder, and is designed to use simplejson if available falling back to the json module (in the standard library) if necessary (as benchmarks show simplejson is faster). However, recently it's been hit & miss as to whether simplejson will install when using zc.buildout - something with the move to github, I believe. Which got me wondering; is it possible to define optional packages in my setup.py file which, if unavailable, won't stop the installation of my package? optional packages at installation time. I am assuming you are talking about

easy_install with pypy while Python is installed

社会主义新天地 提交于 2019-12-03 12:45:51
I installed PyPy while still having Python 2.7 on my system. How do I install and then use easy_install with PyPy? What is the syntax for distinguishing where I want to install to with easy_install ? Should I set any environment variables for ease of use? I'm on Windows, but these questions seem relevant for all platform... Julien Chappuis You need to install easy_install for pypy manually. It's explained in the answer to this question : Installing Python eggs under PyPy An alternative solution is to install pip. Following the instructions in pip's documentation : wget https://bootstrap.pypa

Accessing data files before and after distutils/setuptools

和自甴很熟 提交于 2019-12-03 11:46:25
I'm doing a platform independent PyQt application. I intend to use write a setup.py files using setuptools. So far I've managed to detech platform, e.g. load specific options for setup() depending on platform in order to use py2exe on Windows... etc... However, with my application I'm distributing some themes, HTML and images, I need to load these images in the application at runtime. So far they are stored in the themes/ directory of the application. I've been reading documentation on setuptools and distutils, and figured out that if I gave setup() the data_files options with all the files in

How do I create Python eggs from distutils source packages?

余生颓废 提交于 2019-12-03 10:50:42
I vaguely remember some sort of setuptools wrapper that would generate .egg files from distutils source. Can someone jog my memory? setuptools monkey-patches some parts of distutils when it is imported. When you use easy_install to get a distutils-based project from PyPI, it will create an egg (pip may do that too). To do the same thing locally (i.e. in a directory that’s a code checkout or an unpacked tarball), use this trick: python -c "import setuptools; execfile('setup.py')" bdist_egg . Have you tried python setup.py bdist_egg Here I assume you are using setuptools instead of distutils i.e

How can I make setuptools (or distribute) install a package from the local file system

放肆的年华 提交于 2019-12-03 09:48:20
Is it possible to specify (editable) source dependencies in setup.py that are known to reside on the local file system? Consider the following directory structure, all of which lives in a single VCS repository: projects utils setup.py ... app1 setup.py ... # app1 files depend on ../utils app2 setup.py ... # app2 files depend on ../utils Given the following commands: cd projects mkvirtualenv app1 pip install -e app1 I'd like to have all the dependencies for app1 installed, including "utils", which is an "editable" dependency. Likewise, if I did the same for app2. I've tried playing with all

How to disable uploading a package to PyPi unless --public is passed to the upload command

为君一笑 提交于 2019-12-03 08:53:21
I'm developing packages and uploading development/testing/etc versions of my packages to a local devpi server. In order to prevent an accidental upload to PyPi, I'm adopted the common practice of: setup(..., classifiers=[ "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Private :: Do not Upload" ], ...) which works great, but what about when I'm finally ready to upload the package to PyPi? I've come up with a totally ugly, but simple hack which requires that I define the classifiers as a global variable outside of the setup()

Trouble Installing Scrapy on 10.9 Mavericks

匿名 (未验证) 提交于 2019-12-03 07:50:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to install Scrapy using my homebrew python build. Despite having everything up to date, installed and in my path, I cant use it. Here's my order of operations: check brew: $ brew doctor Your system is ready to brew. check python & pip: $ which python /usr/local/bin/python $ python --version Python 2.7.6 $ which pip /usr/local/bin/pip $ pip -- version pip 1.5.4 from /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pip-1.5.4-py2.7.egg (python 2.7) (is this normal? this looks like