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

build: drop support for EOL py37 #743

Merged
merged 3 commits into from
Mar 1, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/reusable-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ jobs:
- macos
- windows
py:
- "pypy-3.7"
- "pypy-3.8"
- "pypy-3.9"
layday marked this conversation as resolved.
Show resolved Hide resolved
- "pypy-3.10"
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
- "3.7"
tox-target:
- "tox"
- "min"
Expand All @@ -32,7 +31,7 @@ jobs:
${{
(
startsWith(matrix.py, 'pypy-')
&& (!endsWith(matrix.py, '-3.7') || matrix.os == 'windows')
&& matrix.os == 'windows'
)
&& true
|| false
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ Changelog
+++++++++


Unreleased
==========

- Dropped support for Python 3.7 (PR :pr:`743`)


1.1.1 (2024-02-29)
==================

Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ Compatibility
``build`` is verified to be compatible with the following Python
versions:

- 3.7
- 3.8
- 3.9
- 3.10
- 3.11
- 3.12
- PyPy3


Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "build"
version = "1.1.1"
description = "A simple, correct Python build frontend"
readme = "README.md"
requires-python = ">= 3.7"
requires-python = ">= 3.8"
license.file = "LICENSE"
authors = [
{ name = "Filipe Laíns", email = "lains@riseup.net" },
Expand All @@ -19,7 +19,6 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand Down Expand Up @@ -128,7 +127,7 @@ filterwarnings = [

[tool.mypy]
files = "src"
python_version = "3.7"
python_version = "3.8"
strict = true
show_error_codes = true
enable_error_code = ["ignore-without-code", "truthy-bool", "redundant-expr"]
Expand Down
5 changes: 1 addition & 4 deletions src/build/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,10 +366,7 @@ def log(message: str) -> None:

:param message: Message to output
"""
if sys.version_info >= (3, 8):
_logger.log(logging.INFO, message, stacklevel=2)
else:
_logger.log(logging.INFO, message)
_logger.log(logging.INFO, message, stacklevel=2)


__all__ = [
Expand Down
16 changes: 9 additions & 7 deletions src/build/_compat/importlib.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
from __future__ import annotations

import sys
import typing


if sys.version_info < (3, 8):
if typing.TYPE_CHECKING:
import importlib_metadata as metadata
elif sys.version_info >= (3, 10, 2):
from importlib import metadata
else:
try:
import importlib_metadata as metadata
except ModuleNotFoundError:
# helps bootstrapping when dependencies aren't installed
if sys.version_info >= (3, 10, 2):
from importlib import metadata
else:
try:
import importlib_metadata as metadata
except ModuleNotFoundError:

Check warning on line 15 in src/build/_compat/importlib.py

View check run for this annotation

Codecov / codecov/patch

src/build/_compat/importlib.py#L15

Added line #L15 was not covered by tests
# helps bootstrapping when dependencies aren't installed
from importlib import metadata

Check warning on line 17 in src/build/_compat/importlib.py

View check run for this annotation

Codecov / codecov/patch

src/build/_compat/importlib.py#L17

Added line #L17 was not covered by tests


__all__ = [
Expand Down
15 changes: 2 additions & 13 deletions src/build/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,10 @@
from ._util import check_dependency


if sys.version_info >= (3, 8):
from typing import Protocol
elif typing.TYPE_CHECKING:
from typing_extensions import Protocol
else:
Protocol = abc.ABC


_logger = logging.getLogger(__name__)


class IsolatedEnv(Protocol):
class IsolatedEnv(typing.Protocol):
"""Isolated build environment ABC."""

@property
Expand Down Expand Up @@ -207,10 +199,7 @@ def log(message: str) -> None:

:param msg: Message to output
"""
if sys.version_info >= (3, 8):
_logger.log(logging.INFO, message, stacklevel=2)
else:
_logger.log(logging.INFO, message)
_logger.log(logging.INFO, message, stacklevel=2)


def _create_isolated_env_virtualenv(path: str) -> tuple[str, str]:
Expand Down
9 changes: 2 additions & 7 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SPDX-License-Identifier: MIT

import contextlib
import importlib.metadata
import os
import os.path
import shutil
Expand All @@ -14,12 +15,6 @@
import build.env


if sys.version_info < (3, 8):
import importlib_metadata as metadata
else:
from importlib import metadata


def pytest_addoption(parser):
os.environ['PYTHONWARNINGS'] = 'ignore:DEPRECATION::pip._internal.cli.base_command' # for when not run within tox
os.environ['PIP_DISABLE_PIP_VERSION_CHECK'] = '1' # do not pollute stderr with upgrade advisory
Expand Down Expand Up @@ -141,6 +136,6 @@ def pytest_report_header() -> str:
for package in interesting_packages:
# Old versions of importlib_metadata made this FileNotFoundError
with contextlib.suppress(ModuleNotFoundError, FileNotFoundError):
valid.append(f'{package}=={metadata.version(package)}')
valid.append(f'{package}=={importlib.metadata.version(package)}')
reqs = ' '.join(valid)
return f'installed packages of interest: {reqs}'
5 changes: 0 additions & 5 deletions tests/test_module.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
# SPDX-License-Identifier: MIT

import sys

import pytest

import build


def test_version():
assert build.__version__


@pytest.mark.skipif(sys.version_info < (3, 7), reason='Python 3.7+ required for dir support')
def test_dir():
assert set(dir(build)) == set(build.__all__)
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env_list =
type
docs
path
{py312, py311, py310, py39, py38, py37, pypy39, pypy38, pypy37}{, -min}
{py312, py311, py310, py39, py38, pypy310, pypy39, pypy38}{, -min}
skip_missing_interpreters = true

[testenv]
Expand Down Expand Up @@ -69,7 +69,7 @@ set_env =
commands_pre =
python -E -m pip uninstall -y build colorama

[testenv:{py312, py311, py310, py39, py38, py37, pypy37, pypy38, pypy39}-min]
[testenv:{py312, py311, py310, py39, py38, pypy38, pypy39, pypy310}-min]
description = check minimum versions required of all dependencies
skip_install = true
commands_pre =
Expand Down Expand Up @@ -105,7 +105,7 @@ commands =
python -m diff_cover.diff_cover_tool --compare-branch {env:DIFF_AGAINST:origin/main} {toxworkdir}/coverage.xml
depends =
path
{py312, py311, py310, py39, py38, py37, pypy39, pypy38, pypy37}{, -min}
{py312, py311, py310, py39, py38, pypy310, pypy39, pypy38}{, -min}

[testenv:bump]
description = bump versions, pass major/minor/patch
Expand Down