diff options
| author | Stefano Rivera <stefanor@debian.org> | 2020-08-03 14:15:20 -0700 |
|---|---|---|
| committer | git-ubuntu importer <ubuntu-devel-discuss@lists.ubuntu.com> | 2020-08-04 04:35:44 +0000 |
| commit | 5fdf1bc5697c4658e961f736e95ca38f78328b44 (patch) | |
| tree | 94b39741fe056880decfc260134c7f9fcf25eec5 | |
| parent | 891b534e651245567095ff374dc02ff4991a02f5 (diff) | |
20.0.29+ds-1 (patches unapplied)import/20.0.29+ds-1ubuntu/groovy-proposedubuntu/groovy-develubuntu/groovy
Imported using git-ubuntu import.
Notes
Notes:
* New upstream release.
* Replace 0003-Add-ds-to-version.patch with just deleting version.py on
clean. It is written during build. (Closes: #966952)
* Refresh patches.
32 files changed, 213 insertions, 163 deletions
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 05cd5c5..f3c13f3 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -8,6 +8,6 @@ contact_links: url: https://discuss.python.org/c/packaging about: | Please ask typical Q&A here: general ideas for Python packaging, questions about structuring projects and so on -- name: 📝 PyPA Code of Conduct - url: https://www.pypa.io/en/latest/code-of-conduct/ +- name: 📝 PSF Code of Conduct + url: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md about: ❤ Be nice to other members of the community. ☮ Behave. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 63284f7..c199640 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,7 +16,7 @@ repos: hooks: - id: add-trailing-comma - repo: https://github.com/asottile/pyupgrade - rev: v2.6.1 + rev: v2.7.2 hooks: - id: pyupgrade - repo: https://github.com/asottile/seed-isort-config @@ -25,7 +25,7 @@ repos: - id: seed-isort-config args: [--application-directories, '.:src'] - repo: https://github.com/pre-commit/mirrors-isort - rev: v4.3.21 + rev: v5.2.0 hooks: - id: isort - repo: https://github.com/ambv/black @@ -45,7 +45,7 @@ repos: hooks: - id: rst-backticks - repo: https://github.com/asottile/setup-cfg-fmt - rev: v1.9.0 + rev: v1.11.0 hooks: - id: setup-cfg-fmt args: [--min-py3-version, "3.4"] @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: virtualenv -Version: 20.0.27 +Version: 20.0.29 Summary: Virtual Python Environment builder Home-page: https://virtualenv.pypa.io/ Author: Bernat Gabor @@ -10,7 +10,9 @@ Maintainer-email: gaborjbernat@gmail.com License: MIT Project-URL: Source, https://github.com/pypa/virtualenv Project-URL: Tracker, https://github.com/pypa/virtualenv/issues -Description: [](https://pypi.org/project/virtualenv) +Description: # virtualenv + + [](https://pypi.org/project/virtualenv) [](https://pypi.org/project/virtualenv) [](https://pypi.org/project/virtualenv) [](http://virtualenv.pypa.io) @@ -22,10 +24,7 @@ Description: [](https://github.com/psf/black) - virtualenv - ========== - - A tool for creating isolated ``virtual`` python environments. + A tool for creating isolated `virtual` python environments. - [Installation](https://virtualenv.pypa.io/en/latest/installation.html) - [Documentation](https://virtualenv.pypa.io) @@ -34,11 +33,10 @@ Description: [ - [Github](https://github.com/pypa/virtualenv) - Code of Conduct - --------------- + ## Code of Conduct Everyone interacting in the virtualenv project's codebases, issue trackers, chat rooms, and mailing lists is expected to - follow the [PyPA Code of Conduct](https://www.pypa.io/en/latest/code-of-conduct/). + follow the [PSF Code of Conduct](https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md). Keywords: virtual,environments,isolated Platform: any @@ -1,3 +1,5 @@ +# virtualenv + [](https://pypi.org/project/virtualenv) [](https://pypi.org/project/virtualenv) [](https://pypi.org/project/virtualenv) @@ -10,10 +12,7 @@ [](https://github.com/psf/black) -virtualenv -========== - -A tool for creating isolated ``virtual`` python environments. +A tool for creating isolated `virtual` python environments. - [Installation](https://virtualenv.pypa.io/en/latest/installation.html) - [Documentation](https://virtualenv.pypa.io) @@ -22,8 +21,7 @@ A tool for creating isolated ``virtual`` python environments. - [PyPI](https://pypi.org/project/virtualenv) - [Github](https://github.com/pypa/virtualenv) -Code of Conduct ---------------- +## Code of Conduct Everyone interacting in the virtualenv project's codebases, issue trackers, chat rooms, and mailing lists is expected to -follow the [PyPA Code of Conduct](https://www.pypa.io/en/latest/code-of-conduct/). +follow the [PSF Code of Conduct](https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md). diff --git a/debian/changelog b/debian/changelog index 12d5bfc..bd92f14 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +python-virtualenv (20.0.29+ds-1) unstable; urgency=medium + + * New upstream release. + * Replace 0003-Add-ds-to-version.patch with just deleting version.py on + clean. It is written during build. (Closes: #966952) + * Refresh patches. + + -- Stefano Rivera <stefanor@debian.org> Mon, 03 Aug 2020 14:15:20 -0700 + python-virtualenv (20.0.27+ds-1) unstable; urgency=medium * New upstream release diff --git a/debian/clean b/debian/clean index e0e708e..096a547 100644 --- a/debian/clean +++ b/debian/clean @@ -1 +1,2 @@ virtualenv.egg-info/* +src/virtualenv/version.py diff --git a/debian/patches/0003-Add-ds-to-version.patch b/debian/patches/0003-Add-ds-to-version.patch deleted file mode 100644 index cc78463..0000000 --- a/debian/patches/0003-Add-ds-to-version.patch +++ /dev/null @@ -1,18 +0,0 @@ -From: Scott Kitterman <scott@kitterman.com> -Date: Mon, 4 May 2020 14:03:15 -0400 -Subject: Add +ds to version - ---- - src/virtualenv/version.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/virtualenv/version.py b/src/virtualenv/version.py -index ac6882e..2d20137 100644 ---- a/src/virtualenv/version.py -+++ b/src/virtualenv/version.py -@@ -1,3 +1,3 @@ - from __future__ import unicode_literals; - --__version__ = "20.0.27" -\ No newline at end of file -+__version__ = "20.0.27+ds" diff --git a/debian/patches/debian_update_for_available_wheels.patch b/debian/patches/debian_update_for_available_wheels.patch index 78eabee..c82cef1 100644 --- a/debian/patches/debian_update_for_available_wheels.patch +++ b/debian/patches/debian_update_for_available_wheels.patch @@ -38,7 +38,7 @@ index f41b5fc..74ca58d 100644 @classmethod def add_parser_arguments(cls, parser, interpreter, app_data): diff --git a/src/virtualenv/seed/wheels/embed/__init__.py b/src/virtualenv/seed/wheels/embed/__init__.py -index c880d66..fb320bf 100644 +index 69ceefa..6e7e526 100644 --- a/src/virtualenv/seed/wheels/embed/__init__.py +++ b/src/virtualenv/seed/wheels/embed/__init__.py @@ -49,6 +49,21 @@ BUNDLE_SUPPORT = { diff --git a/debian/patches/debian_wheel_location.patch b/debian/patches/debian_wheel_location.patch index 5335b7e..89d649c 100644 --- a/debian/patches/debian_wheel_location.patch +++ b/debian/patches/debian_wheel_location.patch @@ -13,7 +13,7 @@ Last-Update: 2020-07-15 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/virtualenv/seed/wheels/embed/__init__.py b/src/virtualenv/seed/wheels/embed/__init__.py -index ef887fa..c880d66 100644 +index fcdfa19..69ceefa 100644 --- a/src/virtualenv/seed/wheels/embed/__init__.py +++ b/src/virtualenv/seed/wheels/embed/__init__.py @@ -3,7 +3,7 @@ from __future__ import absolute_import, unicode_literals @@ -24,4 +24,4 @@ index ef887fa..c880d66 100644 +BUNDLE_FOLDER = Path('/usr/share/python-wheels') BUNDLE_SUPPORT = { "3.10": { - "pip": "pip-20.1.1-py2.py3-none-any.whl", + "pip": "pip-20.2-py2.py3-none-any.whl", diff --git a/debian/patches/series b/debian/patches/series index 4d481ee..8cb6bcd 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,4 +1,3 @@ debian_wheel_location.patch debian_update_for_available_wheels.patch disable-periodic-update.patch -0003-Add-ds-to-version.patch diff --git a/docs/changelog.rst b/docs/changelog.rst index c8bb404..1afaaaa 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -5,6 +5,26 @@ Release History .. towncrier release notes start +v20.0.29 (2020-07-31) +--------------------- + +Bugfixes - 20.0.29 +~~~~~~~~~~~~~~~~~~ +- Upgrade embedded pip from version ``20.1.2`` to ``20.2`` - by :user:`gaborbernat`. (`#1909 <https://github.com/pypa/virtualenv/issues/1909>`_) + + +v20.0.28 (2020-07-24) +--------------------- + +Bugfixes - 20.0.28 +~~~~~~~~~~~~~~~~~~ +- Fix test suite failing if run from system Python - by :user:`gaborbernat`. (`#1882 <https://github.com/pypa/virtualenv/issues/1882>`_) +- Provide ``setup_logging`` flag to python API so that users can bypass logging handling if their application already + performs this - by :user:`gaborbernat`. (`#1896 <https://github.com/pypa/virtualenv/issues/1896>`_) +- Use ``\n`` instead if ``\r\n`` as line separator for report (because Python already performs this transformation + automatically upon write to the logging pipe) - by :user:`gaborbernat`. (`#1905 <https://github.com/pypa/virtualenv/issues/1905>`_) + + v20.0.27 (2020-07-15) --------------------- diff --git a/docs/changelog/1882.bufix.rst b/docs/changelog/1882.bufix.rst deleted file mode 100644 index 25669a3..0000000 --- a/docs/changelog/1882.bufix.rst +++ /dev/null @@ -1 +0,0 @@ -Fix test suite failing if run from system Python - by :user:`gaborbernat`. diff --git a/docs/cli_interface.rst b/docs/cli_interface.rst index a7f0a01..b752478 100644 --- a/docs/cli_interface.rst +++ b/docs/cli_interface.rst @@ -36,7 +36,7 @@ virtualenv looks for a standard ini configuration file. The exact location depen as determined by :pypi:`appdirs` application configuration definition. The configuration file location is printed as at the end of the output when ``--help`` is passed. -The keys of the settings are derived from th command line option (left strip the ``-`` characters, and replace ``-`` +The keys of the settings are derived from the command line option (left strip the ``-`` characters, and replace ``-`` with ``_``). Where multiple flags are available first found wins (where order is as it shows up under the ``--help``). For example, :option:`--python <python>` would be specified as: @@ -51,7 +51,7 @@ Options that take multiple values, like :option:`extra-search-dir` can be specif .. code-block:: ini [virtualenv] - extra-search-dir = + extra_search_dir = /path/to/dists /path/to/other/dists @@ -5,6 +5,7 @@ long_description = file: README.md long_description_content_type = text/markdown url = https://virtualenv.pypa.io/ author = Bernat Gabor +maintainer = Bernat Gabor license = MIT license_file = LICENSE platforms = any @@ -30,7 +31,6 @@ classifiers = Topic :: Utilities author-email = gaborjbernat@gmail.com keywords = virtual, environments, isolated -maintainer = Bernat Gabor maintainer-email = gaborjbernat@gmail.com project_urls = Source=https://github.com/pypa/virtualenv @@ -82,24 +82,24 @@ virtualenv.seed = [options.extras_require] docs = - sphinx >= 3 - sphinx-argparse >= 0.2.5 - sphinx-rtd-theme >= 0.4.3 - towncrier >= 19.9.0rc1 - proselint >= 0.10.2 + proselint>=0.10.2 + sphinx>=3 + sphinx-argparse>=0.2.5 + sphinx-rtd-theme>=0.4.3 + towncrier>=19.9.0rc1 testing = + coverage>=5 + coverage_enable_subprocess>=1 + flaky>=3 + pytest>=4 + pytest-env>=0.6.2 + pytest-freezegun>=0.4.1 + pytest-mock>=2 + pytest-randomly>=1 + pytest-timeout>=1 + pytest-xdist>=1.31.0 packaging>=20.0;python_version>"3.4" - pytest >= 4 - coverage >= 5 - coverage_enable_subprocess >= 1 - pytest-xdist >= 1.31.0 - pytest-mock >= 2 - pytest-env >= 0.6.2 - pytest-randomly >= 1 - pytest-timeout >= 1 - pytest-freezegun >= 0.4.1 - flaky >= 3 - xonsh >= 0.9.16; python_version > '3.4' and python_version != '3.9' + xonsh>=0.9.16;python_version > '3.4' and python_version != '3.9' [options.package_data] virtualenv.activation.bash = *.sh diff --git a/src/virtualenv.egg-info/PKG-INFO b/src/virtualenv.egg-info/PKG-INFO index 91c52bf..f74c4c0 100644 --- a/src/virtualenv.egg-info/PKG-INFO +++ b/src/virtualenv.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: virtualenv -Version: 20.0.27 +Version: 20.0.29 Summary: Virtual Python Environment builder Home-page: https://virtualenv.pypa.io/ Author: Bernat Gabor @@ -10,7 +10,9 @@ Maintainer-email: gaborjbernat@gmail.com License: MIT Project-URL: Source, https://github.com/pypa/virtualenv Project-URL: Tracker, https://github.com/pypa/virtualenv/issues -Description: [](https://pypi.org/project/virtualenv) +Description: # virtualenv + + [](https://pypi.org/project/virtualenv) [](https://pypi.org/project/virtualenv) [](https://pypi.org/project/virtualenv) [](http://virtualenv.pypa.io) @@ -22,10 +24,7 @@ Description: [](https://github.com/psf/black) - virtualenv - ========== - - A tool for creating isolated ``virtual`` python environments. + A tool for creating isolated `virtual` python environments. - [Installation](https://virtualenv.pypa.io/en/latest/installation.html) - [Documentation](https://virtualenv.pypa.io) @@ -34,11 +33,10 @@ Description: [ - [Github](https://github.com/pypa/virtualenv) - Code of Conduct - --------------- + ## Code of Conduct Everyone interacting in the virtualenv project's codebases, issue trackers, chat rooms, and mailing lists is expected to - follow the [PyPA Code of Conduct](https://www.pypa.io/en/latest/code-of-conduct/). + follow the [PSF Code of Conduct](https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md). Keywords: virtual,environments,isolated Platform: any diff --git a/src/virtualenv.egg-info/SOURCES.txt b/src/virtualenv.egg-info/SOURCES.txt index e79cc9d..bfbe4ea 100644 --- a/src/virtualenv.egg-info/SOURCES.txt +++ b/src/virtualenv.egg-info/SOURCES.txt @@ -24,7 +24,6 @@ docs/installation.rst docs/render_cli.py docs/user_guide.rst docs/_static/custom.css -docs/changelog/1882.bufix.rst docs/changelog/examples.rst docs/changelog/template.jinja2 src/virtualenv/__init__.py @@ -129,7 +128,7 @@ src/virtualenv/seed/wheels/periodic_update.py src/virtualenv/seed/wheels/util.py src/virtualenv/seed/wheels/embed/__init__.py src/virtualenv/seed/wheels/embed/pip-19.1.1-py2.py3-none-any.whl -src/virtualenv/seed/wheels/embed/pip-20.1.1-py2.py3-none-any.whl +src/virtualenv/seed/wheels/embed/pip-20.2-py2.py3-none-any.whl src/virtualenv/seed/wheels/embed/setuptools-43.0.0-py2.py3-none-any.whl src/virtualenv/seed/wheels/embed/setuptools-44.1.1-py2.py3-none-any.whl src/virtualenv/seed/wheels/embed/setuptools-49.2.0-py3-none-any.whl diff --git a/src/virtualenv.egg-info/requires.txt b/src/virtualenv.egg-info/requires.txt index 20f3512..72f9e5b 100644 --- a/src/virtualenv.egg-info/requires.txt +++ b/src/virtualenv.egg-info/requires.txt @@ -13,23 +13,23 @@ importlib-resources>=1.0 importlib-metadata<2,>=0.12 [docs] +proselint>=0.10.2 sphinx>=3 sphinx-argparse>=0.2.5 sphinx-rtd-theme>=0.4.3 towncrier>=19.9.0rc1 -proselint>=0.10.2 [testing] -pytest>=4 coverage>=5 coverage_enable_subprocess>=1 -pytest-xdist>=1.31.0 -pytest-mock>=2 +flaky>=3 +pytest>=4 pytest-env>=0.6.2 +pytest-freezegun>=0.4.1 +pytest-mock>=2 pytest-randomly>=1 pytest-timeout>=1 -pytest-freezegun>=0.4.1 -flaky>=3 +pytest-xdist>=1.31.0 [testing:python_version > "3.4"] packaging>=20.0 diff --git a/src/virtualenv/__init__.py b/src/virtualenv/__init__.py index c72643f..5f74e3e 100644 --- a/src/virtualenv/__init__.py +++ b/src/virtualenv/__init__.py @@ -1,9 +1,10 @@ from __future__ import absolute_import, unicode_literals -from .run import cli_run +from .run import cli_run, session_via_cli from .version import __version__ __all__ = ( "__version__", "cli_run", + "session_via_cli", ) diff --git a/src/virtualenv/__main__.py b/src/virtualenv/__main__.py index 16f12bf..0995e4c 100644 --- a/src/virtualenv/__main__.py +++ b/src/virtualenv/__main__.py @@ -1,15 +1,14 @@ from __future__ import absolute_import, print_function, unicode_literals import logging -import os import sys from datetime import datetime def run(args=None, options=None): start = datetime.now() - from virtualenv.util.error import ProcessCallFailed from virtualenv.run import cli_run + from virtualenv.util.error import ProcessCallFailed if args is None: args = sys.argv[1:] @@ -52,7 +51,7 @@ class LogSession(object): ) if self.session.activators: lines.append(" activators {}".format(",".join(i.__class__.__name__ for i in self.session.activators))) - return os.linesep.join(lines) + return "\n".join(lines) def run_with_catch(args=None): diff --git a/src/virtualenv/config/ini.py b/src/virtualenv/config/ini.py index c878947..4dec629 100644 --- a/src/virtualenv/config/ini.py +++ b/src/virtualenv/config/ini.py @@ -75,7 +75,7 @@ class IniConfig(object): def epilog(self): msg = "{}config file {} {} (change{} via env var {})" return msg.format( - os.linesep, + "\n", self.config_file, self.STATE[self.has_config_file], "d" if self.is_env_var else "", diff --git a/src/virtualenv/create/via_global_ref/_virtualenv.py b/src/virtualenv/create/via_global_ref/_virtualenv.py index 31f9b81..da98b82 100644 --- a/src/virtualenv/create/via_global_ref/_virtualenv.py +++ b/src/virtualenv/create/via_global_ref/_virtualenv.py @@ -37,9 +37,9 @@ def patch_dist(dist): _DISTUTILS_PATCH = "distutils.dist", "setuptools.dist" if sys.version_info > (3, 4): # https://docs.python.org/3/library/importlib.html#setting-up-an-importer + from functools import partial from importlib.abc import MetaPathFinder from importlib.util import find_spec - from functools import partial class _Finder(MetaPathFinder): """A meta path finder that allows patching the imported distutils modules""" diff --git a/src/virtualenv/run/__init__.py b/src/virtualenv/run/__init__.py index 8de7962..5c1e1b0 100644 --- a/src/virtualenv/run/__init__.py +++ b/src/virtualenv/run/__init__.py @@ -14,30 +14,39 @@ from .plugin.discovery import get_discover from .plugin.seeders import SeederSelector -def cli_run(args, options=None): - """Create a virtual environment given some command line interface arguments +def cli_run(args, options=None, setup_logging=True): + """ + Create a virtual environment given some command line interface arguments. :param args: the command line arguments :param options: passing in a ``VirtualEnvOptions`` object allows return of the parsed options + :param setup_logging: ``True`` if setup logging handlers, ``False`` to use handlers already registered :return: the session object of the creation (its structure for now is experimental and might change on short notice) """ - session = session_via_cli(args, options) - with session: - session.run() - return session + of_session = session_via_cli(args, options, setup_logging) + with of_session: + of_session.run() + return of_session + +def session_via_cli(args, options=None, setup_logging=True): + """ + Create a virtualenv session (same as cli_run, but this does not perform the creation). Use this if you just want to + query what the virtual environment would look like, but not actually create it. -# noinspection PyProtectedMember -def session_via_cli(args, options=None): - parser, elements = build_parser(args, options) + :param args: the command line arguments + :param options: passing in a ``VirtualEnvOptions`` object allows return of the parsed options + :param setup_logging: ``True`` if setup logging handlers, ``False`` to use handlers already registered + :return: the session object of the creation (its structure for now is experimental and might change on short notice) + """ + parser, elements = build_parser(args, options, setup_logging) options = parser.parse_args(args) creator, seeder, activators = tuple(e.create(options) for e in elements) # create types - session = Session(options.verbosity, options.app_data, parser._interpreter, creator, seeder, activators) - return session + of_session = Session(options.verbosity, options.app_data, parser._interpreter, creator, seeder, activators) # noqa + return of_session -# noinspection PyProtectedMember -def build_parser(args=None, options=None): +def build_parser(args=None, options=None, setup_logging=True): parser = VirtualEnvConfigParser(options) add_version_flag(parser) parser.add_argument( @@ -47,7 +56,7 @@ def build_parser(args=None, options=None): default=False, help="on failure also display the stacktrace internals of virtualenv", ) - _do_report_setup(parser, args) + _do_report_setup(parser, args, setup_logging) options = load_app_data(args, parser, options) handle_extra_commands(options) @@ -117,11 +126,11 @@ def add_version_flag(parser): "--version", action="version", version="%(prog)s {} from {}".format(__version__, virtualenv.__file__), - help="display the version of the virtualenv package and it's location, then exit", + help="display the version of the virtualenv package and its location, then exit", ) -def _do_report_setup(parser, args): +def _do_report_setup(parser, args, setup_logging): level_map = ", ".join("{}={}".format(logging.getLevelName(l), c) for c, l in sorted(list(LEVELS.items()))) msg = "verbosity = verbose - quiet, default {}, mapping => {}" verbosity_group = parser.add_argument_group( @@ -131,4 +140,11 @@ def _do_report_setup(parser, args): verbosity.add_argument("-v", "--verbose", action="count", dest="verbose", help="increase verbosity", default=2) verbosity.add_argument("-q", "--quiet", action="count", dest="quiet", help="decrease verbosity", default=0) option, _ = parser.parse_known_args(args) - setup_report(option.verbosity) + if setup_logging: + setup_report(option.verbosity) + + +__all__ = ( + "cli_run", + "session_via_cli", +) diff --git a/src/virtualenv/seed/wheels/embed/__init__.py b/src/virtualenv/seed/wheels/embed/__init__.py index ef887fa..fcdfa19 100644 --- a/src/virtualenv/seed/wheels/embed/__init__.py +++ b/src/virtualenv/seed/wheels/embed/__init__.py @@ -6,32 +6,32 @@ from virtualenv.util.path import Path BUNDLE_FOLDER = Path(__file__).absolute().parent BUNDLE_SUPPORT = { "3.10": { - "pip": "pip-20.1.1-py2.py3-none-any.whl", + "pip": "pip-20.2-py2.py3-none-any.whl", "setuptools": "setuptools-49.2.0-py3-none-any.whl", "wheel": "wheel-0.34.2-py2.py3-none-any.whl", }, "3.9": { - "pip": "pip-20.1.1-py2.py3-none-any.whl", + "pip": "pip-20.2-py2.py3-none-any.whl", "setuptools": "setuptools-49.2.0-py3-none-any.whl", "wheel": "wheel-0.34.2-py2.py3-none-any.whl", }, "3.8": { - "pip": "pip-20.1.1-py2.py3-none-any.whl", + "pip": "pip-20.2-py2.py3-none-any.whl", "setuptools": "setuptools-49.2.0-py3-none-any.whl", "wheel": "wheel-0.34.2-py2.py3-none-any.whl", }, "3.7": { - "pip": "pip-20.1.1-py2.py3-none-any.whl", + "pip": "pip-20.2-py2.py3-none-any.whl", "setuptools": "setuptools-49.2.0-py3-none-any.whl", "wheel": "wheel-0.34.2-py2.py3-none-any.whl", }, "3.6": { - "pip": "pip-20.1.1-py2.py3-none-any.whl", + "pip": "pip-20.2-py2.py3-none-any.whl", "setuptools": "setuptools-49.2.0-py3-none-any.whl", "wheel": "wheel-0.34.2-py2.py3-none-any.whl", }, "3.5": { - "pip": "pip-20.1.1-py2.py3-none-any.whl", + "pip": "pip-20.2-py2.py3-none-any.whl", "setuptools": "setuptools-49.2.0-py3-none-any.whl", "wheel": "wheel-0.34.2-py2.py3-none-any.whl", }, @@ -41,7 +41,7 @@ BUNDLE_SUPPORT = { "wheel": "wheel-0.33.6-py2.py3-none-any.whl", }, "2.7": { - "pip": "pip-20.1.1-py2.py3-none-any.whl", + "pip": "pip-20.2-py2.py3-none-any.whl", "setuptools": "setuptools-44.1.1-py2.py3-none-any.whl", "wheel": "wheel-0.34.2-py2.py3-none-any.whl", }, diff --git a/src/virtualenv/version.py b/src/virtualenv/version.py index ac6882e..60996db 100644 --- a/src/virtualenv/version.py +++ b/src/virtualenv/version.py @@ -1,3 +1,3 @@ from __future__ import unicode_literals; -__version__ = "20.0.27"
\ No newline at end of file +__version__ = "20.0.29"
\ No newline at end of file diff --git a/tasks/__main__zipapp.py b/tasks/__main__zipapp.py index 3cae294..26825cd 100644 --- a/tasks/__main__zipapp.py +++ b/tasks/__main__zipapp.py @@ -116,10 +116,9 @@ def versioned_distribution_class(): if NEW_IMPORT_SYSTEM: # noinspection PyCompatibility - from importlib.util import spec_from_file_location - # noinspection PyCompatibility from importlib.abc import SourceLoader + from importlib.util import spec_from_file_location class VersionedFindLoad(VersionPlatformSelect, SourceLoader): def find_spec(self, fullname, path, target=None): diff --git a/tests/conftest.py b/tests/conftest.py index b2ddf03..3fa0bba 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -196,8 +196,8 @@ def coverage_env(monkeypatch, link, request): # we inject right after creation, we cannot collect coverage on site.py - used for helper scripts, such as debug from virtualenv import run - def via_cli(args, options): - session = prev_run(args, options) + def _session_via_cli(args, options, setup_logging): + session = prev_run(args, options, setup_logging) old_run = session.creator.run def create_run(): @@ -211,7 +211,7 @@ def coverage_env(monkeypatch, link, request): obj = {"cov": None} prev_run = run.session_via_cli - monkeypatch.setattr(run, "session_via_cli", via_cli) + monkeypatch.setattr(run, "session_via_cli", _session_via_cli) def finish(): cov = obj["cov"] diff --git a/tests/unit/activation/test_bash.py b/tests/unit/activation/test_bash.py index 7ddadd6..5246be0 100644 --- a/tests/unit/activation/test_bash.py +++ b/tests/unit/activation/test_bash.py @@ -1,8 +1,13 @@ from __future__ import absolute_import, unicode_literals +import sys + +import pytest + from virtualenv.activation import BashActivator +@pytest.mark.skipif(sys.platform == "win32", reason="Github Actions ships with WSL bash") def test_bash(raise_on_non_source_class, activation_tester): class Bash(raise_on_non_source_class): def __init__(self, session): diff --git a/tests/unit/config/test___main__.py b/tests/unit/config/test___main__.py index 3aad475..49a3ee6 100644 --- a/tests/unit/config/test___main__.py +++ b/tests/unit/config/test___main__.py @@ -1,5 +1,6 @@ from __future__ import absolute_import, unicode_literals +import os import re import sys @@ -24,8 +25,8 @@ def raise_on_session_done(mocker): prev_session = session_via_cli - def _session_via_cli(args, options=None): - prev_session(args, options) + def _session_via_cli(args, options=None, setup_logging=True): + prev_session(args, options, setup_logging) raise exception mocker.patch("virtualenv.run.session_via_cli", side_effect=_session_via_cli) @@ -65,8 +66,13 @@ def test_session_report_full(session_app_data, tmp_path, capsys): r" added seed packages: .*pip==.*, setuptools==.*, wheel==.*", r" activators .*", ] + _match_regexes(lines, regexes) + + +def _match_regexes(lines, regexes): for line, regex in zip(lines, regexes): - assert re.match(regex, line), line + comp_regex = re.compile(r"^{}$".format(regex)) + assert comp_regex.match(line), line def test_session_report_minimal(session_app_data, tmp_path, capsys): @@ -78,5 +84,18 @@ def test_session_report_minimal(session_app_data, tmp_path, capsys): r"created virtual environment .* in \d+ms", r" creator .*", ] - for line, regex in zip(lines, regexes): - assert re.match(regex, line), line + _match_regexes(lines, regexes) + + +def test_session_report_subprocess(session_app_data, tmp_path): + # when called via a subprocess the logging framework should flush and POSIX line normalization happen + out = subprocess.check_output( + [sys.executable, "-m", "virtualenv", str(tmp_path), "--activators", "powershell", "--without-pip"], + ) + lines = out.decode().split(os.linesep) + regexes = [ + r"created virtual environment .* in \d+ms", + r" creator .*", + r" activators .*", + ] + _match_regexes(lines, regexes) diff --git a/tests/unit/create/test_creator.py b/tests/unit/create/test_creator.py index 10090c7..9e4bc82 100644 --- a/tests/unit/create/test_creator.py +++ b/tests/unit/create/test_creator.py @@ -250,8 +250,8 @@ def test_venv_fails_not_inline(tmp_path, capsys, mocker): if os.geteuid() == 0: pytest.skip("no way to check permission restriction when running under root") - def _session_via_cli(args, options=None): - session = session_via_cli(args, options) + def _session_via_cli(args, options=None, setup_logging=True): + session = session_via_cli(args, options, setup_logging) assert session.creator.can_be_inline is False return session diff --git a/tests/unit/seed/wheels/test_periodic_update.py b/tests/unit/seed/wheels/test_periodic_update.py index c31491b..fab1876 100644 --- a/tests/unit/seed/wheels/test_periodic_update.py +++ b/tests/unit/seed/wheels/test_periodic_update.py @@ -149,7 +149,7 @@ _UPDATE_SKIP = { } -@pytest.mark.parametrize("u_log", _UPDATE_SKIP.values(), ids=_UPDATE_SKIP.keys()) +@pytest.mark.parametrize("u_log", list(_UPDATE_SKIP.values()), ids=list(_UPDATE_SKIP.keys())) def test_periodic_update_skip(u_log, mocker, for_py_version, session_app_data, freezer): freezer.move_to(_UP_NOW) mocker.patch("virtualenv.app_data.via_disk_folder.JSONStoreDisk.read", return_value=u_log.to_dict()) @@ -173,7 +173,7 @@ _UPDATE_YES = { } -@pytest.mark.parametrize("u_log", _UPDATE_YES.values(), ids=_UPDATE_YES.keys()) +@pytest.mark.parametrize("u_log", list(_UPDATE_YES.values()), ids=list(_UPDATE_YES.keys())) def test_periodic_update_trigger(u_log, mocker, for_py_version, session_app_data, freezer): freezer.move_to(_UP_NOW) mocker.patch("virtualenv.app_data.via_disk_folder.JSONStoreDisk.read", return_value=u_log.to_dict()) @@ -311,11 +311,13 @@ def test_do_update_first(tmp_path, mocker, freezer): u_log = UpdateLog(started=last_update, completed=last_update, versions=[], periodic=True) read_dict = mocker.patch("virtualenv.app_data.via_disk_folder.JSONStoreDisk.read", return_value=u_log.to_dict()) write = mocker.patch("virtualenv.app_data.via_disk_folder.JSONStoreDisk.write") + copy = mocker.patch("virtualenv.seed.wheels.periodic_update.copy2") versions = do_update("pip", "3.9", str(pip_version_remote[-1][0]), str(app_data_outer), [str(extra)], True) assert download_wheel.call_count == len(pip_version_remote) assert url_o.call_count == 1 + assert copy.call_count == 1 expected = [ NewVersion(Path(wheel).name, _UP_NOW, None if release is None else release.replace(microsecond=0)) diff --git a/tests/unit/test_run.py b/tests/unit/test_run.py index 436e5eb..53849f5 100644 --- a/tests/unit/test_run.py +++ b/tests/unit/test_run.py @@ -1,10 +1,12 @@ from __future__ import absolute_import, unicode_literals +import logging + import pytest import six from virtualenv import __version__ -from virtualenv.run import cli_run +from virtualenv.run import cli_run, session_via_cli def test_help(capsys): @@ -31,3 +33,14 @@ def test_version(capsys): import virtualenv assert virtualenv.__file__ in content + + +@pytest.mark.parametrize("on", [True, False]) +def test_logging_setup(caplog, on): + caplog.set_level(logging.DEBUG) + session_via_cli(["env"], setup_logging=on) + # DEBUG only level output is generated during this phase, default output is WARN, so if on no records should be + if on: + assert not caplog.records + else: + assert caplog.records @@ -1,25 +1,23 @@ [tox] minversion = 3.14.0 envlist = - fix_lint, - py38, - py37, - py36, - py35, - py34, - py27, - pypy, - pypy3, - coverage, - readme, - docs, + fix_lint + py38 + py37 + py36 + py35 + py34 + py27 + pypy + pypy3 + coverage + readme + docs isolated_build = true skip_missing_interpreters = true [testenv] description = run tests with {basepython} -deps = - pip >= 20.0.2 setenv = COVERAGE_FILE = {toxworkdir}/.coverage.{envname} COVERAGE_PROCESS_START = {toxinidir}/.coveragerc @@ -34,7 +32,7 @@ commands = python -m coverage erase python -m coverage run -m pytest \ --junitxml {toxworkdir}/junit.{envname}.xml \ - tests {posargs:--int --timeout 600 -n {env:PYTEST_XDIST:auto}} + {posargs:tests --int --timeout 600 -n {env:PYTEST_XDIST:auto}} python -m coverage combine python -m coverage report --skip-covered --show-missing @@ -45,9 +43,8 @@ commands = description = [run locally after tests]: combine coverage data and create report; generates a diff coverage against origin/master (can be changed by setting DIFF_AGAINST env var) deps = - {[testenv]deps} - coverage >= 5.0.1, <6 - diff_cover + coverage >= 5.0.1 + diff_cover >= 3 extras = skip_install = True passenv = DIFF_AGAINST @@ -60,14 +57,14 @@ commands = python -m coverage html -d {toxworkdir}/htmlcov python -m diff_cover.diff_cover_tool --compare-branch {env:DIFF_AGAINST:origin/master} {toxworkdir}/coverage.xml depends = - py38, - py37, - py36, - py35, - py34, - py27, - pypy, - pypy3, + py38 + py37 + py36 + py35 + py34 + py27 + pypy + pypy3 parallel_show_output = True [testenv:docs] @@ -82,13 +79,13 @@ commands = [testenv:readme] description = check that the long description is valid (need for PyPI) deps = - {[testenv]deps} twine >= 1.12.1 + pep517 >= 0.8.2 skip_install = true extras = commands = - pip wheel -w {envtmpdir}/build --no-deps . - twine check {envtmpdir}/build/* + python -m pep517.build -o {envtmpdir} -b -s . + twine check {envtmpdir}/* [testenv:upgrade] description = upgrade pip/wheels/setuptools to latest @@ -103,8 +100,8 @@ commands = python upgrade_wheels.py description = format the code base to adhere to our styles, and complain about what we cannot do automatically basepython = python3.8 passenv = * -deps = {[testenv]deps} - pre-commit >= 2.0.0, <3 +deps = + pre-commit >= 2 skip_install = True commands = pre-commit run --all-files --show-diff-on-failure @@ -115,7 +112,6 @@ multi_line_output = 3 include_trailing_comma = True force_grid_wrap = 0 line_length = 120 -known_standard_library = ConfigParser known_first_party = virtualenv known_third_party = _subprocess,appdirs,coverage,distlib,docutils,filelock,flaky,git,packaging,pytest,setuptools,six,sphinx,sphinx_rtd_theme,sphinxarg @@ -132,8 +128,7 @@ description = do a release, required posarg of the version number basepython = python3.8 passenv = * deps = - {[testenv]deps} - gitpython >= 3.0.0, < 4 + gitpython >= 3 towncrier >= 19.9.0rc1 packaging >= 17.1 changedir = {toxinidir}/tasks @@ -145,7 +140,6 @@ description = generate a DEV environment extras = testing, docs usedevelop = True deps = - {[testenv]deps} {[testenv:release]deps} setuptools_scm[toml]>=3.4 commands = @@ -156,7 +150,6 @@ commands = description = generate a zipapp skip_install = true deps = - {[testenv]deps} - packaging >= 20.0.0 + packaging >= 20 commands = python tasks/make_zipapp.py |
