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

Drop support for EOL Python 3.8 #330

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 0 additions & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ jobs:
- "3.11"
- "3.10"
- "3.9"
- "3.8"
os:
- ubuntu-latest
- windows-latest
Expand Down
45 changes: 22 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ maintainers = [
{ name = "Ofek Lev", email = "[email protected]" },
{ name = "Ronny Pfannschmidt", email = "[email protected]" },
]
requires-python = ">=3.8"
requires-python = ">=3.9"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down Expand Up @@ -102,7 +101,6 @@ matrix = [
"3.11",
"3.10",
"3.9",
"3.8",
"pypy3.10",
] },
]
Expand Down Expand Up @@ -203,41 +201,42 @@ scripts = { "run" = [
] }

[tool.ruff]
target-version = "py38"
target-version = "py39"
line-length = 120
format.preview = true
lint.preview = true
select = [
lint.select = [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't change anything in the config below, except for these section renamings advised by ruff:

warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `pyproject.toml`:
  - 'ignore' -> 'lint.ignore'
  - 'select' -> 'lint.select'
  - 'isort' -> 'lint.isort'
  - 'per-file-ignores' -> 'lint.per-file-ignores'

And then the formatter re-ordered the sections.

Ruff also gave this warning, but I've not done anything about it, but can do if you like:

warning: The following rules may cause conflicts when used with the formatter: COM812, ISC001. To avoid unexpected behavior, we recommend disabling these rules, either by removing them from the select or extend-select configuration, or adding them to the ignore configuration.

"ALL",
]
isort = { known-first-party = [
"platformdirs",
"tests",
], required-imports = [
"from __future__ import annotations",
] }
ignore = [
lint.ignore = [
"ANN101", # Missing type annotation for `self` in method
"D301", # Use `r"""` if any backslashes in a docstring
"D205", # 1 blank line required between summary line and description
"D401", # The first line of docstring should be in imperative mood
"CPY", # no copyright notices
"D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible
"D205", # 1 blank line required between summary line and description
"D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible
"S104", # Possible binding to all interfaces
"CPY", # no copyright notices
"D301", # Use `r"""` if any backslashes in a docstring
"D401", # The first line of docstring should be in imperative mood
"DOC", # no support for restructuredtext
"S104", # Possible binding to all interfaces
]
per-file-ignores."tests/**/*.py" = [
"S101", # asserts allowed in tests
lint.per-file-ignores."tests/**/*.py" = [
"D", # don't care about documentation in tests
"FBT", # don't care about booleans as positional arguments in tests
"INP001", # no implicit namespace
"D", # don't care about documentation in tests
"S603", # `subprocess` call: check for execution of untrusted input
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
"PLC2701", # Private name import
"PLR0917", # Too many positional arguments
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable
"S101", # asserts allowed in tests
"S603", # `subprocess` call: check for execution of untrusted input
]

lint.isort = { known-first-party = [
"platformdirs",
"tests",
], required-imports = [
"from __future__ import annotations",
] }
lint.preview = true

[tool.codespell]
builtin = "clear,usage,en-GB_to_en-US"
count = true
Expand Down
3 changes: 2 additions & 1 deletion src/platformdirs/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
from typing import TYPE_CHECKING

if TYPE_CHECKING:
from typing import Iterator, Literal
from collections.abc import Iterator
from typing import Literal


class PlatformDirsABC(ABC): # noqa: PLR0904
Expand Down
5 changes: 4 additions & 1 deletion src/platformdirs/unix.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@
import sys
from configparser import ConfigParser
from pathlib import Path
from typing import Iterator, NoReturn
from typing import TYPE_CHECKING, NoReturn

from .api import PlatformDirsABC

if TYPE_CHECKING:
from collections.abc import Iterator

if sys.platform == "win32":

def getuid() -> NoReturn:
Expand Down
Loading