Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: tox-dev/tox
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4.1.0
Choose a base ref
...
head repository: tox-dev/tox
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4.1.1
Choose a head ref
  • 3 commits
  • 5 files changed
  • 3 contributors

Commits on Dec 29, 2022

  1. Copy the full SHA
    c838192 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    b49d118 View commit details
  3. release 4.1.1

    gaborbernat committed Dec 29, 2022

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    1d739a2 View commit details
Showing with 33 additions and 3 deletions.
  1. +12 −0 docs/changelog.rst
  2. +17 −0 docs/faq.rst
  3. +1 −1 src/tox/pytest.py
  4. +1 −1 src/tox/tox_env/api.py
  5. +2 −1 tests/tox_env/test_tox_env_api.py
12 changes: 12 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -4,6 +4,18 @@ Release History

.. towncrier release notes start
v4.1.1 (2022-12-29)
-------------------

Bugfixes - 4.1.1
~~~~~~~~~~~~~~~~
- Fix logging error with emoji in git branch name. (:issue:`2768`)

Improved Documentation - 4.1.1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Add faq entry about re-use of environments - by :user:`jugmac00`. (:issue:`2788`)


v4.1.0 (2022-12-29)
-------------------

17 changes: 17 additions & 0 deletions docs/faq.rst
Original file line number Diff line number Diff line change
@@ -121,6 +121,23 @@ tox 4 -- output changes
- We now use colors for reporting, to help make the output easier to read for humans. This can be disabled via the
``TERM=dumb`` or ``NO_COLOR=1`` environment variables, or the ``--colored no`` CLI argument.

tox 4 -- re-use of environments
+++++++++++++++++++++++++++++++

- It is no longer possible to re-use environments. While this might have been possible with tox version 3, this
behavior was never supported, and possibly caused wrong results as illustrated in the following example.

.. code-block:: ini
[testenv]
envdir = .tox/venv
[testenv:a]
deps = pytest>7
[testenv:b]
deps = pytest<7
New features in tox 4
---------------------
Here is a non-exhaustive list of these.
2 changes: 1 addition & 1 deletion src/tox/pytest.py
Original file line number Diff line number Diff line change
@@ -161,7 +161,7 @@ def _setup_files(dest: Path, base: Path | None, content: dict[str, Any]) -> None
at_path.mkdir(exist_ok=True)
ToxProject._setup_files(at_path, None, value)
elif isinstance(value, str):
at_path.write_text(textwrap.dedent(value))
at_path.write_text(textwrap.dedent(value), encoding="utf-8")
elif value is None:
at_path.mkdir()
else:
2 changes: 1 addition & 1 deletion src/tox/tox_env/api.py
Original file line number Diff line number Diff line change
@@ -444,7 +444,7 @@ def _log_execute(self, request: ExecuteRequest, status: ExecuteStatus) -> None:

@staticmethod
def _write_execute_log(env_name: str, log_file: Path, request: ExecuteRequest, status: ExecuteStatus) -> None:
with log_file.open("wt") as file:
with log_file.open("wt", encoding="utf-8") as file:
file.write(f"name: {env_name}\n")
file.write(f"run_id: {request.run_id}\n")
for env_key, env_value in request.env.items():
3 changes: 2 additions & 1 deletion tests/tox_env/test_tox_env_api.py
Original file line number Diff line number Diff line change
@@ -34,7 +34,8 @@ def test_allow_list_external_fail(tox_project: ToxProjectCreator, fake_exe_on_pa

def test_env_log(tox_project: ToxProjectCreator) -> None:
cmd = "commands=python -c 'import sys; print(1); print(2); print(3, file=sys.stderr); print(4, file=sys.stderr)'"
prj = tox_project({"tox.ini": f"[testenv]\npackage=skip\n{cmd}"})
env_vars = " UNPREDICTABLE = 🪟"
prj = tox_project({"tox.ini": f"[testenv]\npackage=skip\nset_env =\n{env_vars}\n{cmd}"})
result_first = prj.run("r")
result_first.assert_success()