Changeset - 3adaa1a90420
[Not reviewed]
stable
0 4 0
Mads Kiilerich (mads) - 5 months ago 2025-10-05 13:57:28
mads@kiilerich.com
setup: bump minimum Python version to 3.9

3.8 was EOL a year ago. Mercurial also only supports 3.9 and later.
4 files changed with 7 insertions and 11 deletions:
0 comments (0 inline, 0 general)
docs/contributing.rst
Show inline comments
 
@@ -261,49 +261,49 @@ changes when we apply them.
 

	
 
We try to make sure we have consensus on the direction the project is taking.
 
Everything non-sensitive should be discussed in public -- preferably on the
 
mailing list.  We aim at having all non-trivial changes reviewed by at least
 
one other core developer before pushing. Obvious non-controversial changes will
 
be handled more casually.
 

	
 
There is a main development branch ("default") which is generally stable so that
 
it can be (and is) used in production. There is also a "stable" branch that is
 
almost exclusively reserved for bug fixes or trivial changes. Experimental
 
changes should live elsewhere (for example in a pull request) until they are
 
ready.
 

	
 
.. _coding-guidelines:
 

	
 

	
 
Coding guidelines
 
-----------------
 

	
 
We don't have a formal coding/formatting standard. We are currently using a mix
 
of Mercurial's (https://www.mercurial-scm.org/wiki/CodingStyle), pep8, and
 
consistency with existing code. Run ``scripts/run-all-cleanup`` before
 
committing to ensure some basic code formatting consistency.
 

	
 
We support Python 3.6 and later.
 
We support Python 3.9 and later.
 

	
 
We try to support the most common modern web browsers. IE9 is still supported
 
to the extent it is feasible, IE8 is not.
 

	
 
We primarily support Linux and OS X on the server side but Windows should also work.
 

	
 
HTML templates should use 2 spaces for indentation ... but be pragmatic. We
 
should use templates cleverly and avoid duplication. We should use reasonable
 
semantic markup with element classes and IDs that can be used for styling and testing.
 
We should only use inline styles in places where it really is semantic (such as
 
``display: none``).
 

	
 
JavaScript must use ``;`` between/after statements. Indentation 4 spaces. Inline
 
multiline functions should be indented two levels -- one for the ``()`` and one for
 
``{}``.
 
Variables holding jQuery objects should be named with a leading ``$``.
 

	
 
Commit messages should have a leading short line summarizing the changes. For
 
