Skip to content

Commit

Permalink
Update docs/user_guide.rst
Browse files Browse the repository at this point in the history
Co-authored-by: Pradyun Gedam <[email protected]>
Signed-off-by: Bernat Gabor <[email protected]>
  • Loading branch information
gaborbernat and pradyunsg committed Jun 13, 2020
1 parent 76dfecb commit 8fb8493
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ repos:
hooks:
- id: add-trailing-comma
- repo: https://github.com/asottile/pyupgrade
rev: v2.4.4
rev: v2.6.1
hooks:
- id: pyupgrade
- repo: https://github.com/asottile/seed-isort-config
rev: v2.1.1
rev: v2.2.0
hooks:
- id: seed-isort-config
args: [--application-directories, '.:src']
Expand Down Expand Up @@ -50,7 +50,7 @@ repos:
- id: setup-cfg-fmt
args: [--min-py3-version, "3.4"]
- repo: https://gitlab.com/pycqa/flake8
rev: "3.8.2"
rev: "3.8.3"
hooks:
- id: flake8
additional_dependencies: ["flake8-bugbear == 20.1.4"]
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ What qualifies as bundled wheel? The following three sets together:
end users might not be able to upgrade virtualenv at the same speed. Therefore, a user might request to upgrade the
list of embedded wheels by invoking virtualenv with the :option:`upgrade-embed-wheels` flag. This operation will
trigger automatically, as a background process, if no upgrade has been performed in the last 14 days and upgrade the
embedded wheels if they have been our for more than 28 days. This 28 days period should guarantee end users are not
embedded wheels if they have been out for more than 28 days. This 28 days period should guarantee end users are not
pulling in automatically releases that have known bugs within. This automatic behaviour might be disabled via the
:option:`no-periodic-update` configuration flag/option. To acquire the release date of a package virtualenv will
perform the following:
Expand Down
2 changes: 1 addition & 1 deletion src/virtualenv/seed/wheels/periodic_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def periodic_update(distribution, for_py_version, wheel, search_dirs, app_data,
u_log = UpdateLog.from_app_data(app_data, distribution, for_py_version)
for _, group in groupby(u_log.versions, key=lambda v: v.wheel.version_tuple[0:2]):
version = next(group) # use only latest patch version per minor, earlier assumed to be buggy
if wheel is not None and version.filename.name == wheel.name:
if wheel is not None and Path(version.filename).name == wheel.name:
break
if u_log.periodic is False or version.use(now):
updated_wheel = Wheel(app_data.house / version.filename)
Expand Down
9 changes: 5 additions & 4 deletions tests/unit/seed/wheels/test_periodic_update.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from __future__ import absolute_import, unicode_literals

from datetime import datetime, timedelta
from itertools import zip_longest

from six.moves import zip_longest

from virtualenv import cli_run
from virtualenv.seed.wheels.embed import BUNDLE_SUPPORT, get_embed_wheel
from virtualenv.seed.wheels.periodic_update import NewVersion, manual_upgrade, UpdateLog, periodic_update
from virtualenv.seed.wheels.periodic_update import NewVersion, UpdateLog, manual_upgrade, periodic_update


def test_manual_upgrade(session_app_data, caplog, mocker, for_py_version):
Expand Down Expand Up @@ -75,7 +76,7 @@ def test_periodic_update_latest_per_patch(mocker, session_app_data, for_py_versi
versions=[
NewVersion(wheel_path(current, (0, 1, 2)), completed, now - timedelta(days=1)),
NewVersion(wheel_path(current, (0, 1, 1)), completed, now - timedelta(days=30)),
NewVersion(filename=current.path, found_date=completed, release_date=now - timedelta(days=2)),
NewVersion(filename=str(current.path), found_date=completed, release_date=now - timedelta(days=2)),
],
periodic=True,
)
Expand All @@ -88,4 +89,4 @@ def test_periodic_update_latest_per_patch(mocker, session_app_data, for_py_versi
def wheel_path(wheel, of):
new_version = ".".join(str(i) for i in (tuple(sum(x) for x in zip_longest(wheel.version_tuple, of, fillvalue=0))))
new_name = wheel.name.replace(wheel.version, new_version)
return wheel.path.parent / new_name
return str(wheel.path.parent / new_name)

0 comments on commit 8fb8493

Please sign in to comment.