Skip to content

Commit 794b677

Browse files
author
topher
authored
Merge pull request #639 from voxel51/release/v0.13.1
Release v0.13.1
2 parents d44f054 + 9b4db83 commit 794b677

File tree

8 files changed

+26
-69
lines changed

8 files changed

+26
-69
lines changed

Dockerfile

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,7 @@ FROM $BASE_IMAGE
2929
# Install ETA
3030
#
3131
# Notes:
32-
# ETA supports Python 2.7.X or Python 3.6.X
33-
#
34-
# `ppa:deadsnakes/ppa` is used in order to install Python 3.6 on Ubuntu 16.04
35-
# https://askubuntu.com/questions/865554/how-do-i-install-python-3-6-using-apt-get
36-
#
37-
# `https://bootstrap.pypa.io/get-pip.py` is used to install pip on Python 3.6
38-
# https://askubuntu.com/questions/889535/how-to-install-pip-for-python-3-6-on-ubuntu-16-10
32+
# ETA supports Python 3.9+
3933
#
4034
# numpy==1.16.0 is enforced as a last step because tensorflow requires this
4135
# version to function properly, and some commands here seem to mess with the
@@ -58,8 +52,8 @@ RUN apt-get update \
5852
git \
5953
curl \
6054
wget \
61-
python3.6 \
62-
python3.6-dev \
55+
python3.9 \
56+
python3.9-dev \
6357
libcupti-dev \
6458
ffmpeg \
6559
imagemagick \

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ infrastructure.**
2222
ETA is very portable:
2323

2424
- Installable on Mac or Linux
25-
- Supports Python 3.6 or later
25+
- Supports Python 3.9 or later
2626
- Supports TensorFlow 1.X and 2.X
2727
- Supports OpenCV 2.4+ and OpenCV 3.0+
2828
- Supports CPU-only and GPU-enabled installations

docs/virtualenv_guide.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,14 @@ environment is highly recommended because it allows you to maintain a separate
66
Python working environment for ETA that operates independently of other
77
packages and Python applications on your machine.
88

9-
> Note that ETA does not currently support Python 3.7, so you must instead
10-
> have a Python 3.6 distribution installed on your machine
11-
129
> Note also that it is highly recommended that you do NOT use an Anaconda
1310
> Python distribution; if you do, the steps described here may fail... Fear
1411
> not, however, as ETA will install all necessary pacakges for you!
1512
1613

1714
## Creating a virtual environment
1815

19-
* If you want to create a Python 2.7 virtual environment and need a fresh
20-
Python installtion, download and install it from
21-
https://www.python.org/downloads
22-
23-
* If you want to create a Python 3.6 virtual environment and need a fresh
16+
* If you want to create a Python 3.9 virtual environment and need a fresh
2417
Python installation, follow the steps below:
2518