bug fixes, put ``(Issue #123)`` at the end of this line.
 

	
 
Use American English grammar and spelling overall. Use `English title case`_ for
 
page titles, button labels, headers, and 'labels' for fields in forms.
 

	
 
.. _English title case: https://en.wikipedia.org/wiki/Capitalization#Title_case
docs/overview.rst
Show inline comments
 
@@ -70,49 +70,49 @@ Kallithea can be installed in many diffe
 
  PostgreSQL or MariaDB/MySQL. If using SQLite, it will by default live next to
 
  the ``.ini`` file, as ``kallithea.db``.
 

	
 
- A location for the repositories that are hosted by this Kallithea instance.
 
  This will have to be writable by the running Kallithea service. The path to
 
  this location will be configured in the database.
 

	
 
For production setups, one recommendation is to use ``/srv/kallithea`` for the
 
``.ini`` and ``data``, place the virtualenv in ``venv``, and use a Kallithea
 
clone in ``kallithea``. Create a ``kallithea`` user, let it own
 
``/srv/kallithea``, and run as that user when installing.
 

	
 
For simple setups, it is fine to just use something like a ``kallithea`` user
 
with home in ``/home/kallithea`` and place everything there.
 

	
 
For experiments, it might be convenient to run everything as yourself and work
 
inside a clone of Kallithea, with the ``.ini`` and SQLite database in the root
 
of the clone, and a virtualenv in ``venv``.
 

	
 

	
 
Python environment
 
------------------
 

	
 
**Kallithea** is written entirely in Python_ and requires Python version
 
3.6 or higher.
 
3.9 or higher.
 

	
 
Given a Python installation, there are different ways of providing the
 
environment for running Python applications. Each of them pretty much
 
corresponds to a ``site-packages`` directory somewhere where packages can be
 
installed.
 

	
 
Kallithea itself can be run from source or be installed, but even when running
 
from source, there are some dependencies that must be installed in the Python
 
environment used for running Kallithea.
 

	
 
- Packages *could* be installed in Python's ``site-packages`` directory ... but
 
  that would require running pip_ as root and it would be hard to uninstall or
 
  upgrade and is probably not a good idea unless using a package manager.
 

	
 
- Packages could also be installed in ``~/.local`` ... but that is probably
 
  only a good idea if using a dedicated user per application or instance.
 

	
 
- Finally, it can be installed in a virtualenv. That is a very lightweight
 
  "container" where each Kallithea instance can get its own dedicated and
 
  self-contained virtual environment.
 

	
 
We recommend using virtualenv for installing Kallithea.
 

	
 

	
kallithea/__init__.py
Show inline comments
 
@@ -12,50 +12,50 @@
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
"""
 
kallithea
 
~~~~~~~~~
 

	
 
Kallithea, a web based repository management system.
 

	
 
Versioning implementation: http://www.python.org/dev/peps/pep-0386/
 

	
 
This file was forked by the Kallithea project in July 2014.
 
Original author and date, and relevant copyright and licensing information is below:
 
:created_on: Apr 9, 2010
 
:author: marcink
 
:copyright: (c) 2013 RhodeCode GmbH, (C) 2014 Bradley M. Kuhn, and others.
 
:license: GPLv3, see LICENSE.md for more details.
 
"""
 

	
 
import platform
 
import sys
 

	
 
import celery
 

	
 

	
 
if sys.version_info < (3, 6):
 
    raise Exception('Kallithea requires python 3.6 or later')
 
if sys.version_info < (3, 9):
 
    raise Exception('Kallithea requires python 3.9 or later')
 

	
 
VERSION = (0, 7, 0)
 
BACKENDS = {
 
    'hg': 'Mercurial repository',
 
    'git': 'Git repository',
 
}
 

	
 
CELERY_APP = celery.Celery()  # needed at import time but is lazy and can be configured later
 

	
 
DEFAULT_USER_ID: int  # set by setup_configuration
 
CONFIG = {}  # set to tg.config when TG app is initialized and calls app_cfg
 

	
 
# URL prefix for non repository related links - must start with `/`
 
ADMIN_PREFIX = '/_admin'
 
URL_SEP = '/'
 

	
 
# Linked module for extensions
 
EXTENSIONS = {}
 

	
 
__version__ = '.'.join(str(each) for each in VERSION)
 
__platform__ = platform.system()
 
__license__ = 'GPLv3'
 
__py_version__ = sys.version_info
 
__author__ = "Various Authors"
setup.py
Show inline comments
 
#!/usr/bin/env python3
 
# -*- coding: utf-8 -*-
 
import os
 
import platform
 
import re
 
import sys
 

	
 
import setuptools
 
# monkey patch setuptools to use distutils owner/group functionality
 
from setuptools.command import sdist
 

	
 

	
 
if sys.version_info < (3, 6):
 
    raise Exception('Kallithea requires Python 3.6 or later')
 
if sys.version_info < (3, 9):
 
    raise Exception('Kallithea requires Python 3.9 or later')
 

	
 

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

	
 

	
 
def _get_meta_var(name, data, callback_handler=None):
 
    matches = re.compile(r'(?:%s)\s*=\s*(.*)' % name).search(data)
 
    if matches:
 
        s = eval(matches.groups()[0])
 
        if callable(callback_handler):
 
            return callback_handler(s)
 
        return s
 

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

	
 
def callback(V):
 
    return '.'.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
 
@@ -54,64 +54,60 @@ requirements = [
 
    "SQLAlchemy >= 1.2.9, < 1.4",  # TODO: Upgrade to 1.4 or 2 and fix code
 
    "Mako >= 0.9.1, < 1.4",
 
    "Pygments >= 2.2.0, < 2.8",  # TODO: Upgrade and update tests
 
    "Whoosh >= 2.7.1, < 2.8",
 
    "celery >= 5, < 5.6",
 
    "Babel >= 1.3, < 2.18",
 
    "python-dateutil >= 2.1.0, < 2.10",
 
    "Markdown >= 2.2.1, < 3.2",  # TODO: Upgrade and update tests
 
    "docutils >= 0.11, < 0.22",
 
    "URLObject >= 2.3.4, < 3.1",
 
    "Routes >= 2.0, < 2.6",
 
    "dulwich >= 0.19.0, < 0.25",
 
    "mercurial >= 5.2, < 7.2",
 
    "decorator >= 4.2.1, < 5.3",
 
    "Paste >= 2.0.3, < 3.11",
 
    "bleach >= 3.2, < 5",  # TODO: Upgrade and fix TypeError: clean() got an unexpected keyword argument 'styles'
 
    "Click >= 7.0, < 8.4",
 
    "ipaddr >= 2.2.0, < 2.3",
 
    "paginate >= 0.5, < 0.6",
 
    "paginate_sqlalchemy >= 0.3.0, < 0.4",
 
    "bcrypt >= 3.1.0, < 5.1",
 
    "pip >= 20.0, < 24.1",
 
    "chardet >= 3",
 
]
 
if sys.version_info < (3, 8):
 
    requirements.append("importlib-metadata < 5")
 

	
 
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 :: 3.6',
 
    'Programming Language :: Python :: 3.7',
 
    'Programming Language :: Python :: 3.8',
 
    'Programming Language :: Python :: 3.13',
 
    'Topic :: Software Development :: Version Control',
 
]
 

	
 

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

	
 
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'
 
try:
 
    long_description = open(README_FILE).read()
 
except IOError as err:
 
    sys.stderr.write(
0 comments (0 inline, 0 general)