Skip to content

Commit

Permalink
Merge pull request #1868 from pypa/release-20.0.24
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbernat authored Jun 22, 2020
2 parents 942f134 + c5e9c9e commit f5902ac
Show file tree
Hide file tree
Showing 12 changed files with 74 additions and 48 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: check
on:
push:
pull_request:
schedule:
- cron: '0 8 * * *'

jobs:
lint:
Expand Down Expand Up @@ -127,3 +129,24 @@ jobs:
run: python -m tox -e ${{ matrix.tox_env }}
env:
UPGRADE_ADVISORY: 'yes'

publish:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [check, test, lint]
runs-on: ubuntu-latest
steps:
- name: setup python to build package
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: install pep517
run: python -m pip install pep517
- uses: actions/checkout@v2
- name: build package
run: python -m pep517.build -s -b . -o dist
- name: publish to PyPi
uses: pypa/gh-action-pypi-publish@master
with:
skip_existing: true
user: __token__
password: ${{ secrets.pypi_password }}
17 changes: 0 additions & 17 deletions .github/workflows/publish.yaml

This file was deleted.

40 changes: 40 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,46 @@ Release History

.. towncrier release notes start
v20.0.24 (2020-06-22)
---------------------

Features - 20.0.24
~~~~~~~~~~~~~~~~~~
- Ensure that the seeded packages do not get too much out of date:

- add a CLI flag that triggers upgrade of embedded wheels under :option:`upgrade-embed-wheels`
- periodically (once every 14 days) upgrade the embedded wheels in a background process, and use them if they have been
released for more than 28 days (can be disabled via :option:`no-periodic-update`)

More details under :ref:`wheels` - by :user:`gaborbernat`. (`#1821 <https://github.com/pypa/virtualenv/issues/1821>`_)
- Upgrade embed wheel content:

- ship wheels for Python ``3.9`` and ``3.10``
- upgrade setuptools for Python ``3.5+`` from ``47.1.1`` to ``47.3.1``

by :user:`gaborbernat`. (`#1841 <https://github.com/pypa/virtualenv/issues/1841>`_)
- Display the installed seed package versions in the final summary output, for example:

.. code-block:: console
created virtual environment CPython3.8.3.final.0-64 in 350ms
creator CPython3Posix(dest=/x, clear=True, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/y/virtualenv)
added seed packages: pip==20.1.1, setuptools==47.3.1, wheel==0.34.2
by :user:`gaborbernat`. (`#1864 <https://github.com/pypa/virtualenv/issues/1864>`_)

Bugfixes - 20.0.24
~~~~~~~~~~~~~~~~~~
- Do not generate/overwrite ``.gitignore`` if it already exists at destination path - by :user:`gaborbernat`. (`#1862 <https://github.com/pypa/virtualenv/issues/1862>`_)
- Improve error message for no ``.dist-info`` inside the ``app-data`` copy seeder - by :user:`gaborbernat`. (`#1867 <https://github.com/pypa/virtualenv/issues/1867>`_)

Improved Documentation - 20.0.24
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- How seeding mechanisms discover (and automatically keep it up to date) wheels at :ref:`wheels` - by :user:`gaborbernat`. (`#1821 <https://github.com/pypa/virtualenv/issues/1821>`_)
- How distributions should handle shipping their own embedded wheels at :ref:`distribution_wheels` - by :user:`gaborbernat`. (`#1840 <https://github.com/pypa/virtualenv/issues/1840>`_)


v20.0.23 (2020-06-12)
---------------------

Expand Down
1 change: 0 additions & 1 deletion docs/changelog/1821.doc.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/changelog/1821.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/changelog/1840.doc.rst

This file was deleted.

6 changes: 0 additions & 6 deletions docs/changelog/1841.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/changelog/1862.bugfix.rst

This file was deleted.

10 changes: 0 additions & 10 deletions docs/changelog/1864.feature.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/changelog/1867.bugfix.rst

This file was deleted.

4 changes: 2 additions & 2 deletions docs/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,13 @@ Embed wheels for distributions
Custom distributions often want to use their own set of wheel versions to distribute instead of the one virtualenv
releases on PyPi. The reason for this is trying to keep the system versions of those package in sync with what
virtualenv uses. In such cases they should patch the module `virtualenv.seed.wheels.embed
<https://github.com/pypa/virtualenv/tree/bundle/src/virtualenv/seed/wheels/embed>`_, making sure to provide the function
<https://github.com/pypa/virtualenv/tree/master/src/virtualenv/seed/wheels/embed>`_, making sure to provide the function
``get_embed_wheel`` (which returns the wheel to use given a distribution/python version). The ``BUNDLE_FOLDER``,
``BUNDLE_SUPPORT`` and ``MAX`` variables are needed if they want to use virtualenvs test suite to validate.

Furthermore, they might want to disable the periodic update by patching the
`virtualenv.seed.embed.base_embed.PERIODIC_UPDATE_ON_BY_DEFAULT
<https://github.com/pypa/virtualenv/tree/bundle/src/virtualenv/seed/embed/base_embed.py>`_
<https://github.com/pypa/virtualenv/tree/master/src/virtualenv/seed/embed/base_embed.py>`_
to ``False``, and letting the system update mechanism to handle this. Note in this case the user might still request an
upgrade of the embedded wheels by invoking virtualenv via :option:`upgrade-embed-wheels`, but no longer happens
automatically, and will not alter the OS provided wheels.
Expand Down
11 changes: 9 additions & 2 deletions tests/unit/seed/wheels/test_periodic_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import subprocess
import sys
from collections import defaultdict
from contextlib import contextmanager
from datetime import datetime, timedelta

Expand Down Expand Up @@ -37,14 +38,20 @@ def _do_update(distribution, for_py_version, embed_filename, app_data, search_di
return [new_version]
return []

do_update = mocker.patch("virtualenv.seed.wheels.periodic_update.do_update", side_effect=_do_update)
do_update_mock = mocker.patch("virtualenv.seed.wheels.periodic_update.do_update", side_effect=_do_update)
manual_upgrade(session_app_data)

assert "upgrade pip" in caplog.text
assert "upgraded pip" in caplog.text
assert " new entries found:\n\tNewVersion" in caplog.text
assert " no new versions found" in caplog.text
assert do_update.call_count == 3 * len(BUNDLE_SUPPORT)
packages = defaultdict(list)
for i in do_update_mock.call_args_list:
packages[i[1]["distribution"]].append(i[1]["for_py_version"])
packages = {key: sorted(value) for key, value in packages.items()}
versions = list(sorted(BUNDLE_SUPPORT.keys()))
expected = {"setuptools": versions, "wheel": versions, "pip": versions}
assert packages == expected


def test_pick_periodic_update(tmp_path, session_app_data, mocker, for_py_version):
Expand Down

0 comments on commit f5902ac

Please # to comment.