egg

How to easy_install egg plugin and load it without restarting application?

家住魔仙堡 提交于 2019-12-18 12:05:51
问题 I'm creating an app that downloads and installs its own egg plugins, but I have a problem loading the egg after easy_install extracts it into place. This is how it works now: App downloads egg into temp folder Installs egg with setuptools.command.easy_install.main() into ~/.app/plugins folder (which is pointed by a pth on dist-packages) At this point, the ~/.apps/plugins/easy-install.pth is updated with the new egg path The problem is that the pth is not reloaded until the python process is

Most Pythonic way to provide global configuration variables in config.py?

℡╲_俬逩灬. 提交于 2019-12-17 23:37:30
问题 In my endless quest in over-complicating simple stuff, I am researching the most 'Pythonic' way to provide global configuration variables inside the typical ' config.py ' found in Python egg packages. The traditional way (aah, good ol' #define !) is as follows: MYSQL_PORT = 3306 MYSQL_DATABASE = 'mydb' MYSQL_DATABASE_TABLES = ['tb_users', 'tb_groups'] Therefore global variables are imported in one of the following ways: from config import * dbname = MYSQL_DATABASE for table in MYSQL_DATABASE

Bundle python script and dependencies into a single file

百般思念 提交于 2019-12-17 13:04:54
问题 I have a few script that had their own copy of a some functions, so I extracted these functions to a module and had the scripts import the function. These script are to be copied over to a bunch of linux servers and executed. When the scripts worked standalone, I would simply copy the files over to the servers and execute "python ". I have a central management server that will copy and run the scripts on the different servers. I've done some reading on python eggs, but could use some advice

Bundle python script and dependencies into a single file

半世苍凉 提交于 2019-12-17 13:03:50
问题 I have a few script that had their own copy of a some functions, so I extracted these functions to a module and had the scripts import the function. These script are to be copied over to a bunch of linux servers and executed. When the scripts worked standalone, I would simply copy the files over to the servers and execute "python ". I have a central management server that will copy and run the scripts on the different servers. I've done some reading on python eggs, but could use some advice

eggjs入坑

人盡茶涼 提交于 2019-12-17 06:07:37
egg官网 跟着官网文档走一遍,基本就可以入门了,剩下的就是一些开发遇到的问题了 1、新版的egg中的eslint有点烦人,就关了一些错误提示 // .eslintrc { "extends" : "eslint-config-egg" , "rules" : { // 缩进 "indent" : "off" , // 句末分号 "semi" : "off" , // 引号 "quotes" : "off" , // 严格模式 "strict" : "off" , // 数组和对象键值对最后一个逗号 "comma-dangle" : "off" } } 2、虽然是作为后台提供api接口,但偶尔也是要向第三方请求数据,发现axios也可以用于node,并且自身提供promise,于是我就拿它替代request + request-promise 3、插件的配置:一般配置plugin时都要同时配置plugin.js和config.default.js,下面是一些常用的插件,可在官网找到plugin的github入口: egg-parameters 合并get、post参数 Merge all parameters (ctx.params, ctx.request.query, ctx.request.body) into ctx.params like Rails

What is a Python egg?

点点圈 提交于 2019-12-17 02:01:04
问题 I'm new to Python and am just trying to understand how its packages work. Presumably "eggs" are some sort of packaging mechanism, but what would be a quick overview of what role they play and maybe some information on why they're useful and how to create them? 回答1: Note: Egg packaging has been superseded by Wheel packaging. Same concept as a .jar file in Java, it is a .zip file with some metadata files renamed .egg , for distributing code as bundles. Specifically: The Internal Structure of

How to unzip python eggs?

若如初见. 提交于 2019-12-12 14:01:24
问题 I'm trying to bundle some egg dependencies when using py2exe and as stated on the py2exe site, it doesn't work with those and I need to unzip them first. I've tried to first run easy_install -m lxml and then easy_install --always-unzip lxml==2.2.2 , but it didn't work. Then I tried to set the unzipping behaviour to default by putting it to distutils.cfg . I didn't find the latter file, so I've made the HOME environment variable and created a pydistutils.cfg file there with this content: [easy

Easy_install's --prefix option doesn't change where it tries to install my package

别来无恙 提交于 2019-12-12 12:05:28
问题 I want to install Sphinx 1.1.3 for python 2.6. However, I don't have sudo rights. So instead of installing it in the default place, I want to set a different location, using --prefix. Doing the following: -bash-3.2$ easy_install Sphinx-1.1.3-py2.6.egg --prefix=/homes/ndeklein/python2.6/site-packages/ gives me: error: can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: [Errno 13] Permission denied: '

What are the benefits and downsides of using the Python packaging *.egg format over a simple directory with setup.py?

风格不统一 提交于 2019-12-12 08:16:14
问题 When I release a program, I usually just create a setup.py and put it on pypi. It's installable with pip, I can always share it easily with others. It works for me, and apparently for a lot of people. I see the benefit of making an exe, a deb or a rmp to easy sysadmin. But I really don't see the point of using eggs. Can you tell me what can I gain from it ? I also once read that eggs had downsides, but I can't find the article anymore. Could you describe to me what problems using this

Python - pip install pyublas : Could Not Build The Egg

帅比萌擦擦* 提交于 2019-12-12 01:49:08
问题 I'm having trouble installing PyUblas on Ubuntu 14.04, via pip. I am using Python 2.7.6. Here goes the log : Traceback (most recent call last): File "setup.py", line 248, in <module> scripts = scripts, File "/usr/lib/python2.7/distutils/core.py", line 111, in setup _setup_distribution = dist = klass(attrs) File "/tmp/tmpJjyKIr/distribute-0.6.35/setuptools/dist.py", line 225, in __init__ _Distribution.__init__(self,attrs) File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__ self