mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-04 19:40:02 +03:00
[2367] Remove pkg_resources
This commit is contained in:
parent
001dc70f78
commit
edf5e5c4ef
@ -51,7 +51,7 @@ repos:
|
||||
- id: mypy
|
||||
# verbose: true
|
||||
# log_file: 'pre-commit_mypy.log'
|
||||
additional_dependencies: [ types-pkg-resources, types-requests, types-urllib3 ]
|
||||
additional_dependencies: [ types-setuptools, types-requests, types-urllib3 ]
|
||||
# args: [ "--follow-imports", "skip", "--ignore-missing-imports", "--scripts-are-modules" ]
|
||||
|
||||
### # pydocstyle.exe <file>
|
||||
|
1
build.py
1
build.py
@ -129,7 +129,6 @@ def build() -> None:
|
||||
"packages": [
|
||||
"asyncio",
|
||||
"multiprocessing",
|
||||
"pkg_resources._vendor.platformdirs",
|
||||
"sqlite3",
|
||||
"util",
|
||||
],
|
||||
|
@ -5,7 +5,7 @@ wheel
|
||||
# We can't rely on just picking this up from either the base (not venv),
|
||||
# or venv-init-time version. Specify here so that dependabot will prod us
|
||||
# about new versions.
|
||||
setuptools==70.0.0
|
||||
setuptools==75.8.0
|
||||
|
||||
# Static analysis tools
|
||||
flake8==7.1.1
|
||||
@ -22,7 +22,7 @@ mypy==1.14.1
|
||||
pep8-naming==0.14.1
|
||||
safety==3.2.14
|
||||
types-requests==2.32.0.20241016
|
||||
types-pkg-resources==0.1.3
|
||||
types-setuptools==75.8.0.20250210
|
||||
|
||||
# Code formatting tools
|
||||
autopep8==2.3.2
|
||||
|
@ -1,34 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Search for dependencies given a package."""
|
||||
import sys
|
||||
|
||||
import pkg_resources
|
||||
|
||||
|
||||
def find_reverse_deps(package_name: str) -> list[str]:
|
||||
"""
|
||||
Find the packages that depend on the named one.
|
||||
|
||||
:param package_name: Target package.
|
||||
:return: List of packages that depend on this one.
|
||||
"""
|
||||
return [
|
||||
pkg.project_name for pkg in pkg_resources.WorkingSet()
|
||||
if package_name in {req.project_name for req in pkg.requires()}
|
||||
]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) != 2:
|
||||
print("Usage: python reverse_deps.py <package_name>")
|
||||
sys.exit(1)
|
||||
|
||||
package_name = sys.argv[1]
|
||||
reverse_deps = find_reverse_deps(package_name)
|
||||
|
||||
if reverse_deps:
|
||||
print(f"Reverse dependencies of '{package_name}':")
|
||||
for dep in reverse_deps:
|
||||
print(dep)
|
||||
else:
|
||||
print(f"No reverse dependencies found for '{package_name}'.")
|
Loading…
x
Reference in New Issue
Block a user