Changeset - a9a1560dad79
[Not reviewed]
default
0 7 0
Mads Kiilerich - 11 years ago 2014-09-24 14:24:40
madski@unity3d.com
setup: clarify that we only support 2.6 and 2.7
7 files changed with 9 insertions and 14 deletions:
0 comments (0 inline, 0 general)
.travis.yml
Show inline comments
 
language: python
 
python:
 
  - "2.5"
 
  - "2.6"
 
  - "2.7"
 

	
 
env:  
 
  - TEST_DB=sqlite:////tmp/kallithea_test.sqlite
 
  - TEST_DB=mysql://root@127.0.0.1/kallithea_test
 
  - TEST_DB=postgresql://postgres@127.0.0.1/kallithea_test
 

	
 
services:
 
  - mysql
 
  - postgresql
 

	
 
# command to install dependencies
 
before_script:
 
  - mysql -e 'create database kallithea_test;'
 
  - psql -c 'create database kallithea_test;' -U postgres
 
  - git --version
 

	
 
before_install:
 
  - sudo apt-get remove git
 
  - sudo add-apt-repository ppa:pdoes/ppa -y
 
  - sudo apt-get update -y
 
  - sudo apt-get install git -y
 

	
 
install:
 
  - pip install mysql-python psycopg2 mock unittest2
 
  - pip install . --use-mirrors
 

	
 
# command to run tests
 
script: nosetests
 

	
 
notifications:
 
    email:
 
        - ci@kallithea-scm.org
 
    irc: "irc.freenode.org#kallithea"
 

	
 
branches:
 
  only:
 
    - master
docs/contributing.rst
Show inline comments
 
.. _contributing:
 

	
 
=========================
 
Contributing to Kallithea
 
=========================
 

	
 
If you would like to contribute to Kallithea, please contact us, any help is
 
greatly appreciated!
 

	
 
Could I request that you make your source contributions by first forking the
 
Kallithea repository on bitbucket_
 
https://bitbucket.org/conservancy/kallithea and then make your changes to
 
your forked repository. Please post all fixes into **dev** bookmark since your
 
change might be already fixed there and i try to merge all fixes from dev into
 
stable, and not the other way. Finally, when you are finished with your changes,
 
please send us a pull request.
 

	
 
To run Kallithea in a development version you always need to install the latest
 
required libs. Simply clone Kallithea and switch to beta branch::
 

	
 
    hg clone https://kallithea-scm.org/repos/kallithea
 

	
 
after downloading/pulling Kallithea make sure you run::
 

	
 
    python setup.py develop
 

	
 
command to install/verify all required packages, and prepare development
 
enviroment.
 

	
 
There are two files in the directory production.ini and developement.ini copy
 
the `development.ini` file as rc.ini (which is excluded from version controll)
 
and put all your changes like db connection or server port in there.
 

	
 
After finishing your changes make sure all tests passes ok. You can run
 
the testsuite running ``nosetest`` from the project root, or if you use tox
 
run tox for python2.5-2.7 with multiple database test. When using `nosetests`
 
run tox for python2.6-2.7 with multiple database test. When using `nosetests`
 
test.ini file is used and by default it uses sqlite for tests, edit this file
 
to change your testing enviroment.
 

	
 

	
 
There's a special set of tests for push/pull operations, you can runn them using::
 

	
 
    paster serve test.ini --pid-file=test.pid --daemon
 
    KALLITHEA_WHOOSH_TEST_DISABLE=1 KALLITHEA_NO_TMP_PATH=1 nosetests -x kallithea/tests/other/test_vcs_operations.py
 
    kill -9 $(cat test.pid)
 

	
 

	
 
| Thank you for any contributions!
 

	
 

	
 
.. _bitbucket: http://bitbucket.org/
docs/installation.rst
Show inline comments
 
.. _installation:
 

	
 
============
 
Installation
 
============
 

	
 
``Kallithea`` is written entirely in Python. Before posting any issues make
 
sure, your not missing any system libraries and using right version of
 
libraries required by Kallithea. There's also restriction in terms of mercurial
 
clients. Minimal version of hg client known working fine with Kallithea is
 
**1.6**. If you're using older client, please upgrade.
 

	
 

	
 
Installing Kallithea from PyPI (aka "Cheeseshop")
 
-------------------------------------------------
 

	
 
Kallithea requires python version 2.5 or higher.
 
Kallithea requires python version 2.6 or higher.
 

	
 
The easiest way to install ``kallithea`` is to run::
 

	
 
    easy_install kallithea
 

	
 
