Skip to content

Commit

Permalink
Drop Python2
Browse files Browse the repository at this point in the history
  • Loading branch information
wkentaro committed Feb 25, 2022
1 parent 07af1d3 commit a3126e0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 45 deletions.
20 changes: 6 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: ['3.9', '2.7']
python-version: ['3.9']
PYTEST_QT_API: [pyqt5, pyqt4v2]
exclude:
- os: macos-latest
Expand Down Expand Up @@ -56,11 +56,7 @@ jobs:
shell: bash -l {0}
run: |
if [ "${{ matrix.PYTEST_QT_API }}" = "pyside2" ]; then
if [ "${{ matrix.python-version }}" = "2.7" ]; then
conda install -q -y 'pyside2!=5.12.4' -c conda-forge
else
conda install -q -y pyside2 -c conda-forge
fi
conda install -q -y pyside2 -c conda-forge
elif [ "${{ matrix.PYTEST_QT_API }}" = "pyqt4v2" ]; then
conda install -q -y pyqt=4 -c conda-forge
else # pyqt5
Expand All @@ -84,19 +80,15 @@ jobs:
shell: bash -l {0}
if: matrix.os != 'windows-latest'
run: |
if [ "${{ matrix.python-version }}" == "2.7" ]; then
pip install hacking==2.0.0
else
pip install hacking==4.1.0
fi
pip install hacking==4.1.0
flake8 .
- name: Black
shell: bash -l {0}
if: matrix.os != 'windows-latest' && matrix.python-version != '2.7'
if: matrix.os != 'windows-latest'
run: |
pip install black==22.1.0
black --line-length 79 --check --diff labelme
black --line-length 79 --check --diff labelme/
- name: Test with pytest
shell: bash -l {0}
Expand All @@ -113,7 +105,7 @@ jobs:
(sudo Xvfb :99 -ac -screen 0 1024x768x8 )&
fi
# run test
MPLBACKEND='agg' pytest tests -m 'not gpu'
MPLBACKEND='agg' pytest tests/
- name: Run examples
shell: bash -l {0}
Expand Down
40 changes: 12 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ It is written in Python and uses Qt for its graphical interface.
## Requirements

- Ubuntu / macOS / Windows
- Python2 / Python3
- Python3
- [PyQt4 / PyQt5](http://www.riverbankcomputing.co.uk/software/pyqt/intro)


Expand All @@ -73,17 +73,8 @@ There are options:
You need install [Anaconda](https://www.continuum.io/downloads), then run below:

```bash
# python2
conda create --name=labelme python=2.7
source activate labelme
# conda install -c conda-forge pyside2
conda install pyqt
pip install labelme
# if you'd like to use the latest version. run below:
# pip install git+https://github.com/wkentaro/labelme.git

# python3
conda create --name=labelme python=3.6
conda create --name=labelme python=3
source activate labelme
# conda install -c conda-forge pyside2
# conda install pyqt
Expand All @@ -110,31 +101,22 @@ docker run -it -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=:0 -v $(pwd):/root/wo
### Ubuntu

```bash
# Ubuntu 14.04 / Ubuntu 16.04
# Python2
# sudo apt-get install python-qt4 # PyQt4
sudo apt-get install python-pyqt5 # PyQt5
sudo pip install labelme
# Python3
sudo apt-get install python3-pyqt5 # PyQt5
sudo apt-get install labelme

# or
sudo pip3 install labelme

# or install standalone executable from:
# https://github.com/wkentaro/labelme/releases
```

### Ubuntu 19.10+ / Debian (sid)

```bash
sudo apt-get install labelme
```

### macOS

```bash
brew install pyqt # maybe pyqt5
pip install labelme # both python2/3 should work
pip install labelme

# or
brew install wkentaro/labelme/labelme # command line interface
# brew install --cask wkentaro/labelme/labelme # app

Expand All @@ -147,10 +129,12 @@ brew install wkentaro/labelme/labelme # command line interface
Install [Anaconda](https://www.continuum.io/downloads), then in an Anaconda Prompt run:

```bash
# python3
conda create --name=labelme python=3.6
conda create --name=labelme python=3
conda activate labelme
pip install labelme

# or install standalone executable/app from:
# https://github.com/wkentaro/labelme/releases
```


Expand Down Expand Up @@ -247,7 +231,7 @@ pip install black hacking pytest pytest-qt

flake8 .
black --line-length 79 --check labelme/
MPLBACKEND='agg' pytest tests/ -m 'not gpu'
MPLBACKEND='agg' pytest tests/
```


Expand Down
8 changes: 5 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,16 @@ def main():
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3 :: Only",
],
package_data={"labelme": ["icons/*", "config/*.yaml"]},
entry_points={
Expand Down

0 comments on commit a3126e0

Please sign in to comment.