Skip to content

Commit c211e24

Browse files
committed
drop support for Python 2
1 parent b4755d7 commit c211e24

30 files changed

+26
-118
lines changed

.appveyor.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
# Based on pygit2's appveyor config
22
environment:
33
matrix:
4-
- GENERATOR: 'Visual Studio 10'
5-
PYTHON: 'C:\Python27\python.exe'
6-
- GENERATOR: 'Visual Studio 10 Win64'
7-
PYTHON: 'C:\Python27-x64\python.exe'
4+
- GENERATOR: 'Visual Studio 14'
5+
PYTHON: 'C:\Python36\python.exe'
6+
- GENERATOR: 'Visual Studio 14 Win64'
7+
PYTHON: 'C:\Python36-x64\python.exe'
8+
- GENERATOR: 'Visual Studio 14'
9+
PYTHON: 'C:\Python37\python.exe'
10+
- GENERATOR: 'Visual Studio 14 Win64'
11+
PYTHON: 'C:\Python37-x64\python.exe'
12+
- GENERATOR: 'Visual Studio 14'
13+
PYTHON: 'C:\Python38\python.exe'
14+
- GENERATOR: 'Visual Studio 14 Win64'
15+
PYTHON: 'C:\Python38-x64\python.exe'
816

917
init:
1018
- cmd: '%PYTHON% -m pip install -U nose wheel'
@@ -21,7 +29,7 @@ test_script:
2129
&$env:PYTHON -m pip install -r requirements.txt .
2230
# 'gl' is installed in Python Scripts directory
2331
$env:PATH += ";$(Split-Path $env:PYTHON)\Scripts"
24-
&$env:PYTHON setup.py nosetests --logging-level=WARN --with-xunit
32+
&$env:PYTHON setup.py nosetests --logging-level=WARN --with-xunit
2533
if ($LastExitCode -ne 0) { $host.SetShouldExit($LastExitCode) }
2634
# upload results to AppVeyor
2735
$wc = New-Object 'System.Net.WebClient'

.travis.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ addons:
55
packages:
66
- snapcraft
77
python:
8-
- '2.7'
9-
- '3.4'
10-
- '3.5'
118
- '3.6'
129
- '3.7'
13-
- 'pypy3.5'
10+
- '3.8'
11+
- 'pypy3.6'
1412
env: LIBGIT2=~/libgit2/_install/ LD_LIBRARY_PATH=~/libgit2/_install/lib
1513
before_install: ./.travis.sh
1614
install: pip install -r requirements.txt .

README.md

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ Install
2424
Note that the installation **won't interfere** with your Git installation in any
2525
way, you can keep using Git, and switch between Git and Gitless seamlessly.
2626

27-
We currently require Git (1.7.12+) to be installed (but this requirement is
28-
going to disappear soon once we finish with our migration to [pygit2](https://github.com/libgit2/pygit2)).
27+
We currently require Git (1.7.12+) to be installed, but this requirement is
28+
going to disappear soon once we finish with our migration to [pygit2](https://github.com/libgit2/pygit2).
2929

3030

3131
### Binary release (macOS and Linux only)
@@ -47,11 +47,7 @@ the Python Package Index).
4747

4848
### Installing from source
4949

50-
To install from source you need to have Python (2.7, 3.2+ or PyPy)
51-
installed.
52-
53-
Note to Windows users: Python 3 is not supported yet,
54-
see [#146](https://github.com/sdg-mit/gitless/issues/146) for more info.
50+
To install from source you need to have Python 3.6+ installed.
5551

5652
Additionally, you need to [install pygit2](
5753
http://www.pygit2.org/install.html "pygit2 install").
@@ -66,10 +62,7 @@ and do:
6662

6763
If you are a Python fan you might find it easier to install
6864
Gitless via the Python Package Index. To do this, you need to have
69-
Python (2.7, 3.2+ or PyPy) installed.
70-
71-
Note to Windows users: Python 3 is not supported yet,
72-
see [#146](https://github.com/sdg-mit/gitless/issues/146) for more info.
65+
Python 3.6+ installed.
7366

7467
Additionally, you need to [install pygit2](
7568
http://www.pygit2.org/install.html "pygit2 install").
@@ -119,17 +112,15 @@ code, here are some useful things to know:
119112
`cd` to the repo root and do `./setup.py develop`. This will install
120113
the `gl` command with a symlink to your source files. You can make
121114
changes to your code and run `gl` to test them.
122-
- We follow (to some extent) the [Google Python Style Guide](
115+
- We follow, to some extent, the [Google Python Style Guide](
123116
https://google.github.io/styleguide/pyguide.html
124117
"Google Python Style Guide").
125118
Before submitting code, take a few seconds to look at the style guide and the
126119
Gitless's code so that your edits are consistent with the codebase
127120

128121
- Finally, if you don't want [Travis](
129122
https://travis-ci.org/sdg-mit/gitless "Travis") to
130-
be mad at you, check that tests pass in Python 2.7 and 3.2+. Tests can be run with:
123+
be mad at you, check that tests pass in Python 3.6+. Tests can be run with:
131124
```
132-
pip install nose
133-
nosetests # run tests other than end-to-end tests
134-
nosetests ./gitless/tests/test_e2e.py # run end-to-end tests
125+
python -m unittest discover gitless/tests
135126
```

gitless/cli/commit_dialog.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"""Gitless's commit dialog."""
66

77

8-
from __future__ import unicode_literals
9-
108
import io
119
from locale import getpreferredencoding
1210
import os
@@ -18,7 +16,6 @@
1816
from . import pprint
1917

2018

21-
IS_PY2 = sys.version_info[0] == 2
2219
ENCODING = getpreferredencoding() or 'utf-8'
2320

2421
_COMMIT_FILE = 'GL_COMMIT_EDIT_MSG'
@@ -35,11 +32,7 @@ def show(files, repo):
3532
Returns:
3633
The commit msg.
3734
"""
38-
if IS_PY2:
39-
# wb because we use pprint to write
40-
cf = io.open(_commit_file(repo), mode='wb')
41-
else:
42-
cf = io.open(_commit_file(repo), mode='w', encoding=ENCODING)
35+
cf = io.open(_commit_file(repo), mode='w', encoding=ENCODING)
4336

4437
curr_b = repo.current_branch
4538
if curr_b.merge_in_progress or curr_b.fuse_in_progress:

gitless/cli/file_cmd.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"""Helper module for gl_{track, untrack, resolve}."""
66

77

8-
from __future__ import unicode_literals
9-
108
from . import helpers, pprint
119

1210

gitless/cli/gl.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"""gl - Main Gitless's command. Dispatcher to the other cmds."""
66

77

8-
from __future__ import unicode_literals
9-
108
import sys
119
import argparse
1210
import argcomplete

gitless/cli/gl_branch.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"""gl branch - List, create, edit or delete branches."""
66

77

8-
from __future__ import unicode_literals
9-
108
from gitless import core
119

1210
from . import helpers, pprint

gitless/cli/gl_checkout.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"""gl checkout - Checkout committed versions of files."""
66

77

8-
from __future__ import unicode_literals
9-
108
from gitless import core
119

1210
from . import helpers, pprint

gitless/cli/gl_commit.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"""gl commit - Record changes in the local repository."""
66

77

8-
from __future__ import unicode_literals
9-
108
from gitless import core
119

1210
from . import commit_dialog

gitless/cli/gl_diff.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"""gl diff - Show changes in files."""
66

77

8-
from __future__ import unicode_literals
9-
108
import os
119
import tempfile
1210

0 commit comments

Comments
 (0)