Or::
 

	
 
    pip install kallithea
 

	
 
If you prefer to install Kallithea manually simply grab latest release from
 
http://pypi.python.org/pypi/Kallithea, decompress the archive and run::
 

	
 
    python setup.py install
 

	
 
Step by step installation example for Windows
 
---------------------------------------------
 

	
 
:ref:`installation_win`
 

	
 

	
 
Step by step installation example for Linux
 
-------------------------------------------
 

	
 

	
 
For installing Kallithea i highly recommend using separate virtualenv_. This
 
way many required by Kallithea libraries will remain sandboxed from your main
 
python and making things less problematic when doing system python updates.
 

	
 
Alternative very detailed installation instructions for Ubuntu Server with
 
celery, indexer and daemon scripts: https://gist.github.com/4546398
 

	
 

	
 
- Assuming you have installed virtualenv_ create a new virtual environment
 
  using virtualenv command::
 

	
 
    virtualenv --no-site-packages /opt/kallithea-venv
 

	
 

	
 
.. note:: Using ``--no-site-packages`` when generating your
 
   virtualenv is **very important**. This flag provides the necessary
 
   isolation for running the set of packages required by
 
   Kallithea.  If you do not specify ``--no-site-packages``,
 
   it's possible that Kallithea will not install properly into
 
   the virtualenv, or, even if it does, may not run properly,
 
   depending on the packages you've already got installed into your
 
   Python's "main" site-packages dir.
 

	
 

	
docs/installation_win.rst
Show inline comments
 
.. _installation_win:
 

	
 

	
 
Step by step Installation for Windows
 
=====================================
 

	
 

	
 
Kallithea step-by-step install Guide for Windows
 

	
 
Target OS: Windows XP SP3 32bit English (Clean installation)
 
+ All Windows Updates until 24-may-2012
 

	
 
.. note::
 

	
 
   This installation is for 32bit systems, for 64bit windows you might need
 
   to download proper 64bit versions of the different packages(Windows Installer, Win32py extensions)
 
   plus some extra tweaks.
 
   These extra steps haven been marked as "64bit".
 
   Tested on Windows Server 2008 R2 SP1, 9-feb-2013.
 
   If you run into any 64bit related problems, please check these pages:
 
   - http://blog.victorjabur.com/2011/06/05/compiling-python-2-7-modules-on-windows-32-and-64-using-msvc-2008-express/
 
   - http://bugs.python.org/issue7511
 

	
 
Step1 - Install Visual Studio 2008 Express
 
------------------------------------------
 

	
 

	
 
Optional: You can also install MingW, but VS2008 installation is easier
 
Optional: You can also install MinGW, but VS2008 installation is easier.
 

	
 
Download "Visual C++ 2008 Express Edition with SP1" from:
 
http://www.microsoft.com/visualstudio/en-us/products/2008-editions/express
 
(if not found or relocated, google for "visual studio 2008 express" for
 
updated link)
 

	
 
You can also download full ISO file for offline installation, just
 
choose "All - Offline Install ISO image file" in the previous page and
 
choose "Visual C++ 2008 Express" when installing.
 

	
 
.. note::
 

	
 
   Using other versions of Visual Studio will lead to random crashes.
 
   You must use Visual Studio 2008!"
 

	
 
.. note::
 

	
 
   Silverlight Runtime and SQL Server 2008 Express Edition are not
 
   required, you can uncheck them
 

	
 
