I Am trying to create a buildout recipe for pywhois on google code.
The site of which is here:
http://code.google.com/p/pywhois/
Note: if you use easy_install pywhois it installs another package from pypi (python package index) : http://pypi.python.org/pypi/pywhois/0.1
I Am following the documentation on buildout recipe... (http://pypi.python.org/pypi/djangorecipe/1.3)
and I found out I can clone the sourcecode from here:
hg clone https://code.google.com/p/pywhois/
but I can't get it all stick together in a working buildout script... (to be honoust, this is my first buildout script trial... for all other packages I found an existing recipe and normally I try to avoid anything that's not on pypi)
i created 2 issues on their site... on of them is to use another name than in the python package index, the other one is to get their package over there.
Any buildout guru?
EDIT
(already 2 guys trying to help me, thanks!)
I used this in my buildout.conf:
extensions =
buildout.dumppickedversions
mr.developer
auto-checkout = pywhois
and added to my list develop:
develop = src/pywhois
and added to my egg list:
eggs =
myproject
pywhois
and declared the source of the repo:
[sources]
pywhois = hg https://code.google.com/p/pywhois/
and off course add to eggs: pywhois
and it's downloading it and creating an egg...
EDIT2
Whatever I do, I keep getting: Source URL for existing package 'pywhois' differs. Expected 'https://code.google.com/p/pywhois/'.";
It seems to me if the package-name of the google code package is gonna be changed, that this issue will be solved... I aleady got response on the issue tracker about this.
see http://code.google.com/p/pywhois/issues/detail?id=33
EDIT 3: Now on PyPI: python-whois
And, a brilliant quick action from the developer (Richard Penman). So the package is renamed to python-whois (he is thinking about another name, but for now this works). And he put it on pypi!
So this issue is resolved for me, but the answers of Martijn and Reinout learned me a lot more about buildout, thanks!
I'd use mr.developer to grab a local checkout, and use it as a development egg:
[buildout]
extensions = mr.developer
auto-checkout = pywhois
[sources]
pywhois = hg https://code.google.com/p/pywhois/
Now mr.developer will check out pywhois into src/, run it's setup.py to make it a development egg, and tell buildout it's available as such. Now buildout will use that local copy to satisfy any pywhois requirement.
Related
I'm using Pelican for a static blog, and attempting to install the figure-ref extension. Since I'm using Markdown, the plugin relies on the figureAltCaption third-party Markdown extension. However I have no idea how to install it.
Pelican has an MD_EXTENSIONS configuration option, but I've tried a few obvious options with no luck. It seems like this is a dead-simple gimme but it's not clear how to proceed. Would love some suggestions.
Unfortunately, the author of figureAltCaption appears to have not provided an install script. My suggestion would be to create one and contribute it as a pull request. This tutorial about creating Extensions for Python-Markdown covers creating an install script as well.
However, as a shortcut, you should be able to just copy the figureAltCaption.py file to the appropriate directory. Usually you want the site-packages directory. As this answer shows, just do the following from Python:
>>> import site; site.getsitepackages()
Then copy the figureAltCaption.py file to the first directory returned.
Now that the extension is on your PYTHONPATH, it should be importable. From the Python prompt, try:
import figureAltCaption
If you get no errors, then it worked and you just need to tell Pelican about it.
MD_EXTENSIONS = ['figureAltCaption']
Converting from Grunt to Brunch, and I would like to convert my .svg icons in the folder fonts/ to cross-browser compatible webfonts (woff, eot, ttf, etc) but I haven't found such plugins for Brunch.
Something similar like: github.com/sapegin/grunt-webfont
I've been looking at some different approaches, like building my own brunch-plugin and wrapping with an existing library (Font Custom).
Any suggestions on a better approach? Or are there any webfonts-plugins I've missed for Brunch?
I came across this having a similar issue and solved it with a Brunch-referenced plugin: copyfilemon
https://github.com/kasselTrankos/copyfilemon-brunch
$ npm install copyfilemon-brunch
Add this to your Brunch config under "plugins" (I use coffee-script and bower for managing bootstrap):
copyfilemon:
'fonts': 'bower_components/bootstrap/fonts'
This will copy all files from 'bower_components/bootstrap/fonts' into our Brunch configured public directory under the sub-folder 'fonts'.
Note: It will copy the files every time you run/watch Brunch, which should not do any harm other than taking up some resources for a few ms.
I am trying to install a homegrown package that will be used , but python package installation is still a bit of a quagmire for me, and I haven't gotten this to work.
I created a package using setup.py sdist, which I uploaded to a repository
I am trying to install my package on another machine. I tried three methods, each time on an entirely clean machine. But none are doing what I want them to.
Method 1
easy_install http://mysite/mypkg.zip
RESULT: mypkg.egg gets added to \Python27\Lib\site-packages. But none of my folder structure is there
Method 2
pip install http://mysite/mypkg.zip
RESULT: two folders, mypkg and mypkg-1.0-py2.7.egg-info, get added to Python27\Lib\site-packages. All of the files seem to be there. But when I got to import or run nosetests on the folder, I get all sorts of import errors that reference mypkg modules. I have played with PATH and PYTHONPATH to get all variations of including the folder, but nothing has worked.
Method 3
download .zip
extract locally
add folder to PATH
run easy_install . in the local dir
RESULT: unpacks pkg locally. When I run nosetests on this folder, everything runs as expected.
Thing is, I don't want each user to have to do all of the steps in Method 3. I will eventually be running nosetests in a .bat file that does various things with the output. I don't want every user to have to modify the .bat file to indicate where the testsuite is located. Which is why Python27\Lib\site-packages appealed to me.
Any insight as to why these three methods behave so differently would be very helpful!
I have this config in bulidout. (All other info skipped, the \ means same line, just for readability here.)
[buildout]
extensions = mr.developer
auto-checkout = *
[sources]
media_bundler = git git://github.com/culebron/django-media-bundler.git rev=...
M2Crypto.git = git git://github.com/tobiasherp/M2Crypto.git rev=....
This eggs are downloaded and checked out, and built (the .egg folders are created). Also I see in develop_eggs, links to both of them.
M2Crypto then appears in bin/django, but media_bundler does not, and all django commands result in this error message:
$ bin/django runserver
importing
Error: No module named media_bundler
What have I missed in the config?
Turned out all I needed was to include these packages in eggs. M2Crypto was some other package requirement, that's why it was included. media_bundler is not package name, use django-media-bundler instead. Add these packages in eggs in buildout:eggs section:
eggs =
django-media-bundler
M2Crypto
django == 1.6.1
and then see their source folders appear in bin/django.
I want to deploy my django project using buildout, so I use djangorecipe, but
It will automatically download Django
as says in the readme, and I want to have the option to specify a url to download django (i.e. from a pypi server).
I try to set it with index and find-links buildout options but when they say automatically is true.
I searched through several recipes and found out 2 djangorecipe's forks that seem go in a similar direction, these are thechristmaspig and djbuild. The first left the download responsibility to the recipe zerokspot.recipe.git and the second allow to specify a svn repo. But both of them haven't recent activity (more than 2 years) and a very small community, that poor support make me out.
Can you suggest another way without hacks djangorecipe?
UPDATE:
I had tested with some options without success:
mr.developer:
In djangorecipe mentions use this recipe and I try with fs option of source but no way with an url like this:
[sources]
django = fs http://pypi_server/simple/
I tested with several settings but it seems only works with directory in file system
zc.recipe.egg:
But it also use the same url of the djangorecipe and no found a way change it
UPDATE2:
gp.recipe.pip:
Same results of zc.recipe.egg, but notice something: If remove the use of djangorecipe i.e. (commenting this section):
[buildout]
parts = pip
[pip]
recipe = gp.recipe.pip
install = django
#[django]
#recipe = djangorecipe
#settings = settings
it download django from the local pypi server. With django enabled (uncommenting django section and add django to buildout:parts) it download from www.djangoproject.com server.
In order to execute gp.recipe.pip first (so djangorecipe found django installed) I'm tried with two ways for refering a variable:
Refering a pip's variable from django section (as explain in the section "Automatic part selection and ordering" of buildout docs)
Proceding with section Extending sections (macros) of buildout docs
Note that reorganize sections or change the values order in parts variable no matters for change the execution order.
But again no success
Any ideas?
Thanks
Based on the UPDATE2's comments in the question I figure to have two .cfg files: the one with only pip settings and the second for django settings. Then execute twice buildout using -c option to specify files. So with first buildout call it installs django from pypi server, second encounter that django has been installed and move on. This should works and maybe this is the solution, any other? thx