Changeset - aa6f17a53b49
[Not reviewed]
default
0 14 0
Mads Kiilerich - 6 years ago 2019-11-23 22:08:18
mads@kiilerich.com
Grafted from: 3f8e198b4b77
py3: switch to use Python 3 interpreter, temporarily leaving many things very broken until they have been migrated/fixed in a reviewable way

Bump Mercurial minimum version to 5.2 - the first version that claim stable py3
support.
14 files changed with 23 insertions and 17 deletions:
0 comments (0 inline, 0 general)
development.ini
Show inline comments
 
@@ -126,7 +126,7 @@ commit_parse_limit = 25
 
## used, which is correct in many cases but for example not when using uwsgi.
 
## If you change this setting, you should reinstall the Git hooks via
 
## Admin > Settings > Remap and Rescan.
 
# git_hook_interpreter = /srv/kallithea/venv/bin/python2
 
# git_hook_interpreter = /srv/kallithea/venv/bin/python3
 

	
 
## path to git executable
 
git_path = git
kallithea/__init__.py
Show inline comments
 
@@ -31,6 +31,9 @@ import platform
 
import sys
 

	
 

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

	
 
VERSION = (0, 5, 99)
 
BACKENDS = {
 
    'hg': 'Mercurial repository',
kallithea/lib/paster_commands/template.ini.mako
Show inline comments
 
@@ -220,7 +220,7 @@ commit_parse_limit = 25
 
<%text>## used, which is correct in many cases but for example not when using uwsgi.</%text>
 
<%text>## If you change this setting, you should reinstall the Git hooks via</%text>
 
<%text>## Admin > Settings > Remap and Rescan.</%text>
 
# git_hook_interpreter = /srv/kallithea/venv/bin/python2
 
# git_hook_interpreter = /srv/kallithea/venv/bin/python3
 
%if git_hook_interpreter:
 
git_hook_interpreter = ${git_hook_interpreter}
 
%endif
kallithea/model/scm.py
Show inline comments
 
@@ -700,7 +700,7 @@ class ScmModel(object):
 
        # FIXME This may not work on Windows and may need a shell wrapper script.
 
        return (kallithea.CONFIG.get('git_hook_interpreter')
 
                or sys.executable
 
                or '/usr/bin/env python2')
 
                or '/usr/bin/env python3')
 

	
 
    def install_git_hooks(self, repo, force_create=False):
 
        """
kallithea/tests/scripts/manual_test_crawler.py
Show inline comments
 
#!/usr/bin/env python2
 
#!/usr/bin/env python3
 
# -*- coding: utf-8 -*-
 
# This program is free software: you can redistribute it and/or modify
 
# it under the terms of the GNU General Public License as published by
scripts/docs-headings.py
Show inline comments
 
#!/usr/bin/env python2
 
#!/usr/bin/env python3
 

	
 
"""
 
Consistent formatting of rst section titles
scripts/generate-ini.py
Show inline comments
 
#!/usr/bin/env python2
 
#!/usr/bin/env python3
 
"""
 
Based on kallithea/lib/paster_commands/template.ini.mako, generate development.ini
 
"""
scripts/logformat.py
Show inline comments
 
#!/usr/bin/env python2
 
#!/usr/bin/env python3
 

	
 
from __future__ import print_function
 

	
scripts/make-release
Show inline comments
 
