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.4.7
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.4.8
Choose a head ref
  • 10 commits
  • 16 files changed
  • 7 contributors

Commits on Mar 13, 2023

  1. Include tox.ini in sdist to fix tests

    Include the `tox.ini` file in sdist, in order to fix a few test failures
    due to an additional error message printed by tox, i.e.:
    
        FAILED tests/config/cli/test_parse.py::test_verbosity_guess_miss_match - AssertionError: assert 'ROOT: No tox.ini or setup.cfg or pyproject.toml found, assuming empty tox.ini at /tmp/portage/dev-python/t...
        FAILED tests/config/loader/test_loader.py::test_override_incorrect[-x] - AssertionError: assert not 'ROOT: No tox.ini or setup.cfg or pyproject.toml found, assuming empty tox.ini at /tmp/portage/dev-pyth...
        FAILED tests/config/loader/test_loader.py::test_override_incorrect[--override] - AssertionError: assert not 'ROOT: No tox.ini or setup.cfg or pyproject.toml found, assuming empty tox.ini at /tmp/portage/dev-pyth...
    mgorny authored and jugmac00 committed Mar 13, 2023
    Copy the full SHA
    78d1f64 View commit details

Commits on Mar 14, 2023

  1. Bump pypa/gh-action-pypi-publish from 1.6.4 to 1.7.1 (#2940)

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 14, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5c3c58c View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9476995 View commit details

Commits on Mar 17, 2023

  1. Bump pypa/gh-action-pypi-publish from 1.7.1 to 1.8.1 (#2950)

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6dff088 View commit details

Commits on Mar 23, 2023

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f942b91 View commit details
  2. Bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#2956)

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Mar 23, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f41c2cd View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0a3d578 View commit details

Commits on Mar 26, 2023

  1. docs: s/master/main/g in contributing docs

    sk1p authored and jugmac00 committed Mar 26, 2023
    Copy the full SHA
    10c58ff View commit details
  2. Fix for requirements.txt using both --index-url and --find-links (#2959)

    Without the fix, installation would fail with:
    
        AttributeError: 'Namespace' object has no attribute 'find_links'
    sk1p authored Mar 26, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0e3776e View commit details
  3. release 4.4.8

    gaborbernat committed Mar 26, 2023

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    c037e62 View commit details
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -97,7 +97,7 @@ jobs:
- name: Build package
run: pyproject-build -s -w . -o dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.6.4
uses: pypa/gh-action-pypi-publish@v1.8.3
with:
skip_existing: true
user: __token__
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -52,14 +52,14 @@ repos:
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear==23.1.20
- flake8-comprehensions==3.10.1
- flake8-pytest-style==1.6
- flake8-bugbear==23.3.12
- flake8-comprehensions==3.11.1
- flake8-pytest-style==1.7.2
- flake8-spellcheck==0.28
- flake8-unused-arguments==0.0.13
- flake8-noqa==1.3
- flake8-noqa==1.3.1
- pep8-naming==0.13.3
- flake8-pyproject==1.2.2
- flake8-pyproject==1.2.3
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v2.7.1"
hooks:
9 changes: 9 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -4,6 +4,15 @@ Release History

.. towncrier release notes start
v4.4.8 (2023-03-26)
-------------------

Bugfixes - 4.4.8
~~~~~~~~~~~~~~~~
- ``tox.ini`` is now included in source distributions in order to make all tests pass. (:issue:`2939`)
- Fix ``--index-url`` and ``--find-links`` being used together in ``requirements.txt`` files. (:issue:`2959`)


v4.4.6 (2023-02-21)
-------------------

3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -3,7 +3,6 @@
import re
import subprocess
import sys
from datetime import date
from importlib.machinery import SourceFileLoader
from pathlib import Path
from subprocess import check_output
@@ -22,7 +21,7 @@

company, name = "tox-dev", "tox"
release, version = __version__, ".".join(__version__.split(".")[:2])
copyright = f"2010-{date.today().year}, {company}"
copyright = f"{company}"
master_doc, source_suffix = "index", ".rst"

html_theme = "furo"
4 changes: 2 additions & 2 deletions docs/development.rst
Original file line number Diff line number Diff line change
@@ -129,7 +129,7 @@ Contributing
Submitting pull requests
~~~~~~~~~~~~~~~~~~~~~~~~

Submit pull requests (PRs) against the ``master`` branch, providing a good description of what you're doing and why. You must
Submit pull requests (PRs) against the ``main`` branch, providing a good description of what you're doing and why. You must
have legal permission to distribute any code you contribute to tox and it must be available under the MIT
License. Provide tests that cover your changes and run the tests locally first. tox
:ref:`supports <compatibility-requirements>` multiple Python versions and operating systems. Any pull request must
@@ -148,7 +148,7 @@ or whitespace within lines. Such changes can be made separately, as a "formattin
Automated testing
~~~~~~~~~~~~~~~~~

All pull requests and merges to the ``master`` branch are tested using :gh:`GitHub Actions <features/actions>`
All pull requests and merges to the ``main`` branch are tested using :gh:`GitHub Actions <features/actions>`
(configured by ``check.yml`` file inside the ``.github/workflows`` directory). You can find the status and the results
to the CI runs for your PR on GitHub's Web UI for the pull request. You can also find links to the CI services' pages
for the specific builds in the form of "Details" links, in case the CI run fails and you wish to view the output.
2 changes: 1 addition & 1 deletion docs/upgrading.rst
Original file line number Diff line number Diff line change
@@ -110,7 +110,7 @@ This will now result in a failure.
Substitutions removed
---------------------

- The ``distshare`` substitution has been removed.
- The ``distshare`` and ``homedir`` substitutions have been removed.

Disallowed env names
--------------------
28 changes: 14 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
build-backend = "hatchling.build"
requires = [
"hatch-vcs>=0.3",
"hatchling>=1.12.2",
"hatchling>=1.13",
]

[project]
@@ -51,15 +51,15 @@ dependencies = [
"cachetools>=5.3",
"chardet>=5.1",
"colorama>=0.4.6",
"filelock>=3.9",
'importlib-metadata>=6; python_version < "3.8"',
"filelock>=3.10",
'importlib-metadata>=6.1; python_version < "3.8"',
"packaging>=23",
"platformdirs>=2.6.2",
"platformdirs>=3.1.1",
"pluggy>=1",
"pyproject-api>=1.5",
"pyproject-api>=1.5.1",
'tomli>=2.0.1; python_version < "3.11"',
'typing-extensions>=4.4; python_version < "3.8"',
"virtualenv>=20.17.1",
'typing-extensions>=4.5; python_version < "3.8"',
"virtualenv>=20.21",
]
optional-dependencies.docs = [
"furo>=2022.12.7",
@@ -73,21 +73,21 @@ optional-dependencies.docs = [
]
optional-dependencies.testing = [
"build[virtualenv]>=0.10",
"covdefaults>=2.2.2",
"covdefaults>=2.3",
"devpi-process>=0.3",
"diff-cover>=7.4",
"diff-cover>=7.5",
"distlib>=0.3.6",
"flaky>=3.7",
"hatch-vcs>=0.3",
"hatchling>=1.12.2",
"hatchling>=1.13",
"psutil>=5.9.4",
"pytest>=7.2.1",
"pytest>=7.2.2",
"pytest-cov>=4",
"pytest-mock>=3.10",
"pytest-xdist>=3.1",
"pytest-xdist>=3.2.1",
"re-assert>=1.1",
'time-machine>=2.9; implementation_name != "pypy"',
"wheel>=0.38.4",
"wheel>=0.40",
]
urls.Documentation = "https://tox.wiki"
urls.Homepage = "http://tox.readthedocs.org"
@@ -100,7 +100,7 @@ scripts.tox = "tox.run:run"
[tool.hatch]
build.dev-mode-dirs = ["src"]
build.hooks.vcs.version-file = "src/tox/version.py"
build.targets.sdist.include = ["/src", "/tests"]
build.targets.sdist.include = ["/src", "/tests", "/tox.ini"]
version.source = "vcs"

[tool.black]
4 changes: 2 additions & 2 deletions src/tox/config/cli/parser.py
Original file line number Diff line number Diff line change
@@ -203,11 +203,11 @@ def add_argument(*a_args: str, of_type: type[Any] | None = None, **a_kwargs: Any
excl.append((e_kwargs, arguments))
res_excl = prev_excl(**kwargs)
prev_add_arg = res_excl.add_argument
res_excl.add_argument = add_argument # type: ignore[assignment]
res_excl.add_argument = add_argument # type: ignore[method-assign]
return res_excl

prev_excl = result.add_mutually_exclusive_group
result.add_mutually_exclusive_group = add_mutually_exclusive_group # type: ignore[assignment]
result.add_mutually_exclusive_group = add_mutually_exclusive_group # type: ignore[method-assign]
excl: list[tuple[dict[str, Any], list[ArgumentArgs]]] = []
self._groups.append((args, kwargs, excl))
return result
4 changes: 2 additions & 2 deletions src/tox/config/loader/convert.py
Original file line number Diff line number Diff line change
@@ -71,13 +71,13 @@ def _to_typing(self, raw: T, of_type: type[V], factory: Factory[V]) -> V:
elif origin == Union: # handle Optional values
args: list[type[Any]] = of_type.__args__ # type: ignore[attr-defined]
none = type(None)
if len(args) == 2 and none in args:
if len(args) == 2 and none in args: # type: ignore[comparison-overlap]
if isinstance(raw, str):
raw = raw.strip() # type: ignore[assignment]
if not raw:
result = None
else:
new_type = next(i for i in args if i != none) # pragma: no cover # this will always find a element
new_type = next(i for i in args if i != none) # type: ignore # pragma: no cover
result = self.to(raw, new_type, factory)
elif origin in (Literal, type(Literal)):
choice = of_type.__args__ # type: ignore[attr-defined]
2 changes: 1 addition & 1 deletion src/tox/pytest.py
Original file line number Diff line number Diff line change
@@ -394,7 +394,7 @@ def matches(pattern: str, text: str, flags: int = 0) -> None:
except ImportError: # pragma: no cover # hard to test
match = re.match(pattern, text, flags)
if match is None:
warnings.warn("install the re-assert PyPI package for bette error message", UserWarning)
warnings.warn("install the re-assert PyPI package for bette error message", UserWarning, stacklevel=1)
assert match
else:
assert Matches(pattern, flags=flags) == text
4 changes: 2 additions & 2 deletions src/tox/report.py
Original file line number Diff line number Diff line change
@@ -41,11 +41,11 @@ def new_start(self: Thread) -> None: # need to patch this
self.parent_ident = current_thread().ident # type: ignore[attr-defined]
old_start(self)

old_start, Thread.start = Thread.start, new_start # type: ignore[assignment]
old_start, Thread.start = Thread.start, new_start # type: ignore[method-assign]
try:
yield
finally:
Thread.start = old_start # type: ignore[assignment]
Thread.start = old_start # type: ignore[method-assign]

@property
def name(self) -> str:
4 changes: 2 additions & 2 deletions src/tox/tox_env/python/pip/req/file.py
Original file line number Diff line number Diff line change
@@ -323,14 +323,14 @@ def _merge_option_line(self, base_opt: Namespace, opt: Namespace, filename: str)
if opt.find_links:
# FIXME: it would be nice to keep track of the source of the find_links: support a find-links local path
# relative to a requirements file.
if not hasattr(base_opt, "index_url"): # pragma: no branch
if not hasattr(base_opt, "find_links"):
base_opt.find_links = []
value = opt.find_links[0]
req_dir = os.path.dirname(os.path.abspath(filename))
relative_to_reqs_file = os.path.join(req_dir, value)
if os.path.exists(relative_to_reqs_file):
value = relative_to_reqs_file # pragma: no cover
if value not in base_opt.find_links: # pragma: no branch
if value not in base_opt.find_links:
base_opt.find_links.append(value)
if opt.pre:
base_opt.pre = True
6 changes: 3 additions & 3 deletions src/tox/tox_env/python/virtual_env/package/util.py
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@
from copy import deepcopy
from typing import Optional, Set, cast

from packaging.markers import Marker, Op, Value, Variable # type: ignore[attr-defined]
from packaging.markers import Marker, Op, Variable # type: ignore[attr-defined]
from packaging.requirements import Requirement


@@ -72,7 +72,7 @@ def _extract_extra_markers(req: Requirement) -> tuple[Requirement, set[str | Non
return req, cast(Set[Optional[str]], extra_markers) or {None}


def _get_extra(_marker: str | tuple[Variable, Op, Value]) -> str | None:
def _get_extra(_marker: str | tuple[Variable, Op, Variable]) -> str | None:
if isinstance(_marker, tuple) and len(_marker) == 3 and _marker[0].value == "extra" and _marker[1].value == "==":
return cast(str, _marker[2].value)
return _marker[2].value
return None
10 changes: 10 additions & 0 deletions tests/tox_env/python/pip/req/test_file.py
Original file line number Diff line number Diff line change
@@ -59,6 +59,16 @@
["-f", "http://some.archives.com/archives"],
id="find-links url",
),
pytest.param(
"--index-url a --find-links http://some.archives.com/archives",
{
"index_url": ["a"],
"find_links": ["http://some.archives.com/archives"],
},
[],
["-i", "a", "-f", "http://some.archives.com/archives"],
id="index and find",
),
pytest.param("-i a", {"index_url": ["a"]}, [], ["-i", "a"], id="index url short"),
pytest.param("--index-url a", {"index_url": ["a"]}, [], ["-i", "a"], id="index url long"),
pytest.param("-i a -i b\n-i c", {"index_url": ["c"]}, [], ["-i", "c"], id="index url multiple"),
10 changes: 5 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -43,17 +43,17 @@ passenv =
PROGRAMDATA
skip_install = true
deps =
pre-commit>=2.21
pre-commit>=3.2
commands =
pre-commit run --all-files --show-diff-on-failure {posargs}
python -c 'print(r"hint: run {envbindir}{/}pre-commit install to add checks as pre-commit hook")'

[testenv:type]
description = run type check on code base
deps =
mypy==0.991
types-cachetools>=5.3
types-chardet>=5.0.4.1
mypy==1.1.1
types-cachetools>=5.3.0.4
types-chardet>=5.0.4.2
commands =
mypy src/tox
mypy tests
@@ -82,7 +82,7 @@ commands =
description = do a release, required posarg of the version number
skip_install = true
deps =
gitpython>=3.1.30
gitpython>=3.1.31
packaging>=23
towncrier>=22.12
commands =
1 change: 1 addition & 0 deletions whitelist.txt
Original file line number Diff line number Diff line change
@@ -156,6 +156,7 @@ signum
sigterm
skipif
splitter
stacklevel
statemachine
string2lines
stringify