Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests after new setuptools #3299

Merged
merged 1 commit into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,18 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.py }}
- name: Pick environment to run
run: |
import os; import platform; import sys; from pathlib import Path
env = f'TOXENV=py{"" if platform.python_implementation() == "CPython" else "py"}3{sys.version_info.minor}'
print(f"Picked: {env} for {sys.version} based of {sys.executable}")
with Path(os.environ["GITHUB_ENV"]).open("ta") as file_handler:
file_handler.write(env)
shell: python
- name: Setup test suite
run: tox r -e py${{ matrix.py }} -vv --notest
run: tox r -vv --notest
- name: Run test suite
run: tox r -e py${{ matrix.py }} --skip-pkg-install
run: tox r --skip-pkg-install
env:
CI_RUN: "yes"
DIFF_AGAINST: HEAD
Expand Down
17 changes: 11 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
build-backend = "hatchling.build"
requires = [
"hatch-vcs>=0.4",
"hatchling>=1.24.2",
"hatchling>=1.25",
]

[project]
Expand Down Expand Up @@ -41,6 +41,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Testing",
"Topic :: Utilities",
Expand All @@ -52,21 +53,21 @@ dependencies = [
"cachetools>=5.3.3",
"chardet>=5.2",
"colorama>=0.4.6",
"filelock>=3.15.3",
"filelock>=3.15.4",
"importlib-metadata>=7.2; python_version<'3.8'",
"packaging>=24.1",
"platformdirs>=4.2.2",
"pluggy>=1.5",
"pyproject-api>=1.6.1",
"pyproject-api>=1.7.1",
"tomli>=2.0.1; python_version<'3.11'",
"typing-extensions>=4.12.2; python_version<'3.8'",
"virtualenv>=20.26.2",
"virtualenv>=20.26.3",
]
optional-dependencies.docs = [
"furo>=2024.5.6",
"sphinx>=7.3.7",
"sphinx-argparse-cli>=1.16",
"sphinx-autodoc-typehints!=1.23.4,>=2.2.1",
"sphinx-autodoc-typehints!=1.23.4,>=2.2.2",
"sphinx-copybutton>=0.5.2",
"sphinx-inline-tabs>=2023.4.21",
"sphinxcontrib-towncrier>=0.2.1a0",
Expand All @@ -81,13 +82,14 @@ optional-dependencies.testing = [
"distlib>=0.3.8",
"flaky>=3.8.1",
"hatch-vcs>=0.4",
"hatchling>=1.24.2",
"hatchling>=1.25",
"psutil>=6",
"pytest>=8.2.2",
"pytest-cov>=5",
"pytest-mock>=3.14",
"pytest-xdist>=3.6.1",
"re-assert>=1.1",
"setuptools>=70.1",
"time-machine>=2.14.1; implementation_name!='pypy'",
"wheel>=0.43",
]
Expand Down Expand Up @@ -158,6 +160,9 @@ skip = "*.svg"
ignore-words = "ignore-words.txt"
count = true

[tool.pyproject-fmt]
max_supported_python = "3.13"

[tool.pytest.ini_options]
testpaths = [
"tests",
Expand Down
2 changes: 0 additions & 2 deletions tests/session/cmd/test_sequential.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ def test_result_json_sequential(
(0, "install_requires"),
(None, "_optional_hooks"),
(None, "get_requires_for_build_wheel"),
(0, "install_requires_for_build_wheel"),
(0, "freeze"),
]
packaging_test = get_cmd_exit_run_id(log_report, ".pkg", "test")
Expand Down Expand Up @@ -299,7 +298,6 @@ def test_skip_develop_mode(tox_project: ToxProjectCreator, demo_pkg_setuptools:
(".pkg", "install_requires"),
(".pkg", "_optional_hooks"),
(".pkg", "get_requires_for_build_editable"),
(".pkg", "install_requires_for_build_editable"),
(".pkg", "build_editable"),
("py", "install_package"),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def test_tox_install_pkg_sdist(tox_project: ToxProjectCreator, pkg_with_extras_p
(".pkg_external_sdist_meta", "_optional_hooks", []),
(".pkg_external_sdist_meta", "get_requires_for_build_sdist", []),
(".pkg_external_sdist_meta", "get_requires_for_build_wheel", []), # required before prepare_metadata*
(".pkg_external_sdist_meta", "install_requires_for_build_wheel", ["wheel"]),
(".pkg_external_sdist_meta", "prepare_metadata_for_build_wheel", []),
("py", "install_package_deps", deps),
("py", "install_package", ["--force-reinstall", "--no-deps", str(pkg_with_extras_project_sdist)]),
Expand Down
4 changes: 2 additions & 2 deletions tests/tox_env/python/virtual_env/test_setuptools.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ def test_setuptools_package(
assert len(py_messages) == 5, "\n".join(py_messages) # 1 install wheel + 3 command + 1 final report

package_messages = [i for i in result if ".pkg: " in i]
# 1 optional hooks + 1 install requires + 1 build requires + 1 build meta + 1 build isolated
assert len(package_messages) == 5, "\n".join(package_messages)
# 1 optional hooks + 1 install requires + 1 build meta + 1 build isolated
assert len(package_messages) == 4, "\n".join(package_messages)
Loading