@@ -15,7 +15,7 @@ venv=$(mktemp -d --tmpdir kallithea-rele
 
trap cleanup EXIT
 

	
 
echo "Setting up a fresh virtualenv in $venv"
 
virtualenv -p python2 "$venv"
 
virtualenv -p python3 "$venv"
 
. "$venv/bin/activate"
 

	
 
echo "Install/verify tools needed for building and uploading stuff"
 
@@ -35,8 +35,8 @@ echo "Check that each entry in MANIFEST.
 
sed -e 's/[^ ]*[ ]*\([^ ]*\).*/\1/g' MANIFEST.in | xargs ls -lad
 

	
 
echo "Build dist"
 
python2 setup.py compile_catalog
 
python2 setup.py sdist
 
python3 setup.py compile_catalog
 
python3 setup.py sdist
 

	
 
echo "Verify VERSION from kallithea/__init__.py"
 
namerel=$(cd dist && echo Kallithea-*.tar.gz)
 
@@ -49,7 +49,7 @@ echo "Verify dist file content"
 
diff -u <((hg mani | grep -v '^\.hg\|^kallithea/i18n/en/LC_MESSAGES/kallithea.mo$') | LANG=C sort) <(tar tf dist/Kallithea-$version.tar.gz | sed "s|^$namerel/||" | grep . | grep -v '^kallithea/i18n/.*/LC_MESSAGES/kallithea.mo$\|^Kallithea.egg-info/\|^PKG-INFO$\|/$' | LANG=C sort)
 

	
 
echo "Verify docs build"
 
python2 setup.py build_sphinx # the results are not actually used, but we want to make sure it builds
 
python3 setup.py build_sphinx # the results are not actually used, but we want to make sure it builds
 

	
 
echo "Shortlog for inclusion in the release announcement"
 
scripts/shortlog.py "only('.', branch('stable') & tagged() & public() & not '.')"
scripts/shortlog.py
Show inline comments
 
#!/usr/bin/env python2
 
#!/usr/bin/env python3
 
# -*- coding: utf-8 -*-
 

	
 
"""
scripts/update-copyrights.py
Show inline comments
 
#!/usr/bin/env python2
 
#!/usr/bin/env python3
 
# -*- coding: utf-8 -*-
 

	
 
"""
scripts/validate-commits
Show inline comments
 
@@ -34,7 +34,7 @@ for rev in $(hg log -r "$1" -T '{node}\n
 
    hg update "$rev"
 

	
 
    cleanup
 
    virtualenv -p "$(command -v python2)" "$venv"
 
    virtualenv -p "$(command -v python3)" "$venv"
 
    source "$venv/bin/activate"
 
    pip install --upgrade pip setuptools
 
    pip install -e . -r dev_requirements.txt python-ldap python-pam
scripts/validate-minimum-dependency-versions
Show inline comments
 
@@ -28,7 +28,7 @@ mkdir -p "$venv"
 
sed -n 's/.*"\(.*\)>=\(.*\)".*/\1==\2/p' setup.py > "$min_requirements"
 
sed 's/>=/==/p' dev_requirements.txt >> "$min_requirements"
 

	
 
virtualenv -p "$(command -v python2)" "$venv"
 
virtualenv -p "$(command -v python3)" "$venv"
 
source "$venv/bin/activate"
 
pip install --upgrade pip setuptools
 
pip install -e . -r "$min_requirements" python-ldap python-pam 2> >(tee "$log" >&2)
setup.py
Show inline comments
 
#!/usr/bin/env python2
 
#!/usr/bin/env python3
 
# -*- coding: utf-8 -*-
 
import os
 
import platform
 
@@ -11,6 +11,9 @@ from setuptools.command import sdist
 

	
 
if sys.version_info < (2, 6) or sys.version_info >= (3,):
 
    raise Exception('Kallithea requires python 2.7')
 
# But temporarily, at the same time:
 
if sys.version_info < (3, 6):
 
    raise Exception('Kallithea requires Python 3.6 or later')
 

	
 

	
 
here = os.path.abspath(os.path.dirname(__file__))
 
@@ -62,7 +65,7 @@ requirements = [
 
    "URLObject >= 2.3.4, < 2.5",
 
    "Routes >= 2.0, < 2.5",
 
    "dulwich >= 0.19.0, < 0.20",
 
    "mercurial >= 5.1, < 5.4",
 
    "mercurial >= 5.2, < 5.4",
 
    "decorator >= 4.2.1, < 4.5",
 
    "Paste >= 2.0.3, < 3.1",
 
    "bleach >= 3.0, < 3.2",
0 comments (0 inline, 0 general)