.. note::
 

	
 
   64bit: You also need to install the Microsoft Windows SDK for .NET 3.5 SP1 (.NET 4.0 won't work).
 
   Download from: http://www.microsoft.com/en-us/download/details.aspx?id=3138
 

	
 
.. note::
 

	
 
   64bit: You also need to copy and rename a .bat file to make the Visual C++ compiler work.
 
   I am not sure why this is not necessary for 32bit.
 
   Copy C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat to C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat
 

	
 

	
 
Step2 - Install Python
 
----------------------
 

	
 
Install Python 2.x.y (x >= 5) x86 version (32bit). DO NOT USE A 3.x version.
 
Install Python 2.x.y (x = 6 or 7) x86 version (32bit). DO NOT USE A 3.x version.
 
Download Python 2.x.y from:
 
http://www.python.org/download/
 

	
 
Choose "Windows Installer" (32bit version) not "Windows X86-64
 
Installer". While writing this guide, the latest version was v2.7.3.
 
Remember the specific major and minor version installed, because it will
 
be needed in the next step. In this case, it is "2.7".
 

	
 
.. note::
 

	
 
   64bit: Just download and install the 64bit version of python.
 

	
 
Step3 - Install Win32py extensions
 
----------------------------------
 

	
 
Download pywin32 from:
 
http://sourceforge.net/projects/pywin32/files/
 

	
 
- Click on "pywin32" folder
 
- Click on the first folder (in this case, Build 217, maybe newer when you try)
 
- Choose the file ending with ".win32-py2.x.exe" -> x being the minor
 
  version of Python you installed (in this case, 7)
 
  When writing this guide, the file was:
 
  http://sourceforge.net/projects/pywin32/files/pywin32/Build%20217/pywin32-217.win32-py2.7.exe/download
 

	
 
  .. note::
 

	
 
     64bit: Download and install the 64bit version.
 
     At the time of writing you can find this at:
 
     http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/pywin32-218.win-amd64-py2.7.exe/download
 

	
 
Step4 - Python BIN
 
------------------
 

	
 
Add Python BIN folder to the path
 

	
 
You have to add the Python folder to the path, you can do it manually
 
(editing "PATH" environment variable) or using Windows Support Tools
 
that came preinstalled in Vista/7 and can be installed in Windows XP.
 

	
 
- Using support tools on WINDOWS XP:
 
  If you use Windows XP you can install them using Windows XP CD and
 
  navigating to \SUPPORT\TOOLS. There, execute Setup.EXE (not MSI).
 
  Afterwards, open a CMD and type::
 

	
 
    SETX PATH "%PATH%;[your-python-path]" -M
 

	
 
  Close CMD (the path variable will be updated then)
docs/setup.rst
Show inline comments
 
@@ -640,100 +640,100 @@ Apache as subdirectory
 
Apache subdirectory part::
 

	
 
    <Location /<someprefix> >
 
      ProxyPass http://127.0.0.1:5000/<someprefix>
 
      ProxyPassReverse http://127.0.0.1:5000/<someprefix>
 
      SetEnvIf X-Url-Scheme https HTTPS=1
 
    </Location>
 

	
 
Besides the regular apache setup you will need to add the following line
 
into [app:main] section of your .ini file::
 

	
 
    filter-with = proxy-prefix
 

	
 
Add the following at the end of the .ini file::
 

	
 
    [filter:proxy-prefix]
 
    use = egg:PasteDeploy#prefix
 
    prefix = /<someprefix>
 

	
 

	
 
then change <someprefix> into your chosen prefix
 

	
 
Apache's WSGI config
 
--------------------
 

	
 
Alternatively, Kallithea can be set up with Apache under mod_wsgi. For
 
that, you'll need to:
 

	
 
- Install mod_wsgi. If using a Debian-based distro, you can install
 
  the package libapache2-mod-wsgi::
 

	
 
    aptitude install libapache2-mod-wsgi
 

	
 
- Enable mod_wsgi::
 

	
 
    a2enmod wsgi
 

	
 
- Create a wsgi dispatch script, like the one below. Make sure you
 
  check the paths correctly point to where you installed Kallithea
 
  and its Python Virtual Environment.
 
- Enable the WSGIScriptAlias directive for the wsgi dispatch script,
 
  as in the following example. Once again, check the paths are
 
  correctly specified.
 

	
 
Here is a sample excerpt from an Apache Virtual Host configuration file::
 

	
 
    WSGIDaemonProcess pylons \
 
        threads=4 \
 
        python-path=/home/web/kallithea/pyenv/lib/python2.6/site-packages
 
        python-path=/home/web/kallithea/pyenv/lib/python2.7/site-packages
 
    WSGIScriptAlias / /home/web/kallithea/dispatch.wsgi
 
    WSGIPassAuthorization On
 

	
 
.. note::
 
   when running apache as root please add: `user=www-data group=www-data`
 
   into above configuration
 

	
 
.. note::
 
   Running Kallithea in multiprocess mode in apache is not supported,
 
   make sure you don't specify `processes=num` directive in the config
 

	
 

	
 
Example wsgi dispatch script::
 

	
 
    import os
 
    os.environ["HGENCODING"] = "UTF-8"
 
    os.environ['PYTHON_EGG_CACHE'] = '/home/web/kallithea/.egg-cache'
 

	
 
    # sometimes it's needed to set the curent dir
 
    os.chdir('/home/web/kallithea/')
 

	
 
    import site
 
    site.addsitedir("/home/web/kallithea/pyenv/lib/python2.6/site-packages")
 
    site.addsitedir("/home/web/kallithea/pyenv/lib/python2.7/site-packages")
 

	
 
    from paste.deploy import loadapp
 
    from paste.script.util.logging_config import fileConfig
 

	
 
    fileConfig('/home/web/kallithea/production.ini')
 
    application = loadapp('config:/home/web/kallithea/production.ini')
 

	
 
Note: when using mod_wsgi you'll need to install the same version of
 
Mercurial that's inside Kallithea's virtualenv also on the system's Python
 
environment.
 

	
 

	
 
Other configuration files
 
-------------------------
 

	
 
Some example init.d scripts can be found in init.d directory::
 

	
 
  https://kallithea-scm.org/repos/kallithea/files/tip/init.d/
 

	
 
.. _virtualenv: http://pypi.python.org/pypi/virtualenv
 
.. _python: http://www.python.org/
 
.. _mercurial: http://mercurial.selenic.com/
 
.. _celery: http://celeryproject.org/
 
.. _rabbitmq: http://www.rabbitmq.com/
 
.. _python-ldap: http://www.python-ldap.org/
 
.. _mercurial-server: http://www.lshift.net/mercurial-server.html
 
.. _PublishingRepositories: http://mercurial.selenic.com/wiki/PublishingRepositories
 
.. _Issues tracker: https://bitbucket.org/conservancy/kallithea/issues
docs/usage/troubleshooting.rst
Show inline comments
 
.. _troubleshooting:
 

	
 

	
 
===============
 
Troubleshooting
 
===============
 

	
 
:Q: **Missing static files?**
 
:A: Make sure either to set the `static_files = true` in the .ini file or
 
   double check the root path for your http setup. It should point to
 
   for example:
 
   /home/my-virtual-python/lib/python2.6/site-packages/kallithea/public
 
   /home/my-virtual-python/lib/python2.7/site-packages/kallithea/public
 

	
 
|
 

	
 
:Q: **Can't install celery/rabbitmq?**
 
:A: Don't worry Kallithea works without them too. No extra setup is required.
 
    Try out great celery docs for further help.
 

	
 
|
 

	
 
:Q: **Long lasting push timeouts?**
 
:A: Make sure you set a longer timeouts in your proxy/fcgi settings, timeouts
 
    are caused by https server and not Kallithea.
 

	
 
|
 

	
 
:Q: **Large pushes timeouts?**
 
:A: Make sure you set a proper max_body_size for the http server. Very often
 
    Apache, Nginx or other http servers kill the connection due to to large
 
    body.
 

	
 
|
 

	
 
:Q: **Apache doesn't pass basicAuth on pull/push?**
 
:A: Make sure you added `WSGIPassAuthorization true`.
 

	
 
|
 

	
 
:Q: **Git fails on push/pull?**
 
:A: Make sure you're using an wsgi http server that can handle chunked encoding
 
    such as `waitress` or `gunicorn`
 

	
 
|
 

	
 
:Q: **How i use hooks in Kallithea?**
 
:A: It's easy if they are python hooks just use advanced link in hooks section
 
    in Admin panel, that works only for Mercurial. If you want to use githooks,
 
    just install proper one in repository eg. create file in
 
    `/gitrepo/hooks/pre-receive`. You can also use Kallithea-extensions to
 
    connect to callback hooks, for both Git and Mercurial.
 

	
 
|
 

	
 
:Q: **Kallithea is slow for me, how can i make it faster?**
 
:A: See the :ref:`performance` section
 

	
 
|
 

	
 
:Q: **UnicodeDecodeError on Apache mod_wsgi**
setup.py
Show inline comments
 
#!/usr/bin/env python2
 
# -*- coding: utf-8 -*-
 
import os
 
import sys
 
import platform
 

	
 
if sys.version_info < (2, 5):
 
    raise Exception('Kallithea requires python 2.5 or later')
 
if sys.version_info < (2, 6):
 
    raise Exception('Kallithea requires python 2.6 or 2.7')
 

	
 

	
 
here = os.path.abspath(os.path.dirname(__file__))
 

	
 

	
 
def _get_meta_var(name, data, callback_handler=None):
 
    import re
 
    matches = re.compile(r'(?:%s)\s*=\s*(.*)' % name).search(data)
 
    if matches:
 
        if not callable(callback_handler):
 
            callback_handler = lambda v: v
 

	
 
        return callback_handler(eval(matches.groups()[0]))
 

	
 
_meta = open(os.path.join(here, 'kallithea', '__init__.py'), 'rb')
 
_metadata = _meta.read()
 
_meta.close()
 

	
 
callback = lambda V: ('.'.join(map(str, V[:3])) + '.'.join(V[3:]))
 
__version__ = _get_meta_var('VERSION', _metadata, callback)
 
__license__ = _get_meta_var('__license__', _metadata)
 
__author__ = _get_meta_var('__author__', _metadata)
 
__url__ = _get_meta_var('__url__', _metadata)
 
# defines current platform
 
__platform__ = platform.system()
 

	
 
is_windows = __platform__ in ['Windows']
 

	
 
requirements = [
 
    "waitress==0.8.8",
 
    "webob==1.0.8",
 
    "webtest==1.4.3",
 
    "Pylons==1.0.0",
 
    "Beaker==1.6.4",
 
    "WebHelpers==1.3",
 
    "formencode>=1.2.4,<=1.2.6",
 
    "SQLAlchemy==0.7.10",
 
    "Mako>=0.9.0,<=1.0.0",
 
    "pygments>=1.5",
 
    "whoosh>=2.4.0,<=2.5.7",
 
    "celery>=2.2.5,<2.3",
 
    "babel>=0.9.6,<=1.3",
 
    "python-dateutil>=1.5.0,<2.0.0",
 
    "markdown==2.2.1",
 
    "docutils>=0.8.1,<=0.11",
 
    "simplejson==2.5.2",
 
    "mock",
 
    "pycrypto>=2.6.0,<=2.6.1",
 
    "URLObject==2.3.4",
 
    "Routes==1.13",
 
]
 

	
 
if sys.version_info < (2, 6):
 
    requirements.append("pysqlite")
 

	
 
if sys.version_info < (2, 7):
 
    requirements.append("importlib==1.0.1")
 
    requirements.append("unittest2")
 
    requirements.append("argparse")
 

	
 
if is_windows:
 
    requirements.append("mercurial>=2.8.2,<3.2")
 
else:
 
    requirements.append("py-bcrypt>=0.3.0,<=0.4")
 
    requirements.append("mercurial>=2.8.2,<3.2")
 

	
 
if sys.version_info < (2, 7):
 
    # Dulwich 0.9.6 and later do not support Python2.6.
 
    requirements.append("dulwich>=0.9.3,<=0.9.5")
 
else:
 
    requirements.append("dulwich>=0.9.3,<=0.9.7")
 

	
 
dependency_links = [
 
]
 

	
 
classifiers = [
 
    'Development Status :: 4 - Beta',
 
    'Environment :: Web Environment',
 
    'Framework :: Pylons',
 
    'Intended Audience :: Developers',
 
    'License :: OSI Approved :: GNU General Public License (GPL)',
 
    'Operating System :: OS Independent',
 
    'Programming Language :: Python',
 
    'Programming Language :: Python :: 2.5',
 
    'Programming Language :: Python :: 2.6',
 
    'Programming Language :: Python :: 2.7',
 
    'Topic :: Software Development :: Version Control',
 
]
 

	
 

	
 
# additional files from project that goes somewhere in the filesystem
 
# relative to sys.prefix
 
data_files = []
 

	
 
# additional files that goes into package itself
 
package_data = {'kallithea': ['i18n/*/LC_MESSAGES/*.mo', ], }
 

	
 
description = ('Kallithea is a fast and powerful management tool '
 
               'for Mercurial and GIT with a built in push/pull server, '
 
               'full text search and code-review.')
 

	
 
keywords = ' '.join([
 
    'kallithea', 'mercurial', 'git', 'code review',
 
    'repo groups', 'ldap', 'repository management', 'hgweb replacement',
 
    'hgwebdir', 'gitweb replacement', 'serving hgweb',
 
])
 

	
 
# long description
 
README_FILE = 'README.rst'
 
CHANGELOG_FILE = 'docs/changelog.rst'
 
try:
 
    long_description = open(README_FILE).read() + '\n\n' + \
 
        open(CHANGELOG_FILE).read()
 

	
 
except IOError, err:
 
    sys.stderr.write(
 
        "[WARNING] Cannot find file specified as long_description (%s)\n or "
 
        "changelog (%s) skipping that file" % (README_FILE, CHANGELOG_FILE)
 
    )
 
    long_description = description
 

	
 
try:
 
    from setuptools import setup, find_packages
 
except ImportError:
 
    from ez_setup import use_setuptools
 
    use_setuptools()
 
    from setuptools import setup, find_packages
 
# packages
 
packages = find_packages(exclude=['ez_setup'])
 

	
 
setup(
 
    name='Kallithea',
0 comments (0 inline, 0 general)