2619
```shell
@@ -29,8 +22,8 @@ sudo apt-get update
2922
sudo apt-get -y --no-install-recommends install software-properties-common
3023
sudo add-apt-repository -y ppa:deadsnakes/ppa
3124
sudo apt-get update
32-
sudo apt-get -y --no-install-recommends install python3.6 python3.6-dev
33-
sudo ln -s /usr/bin/python3.6 /usr/local/bin/python
25+
sudo apt-get -y --no-install-recommends install python3.9 python3.9-dev
26+
sudo ln -s /usr/bin/python3.9 /usr/local/bin/python
3427
curl https://bootstrap.pypa.io/get-pip.py | sudo python
3528
sudo pip install --upgrade pip setuptools
3629
sudo pip install virtualenv
@@ -61,10 +54,7 @@ cd "${ENV_DIR}"
6154
* Make a virtual environment, modifying the python executable path as needed:
6255

6356
```shell
64-
# Example for Python 2.7
65-
virtualenv -p /usr/local/bin/python eta2
66-
67-
# Example for Python 3.6
57+
# Example for Python 3.9
6858
virtualenv -p /usr/local/bin/python3 eta3
6959
```
7060

@@ -90,7 +80,7 @@ exit() {
9080
To install ETA in a virtual environment, simply activate the environment:
9181

9282
```shell
93-
# Example of activating a Python 3.6 environment created above
83+
# Example of activating a Python 3.9 environment created above
9484
eta3
9585
```
9686

eta/constants.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,9 @@
1717
# pragma pylint: enable=unused-wildcard-import
1818
# pragma pylint: enable=wildcard-import
1919

20+
import importlib.metadata as metadata
2021
import os
2122

22-
try:
23-
import importlib.metadata as metadata # Python 3.8
24-
except ImportError:
25-
import importlib_metadata as metadata # Python < 3.8
26-
27-
2823
try:
2924
_META = metadata.metadata("voxel51-eta")
3025
except metadata.PackageNotFoundError as e:

eta/core/utils.py

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,8 @@
2828
import hashlib
2929
import importlib
3030
import inspect
31-
32-
try:
33-
# Although StringIO.StringIO's handling of unicode vs bytes is imperfect,
34-
# we import it here for use when a text-buffer replacement for `print` in
35-
# Python 2.X is required
36-
from StringIO import StringIO as _StringIO # Python 2
37-
except ImportError:
38-
from io import StringIO as _StringIO # Python 3
39-
40-
try:
41-
import urllib.parse as urlparse # Python 3
42-
except ImportError:
43-
import urlparse # Python 2
44-
45-
try:
46-
from importlib import metadata
47-
except ImportError:
48-
import importlib_metadata as metadata
49-
31+
from importlib import metadata
32+
from io import StringIO as _StringIO # Python 3
5033
import itertools as it
5134
import logging
5235
import math
@@ -68,6 +51,7 @@
6851
import tempfile
6952
import timeit
7053
import types
54+
import urllib.parse as urlparse
7155
import zipfile as zf
7256

7357
import eta
@@ -1628,7 +1612,7 @@ def __init__(
16281612

16291613
num_pct_decimals = 0
16301614

1631-
self._total = self._get_total(total)
1615+
self._total = self._get_total(total, quiet)
16321616
self._iterator = None
16331617
self._iteration = 0
16341618
self._show_percentage = show_percentage
@@ -1689,10 +1673,7 @@ def __len__(self):
16891673

16901674
def __call__(self, iterable):
16911675
if self._total is None:
1692-
try:
1693-
self._total = len(iterable)
1694-
except:
1695-
self._total = None
1676+
self._total = self._get_total(iterable, self._quiet)
16961677

16971678
if self._total is None:
16981679
self._show_remaining_time = False
@@ -1942,10 +1923,14 @@ def draw(self, force=False):
19421923
self._draw(force=force)
19431924

19441925
@staticmethod
1945-
def _get_total(total):
1926+
def _get_total(total, quiet):
19461927
if is_numeric(total) or total is None:
19471928
return total
19481929

1930+
if quiet:
1931+
# Don't compute `len()` unnecessarily
1932+
return None
1933+
19491934
try:
19501935
return len(total)
19511936
except:

install.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,10 @@ fi
124124
# Check Python version
125125
MSG "Checking version of 'python' binary"
126126
PYTHON_VERSION=$(python -c 'import platform; print(platform.python_version())')
127-
if [[ $PYTHON_VERSION == "3.6."* ]] || [[ $PYTHON_VERSION == "2.7."* ]]; then
127+
if [[ $PYTHON_VERSION == "3.9."* ]]; then
128128
MSG "Found compatible version: Python ${PYTHON_VERSION}"
129129
else
130-
WARN "Python 3.6.X or 2.7.X are recommended, but Python $PYTHON_VERSION was found"
130+
WARN "Python 3.9.X is recommended, but Python $PYTHON_VERSION was found"
131131
read -p "Are you sure you want to continue? [y/N] " -n 1 -r
132132
echo
133133
if [[ ! $REPLY =~ ^[Yy]$ ]]; then

requirements/common.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Cython>=0.28.5 # 0.29.28
44
dill==0.2.7.1
55
future==0.16.0
66
glob2==0.6
7-
importlib-metadata==1.4.0; python_version<"3.8"
87
jsonlines==3.1.0
98
lxml==4.9.1
109
numpy>=1.16.3

setup.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,15 @@
55
Copyright 2017-2024, Voxel51, Inc.
66
voxel51.com
77
"""
8-
try:
9-
from importlib import metadata
10-
except ImportError:
11-
import importlib_metadata as metadata
128

9+
from importlib import metadata
1310
import os
1411
import re
1512
from setuptools import setup, find_packages
1613
from wheel.bdist_wheel import bdist_wheel
1714

1815

19-
VERSION = "0.13.0"
16+
VERSION = "0.13.1"
2017

2118

2219
class BdistWheelCustom(bdist_wheel):
@@ -31,7 +28,6 @@ def finalize_options(self):
3128
"dill",
3229
"future",
3330
"glob2",
34-
"importlib-metadata; python_version<'3.8'",
3531
"jsonlines",
3632
"numpy",
3733
"packaging",
@@ -142,13 +138,11 @@ def get_version():
142138
"Operating System :: POSIX :: Linux",
143139
"Operating System :: Microsoft :: Windows",
144140
"Programming Language :: Python :: 3",
145-
"Programming Language :: Python :: 3.6",
146-
"Programming Language :: Python :: 3.7",
147-
"Programming Language :: Python :: 3.8",
148141
"Programming Language :: Python :: 3.9",
149142
"Programming Language :: Python :: 3.10",
143+
"Programming Language :: Python :: 3.11",
150144
],
151145
entry_points={"console_scripts": ["eta=eta.core.cli:main"]},
152-
python_requires=">=3.6",
146+
python_requires=">=3.9",
153147
cmdclass={"bdist_wheel": BdistWheelCustom},
154148
)

0 commit comments

Comments
 (0)