Skip to content

Commit

Permalink
feat!: drop Python 3.8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
BoboTiG committed Aug 11, 2024
1 parent dbb3a84 commit d1f1e49
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 36 deletions.
16 changes: 8 additions & 8 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ task:
image_family: freebsd-12-2

install_script:
- pkg install -y python38 py38-sqlite3
- pkg install -y python39 py39-sqlite3
# Print the Python version, only to be sure we are running the version we want
- python3.8 -c 'import platform; print("Python", platform.python_version())'
- python3.9 -c 'import platform; print("Python", platform.python_version())'
# Check SQLite3 is installed
- python3.8 -c 'import sqlite3; print("SQLite3", sqlite3.version)'
- python3.9 -c 'import sqlite3; print("SQLite3", sqlite3.version)'
setup_script:
- python3.8 -m ensurepip
- python3.8 -m pip install -U pip
- python3.8 -m pip install -r requirements-tests.txt
- python3.9 -m ensurepip
- python3.9 -m pip install -U pip
- python3.9 -m pip install -r requirements-tests.txt
lint_script:
- python3.8 -m ruff src
- python3.9 -m ruff src
tests_script:
- python3.8 -bb -m pytest tests
- python3.9 -bb -m pytest tests
1 change: 0 additions & 1 deletion .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ jobs:
- name: Build wheels
run: python -m cibuildwheel
env:
CIBW_SKIP: "cp36-*" # skip 3.6 wheels
CIBW_ARCHS_MACOS: "x86_64 universal2 arm64"
- name: Artifacts list
run: ls -l wheelhouse
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,11 @@ jobs:
emoji: 🪟
runs-on: [windows-latest]
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13-dev"
- "pypy-3.8"
- "pypy-3.9"
include:
- tox:
Expand All @@ -67,15 +65,9 @@ jobs:
emoji: 🐧
runs-on: [ubuntu-latest]
exclude:
- os:
matrix: macos
python: "pypy-3.8"
- os:
matrix: macos
python: "pypy-3.9"
- os:
matrix: windows
python: "pypy-3.8"
- os:
matrix: windows
python: "pypy-3.9"
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Watchdog

Python API and shell utilities to monitor file system events.

Works on 3.8+.
Works on 3.9+.

Example API Usage
-----------------
Expand Down Expand Up @@ -211,7 +211,7 @@ appropriate observer like in the example above, do::
Dependencies
------------

1. Python 3.8 or above.
1. Python 3.9 or above.
2. XCode_ (only on macOS when installing from sources)
3. PyYAML_ (only for ``watchmedo``)

Expand Down
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Watchdog

Python API library and shell utilities to monitor file system events.

Works on 3.8+.
Works on 3.9+.

Directory monitoring made easy with
-----------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Installation
============
|project_name| requires 3.8+ to work. See a list of :ref:`installation-dependencies`.
|project_name| requires 3.9+ to work. See a list of :ref:`installation-dependencies`.

Installing from PyPI using pip
------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ addopts = """
[tool.ruff]
line-length = 120
indent-width = 4
target-version = "py38"
target-version = "py39"

[tool.ruff.lint]
extend-select = ["ALL"]
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"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 All @@ -155,6 +154,6 @@
"watchmedo = watchdog.watchmedo:main [watchmedo]",
]
},
python_requires=">=3.8",
python_requires=">=3.9",
zip_safe=False,
)
14 changes: 3 additions & 11 deletions src/watchdog/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@

import sys
import threading
from typing import TYPE_CHECKING

# Using `as` to explicitly re-export this since this is a compatibility layer
from typing import Protocol as Protocol


class UnsupportedLibc(Exception):
Expand Down Expand Up @@ -130,13 +132,3 @@ def load_class(dotted_path):
# return klass(*args, **kwargs)

raise AttributeError(f"Module {module_name} does not have class attribute {klass_name}")


if TYPE_CHECKING or sys.version_info >= (3, 8):
# using `as` to explicitly re-export this since this is a compatibility layer
from typing import Protocol as Protocol
else:
# Provide a dummy Protocol class when not available from stdlib. Should be used
# only for hinting. This could be had from typing_protocol, but not worth adding
# the _first_ dependency just for this.
class Protocol: ...
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py3{8,9,10,11,12,13}
py3{9,10,11,12,13}
pypy3
docs
types
Expand Down

0 comments on commit d1f1e49

Please sign in to comment.