Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging main #640

Merged
merged 2 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions eta/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1612,7 +1612,7 @@ def __init__(

num_pct_decimals = 0

self._total = self._get_total(total)
self._total = self._get_total(total, quiet)
self._iterator = None
self._iteration = 0
self._show_percentage = show_percentage
Expand Down Expand Up @@ -1673,10 +1673,7 @@ def __len__(self):

def __call__(self, iterable):
if self._total is None:
try:
self._total = len(iterable)
except:
self._total = None
self._total = self._get_total(iterable, self._quiet)

if self._total is None:
self._show_remaining_time = False
Expand Down Expand Up @@ -1926,10 +1923,14 @@ def draw(self, force=False):
self._draw(force=force)

@staticmethod
def _get_total(total):
def _get_total(total, quiet):
if is_numeric(total) or total is None:
return total

if quiet:
# Don't compute `len()` unnecessarily
return None

try:
return len(total)
except:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from wheel.bdist_wheel import bdist_wheel


VERSION = "0.13.0"
VERSION = "0.13.1"


class BdistWheelCustom(bdist_wheel):
Expand Down Expand Up @@ -140,7 +140,7 @@ def get_version():
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11"
"Programming Language :: Python :: 3.11",
],
entry_points={"console_scripts": ["eta=eta.core.cli:main"]},
python_requires=">=3.9",
Expand Down