From c32b251a418410ee5f801d735fa814c709434277 Mon Sep 17 00:00:00 2001 From: Ilia Kurenkov Date: Mon, 13 Jan 2025 14:20:10 +0100 Subject: [PATCH] Drop unused scandir dependency (#19380) * Drop unused scandir dependency * add changelog * update agent requirements * fix changelog number * fix license file --- LICENSE-3rdparty.csv | 1 - agent_requirements.in | 1 - directory/changelog.d/19380.fixed | 1 + directory/datadog_checks/directory/traverse.py | 5 +---- directory/pyproject.toml | 5 +---- 5 files changed, 3 insertions(+), 10 deletions(-) create mode 100644 directory/changelog.d/19380.fixed diff --git a/LICENSE-3rdparty.csv b/LICENSE-3rdparty.csv index 747ef923c3f87..29b65660a95a6 100644 --- a/LICENSE-3rdparty.csv +++ b/LICENSE-3rdparty.csv @@ -77,7 +77,6 @@ requests-oauthlib,PyPI,ISC,Copyright (c) 2014 Kenneth Reitz. requests-toolbelt,PyPI,Apache-2.0,"Copyright 2014 Ian Cordasco, Cory Benfield" requests-unixsocket2,PyPI,ISC,Copyright (c) 2024 - 2024 thelab rethinkdb,PyPI,Apache-2.0,Copyright 2018 RethinkDB. -scandir,PyPI,BSD-3-Clause,"Copyright (c) 2012, Ben Hoyt" securesystemslib,PyPI,MIT,Copyright (c) 2016 Santiago Torres semver,PyPI,BSD-3-Clause,"Copyright (c) 2013, Konstantine Rybnikov" service-identity,PyPI,MIT,Copyright (c) 2014 Hynek Schlawack and the service-identity contributors diff --git a/agent_requirements.in b/agent_requirements.in index 50d458aba5e3c..44250c09d2a44 100644 --- a/agent_requirements.in +++ b/agent_requirements.in @@ -61,7 +61,6 @@ requests-toolbelt==1.0.0 requests-unixsocket2==0.4.2 requests==2.32.3 rethinkdb==2.4.10post1 -scandir==1.10.0; python_version < '3.5' securesystemslib[crypto,pynacl]==0.28.0 semver==3.0.2 service-identity[idna]==24.1.0 diff --git a/directory/changelog.d/19380.fixed b/directory/changelog.d/19380.fixed new file mode 100644 index 0000000000000..d534e60ef90f6 --- /dev/null +++ b/directory/changelog.d/19380.fixed @@ -0,0 +1 @@ +Drop unused scandir dependency. diff --git a/directory/datadog_checks/directory/traverse.py b/directory/datadog_checks/directory/traverse.py index 38db22d2c6cfe..c4fd0493ec825 100644 --- a/directory/datadog_checks/directory/traverse.py +++ b/directory/datadog_checks/directory/traverse.py @@ -1,10 +1,7 @@ # (C) Datadog, Inc. 2018-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) -try: - from os import scandir -except ImportError: - from scandir import scandir +from os import scandir def walk(top, onerror=None, followlinks=False): diff --git a/directory/pyproject.toml b/directory/pyproject.toml index a89d0b6042d98..de30e7a116166 100644 --- a/directory/pyproject.toml +++ b/directory/pyproject.toml @@ -35,10 +35,7 @@ dynamic = [ ] [project.optional-dependencies] -deps = [ - # Starting with Python 3.5 'scandir.scandir' is in the standard library as 'os.scandir'. - "scandir==1.10.0; python_version < '3.5'", -] +deps = [] [project.urls] Source = "https://github.com/DataDog/integrations-core"