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 pkg resources iso7 - first part #8152

Closed
wants to merge 2 commits into from
Closed
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
3 changes: 0 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ updates:
# Allow both direct and indirect updates for all packages
- dependency-type: "all"
ignore:
# #6668
- dependency-name: "setuptools"
update-types: ["version-update:semver-major"]
- dependency-name: "pytest-inmanta-extensions"
versions: [">=0.0.1"]
- dependency-name: "pydantic"
Expand Down
4 changes: 4 additions & 0 deletions changelogs/unreleased/drop-pkg-resources-first-part.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
description: First part of `pkg_resources` library deprecation.
change-type: patch
destination-branches: [iso7]
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# serve to show the default.
import importlib.metadata
import shutil
import sys, os, pkg_resources, datetime
import sys, os, datetime
from importlib.metadata import PackageNotFoundError
from sphinx.errors import ConfigError

Expand Down
14 changes: 1 addition & 13 deletions mypy-baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -940,13 +940,8 @@ src/inmanta/execute/scheduler.py:0: error: Missing type parameters for generic t
src/inmanta/execute/scheduler.py:0: error: "<subclass of "DelayedResultVariable" and "RelationAttributeVariable">" has no attribute "attribute" [attr-defined]
src/inmanta/execute/scheduler.py:0: error: "<subclass of "DelayedResultVariable" and "RelationAttributeVariable">" has no attribute "attribute" [attr-defined]
src/inmanta/execute/scheduler.py:0: error: "<subclass of "DelayedResultVariable" and "RelationAttributeVariable">" has no attribute "attribute" [attr-defined]
src/inmanta/env.py:0: error: Argument 1 to "parse_requirements" has incompatible type "Sequence[CanonicalRequirement]"; expected "Sequence[str]" [arg-type]
src/inmanta/env.py:0: error: "type[WorkingSet]" has no attribute "_build_master" [attr-defined]
src/inmanta/env.py:0: error: Incompatible types in assignment (expression has type "WorkingSet", variable has type "Iterable[DistInfoDistribution]") [assignment]
src/inmanta/env.py:0: note: Following member(s) of "WorkingSet" have conflicts:
src/inmanta/env.py:0: note: Expected:
src/inmanta/env.py:0: note: def __iter__(self) -> Iterator[DistInfoDistribution]
src/inmanta/env.py:0: note: Got:
src/inmanta/env.py:0: note: def __iter__(self) -> Iterator[Distribution]
src/inmanta/env.py:0: error: Incompatible return value type (got "tuple[str | None, Loader | None] | None", expected "tuple[str | None, Loader] | None") [return-value]
src/inmanta/env.py:0: error: Item "None" of "ModuleSpec | None" has no attribute "submodule_search_locations" [union-attr]
src/inmanta/env.py:0: error: Item "None" of "ModuleSpec | None" has no attribute "submodule_search_locations" [union-attr]
Expand All @@ -957,7 +952,6 @@ src/inmanta/compiler/__init__.py:0: error: Incompatible types in assignment (exp
src/inmanta/compiler/__init__.py:0: error: Incompatible types in assignment (expression has type "Namespace | None", variable has type "Namespace") [assignment]
src/inmanta/compiler/__init__.py:0: error: Missing type parameters for generic type "ResultVariable" [type-arg]
src/inmanta/module.py:0: error: Missing type parameters for generic type Module [type-arg]
src/inmanta/module.py:0: error: Incompatible return value type (got "SpecifierSet", expected "str") [return-value]
src/inmanta/module.py:0: error: Returning Any from function declared to return "Mapping[str, object]" [no-any-return]
src/inmanta/module.py:0: error: Argument 1 to "Metadata" has incompatible type "**Mapping[str, object]"; expected "str" [arg-type]
src/inmanta/module.py:0: error: Argument 1 to "Metadata" has incompatible type "**Mapping[str, object]"; expected "str | None" [arg-type]
Expand All @@ -974,18 +968,12 @@ src/inmanta/module.py:0: error: Missing type parameters for generic type Module
src/inmanta/module.py:0: error: Missing type parameters for generic type Module [type-arg]
src/inmanta/module.py:0: error: Missing type parameters for generic type Module [type-arg]
src/inmanta/module.py:0: error: Missing type parameters for generic type Module [type-arg]
src/inmanta/module.py:0: error: Unsupported operand types for in ("Version" and "InmantaModuleRequirement") [operator]
src/inmanta/module.py:0: error: Missing type parameters for generic type Module [type-arg]
src/inmanta/module.py:0: error: Missing type parameters for generic type Module [type-arg]
src/inmanta/module.py:0: error: Missing type parameters for generic type Module [type-arg]
src/inmanta/module.py:0: error: Missing type parameters for generic type Module [type-arg]
src/inmanta/module.py:0: error: Missing type parameters for generic type Module [type-arg]
src/inmanta/module.py:0: error: Missing type parameters for generic type Module [type-arg]
src/inmanta/module.py:0: error: Incompatible return value type (got "pkg_resources._vendored_packaging.version.Version", expected "packaging.version.Version | None") [return-value]
src/inmanta/module.py:0: error: "str" has no attribute "filter" [attr-defined]
src/inmanta/module.py:0: error: Argument 4 to "__best_for_compiler_version" of "ModuleV1" has incompatible type "pkg_resources._vendored_packaging.version.Version"; expected "packaging.version.Version" [arg-type]
src/inmanta/module.py:0: error: Incompatible return value type (got "pkg_resources._vendored_packaging.version.Version", expected "packaging.version.Version | None") [return-value]
src/inmanta/module.py:0: error: Incompatible return value type (got "pkg_resources._vendored_packaging.version.Version", expected "packaging.version.Version | None") [return-value]
src/inmanta/moduletool.py:0: error: Skipping analyzing "cookiecutter.main": module is installed, but missing library stubs or py.typed marker [import-untyped]
src/inmanta/moduletool.py:0: error: Missing type parameters for generic type "ModuleLike" [type-arg]
src/inmanta/moduletool.py:0: error: Missing type parameters for generic type Module [type-arg]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"pynacl~=1.5",
"python-dateutil~=2.0",
"pyyaml~=6.0",
"setuptools<71",
"setuptools",
"texttable~=1.0",
"tornado~=6.0",
# lower bound because of ilevkivskyi/typing_inspect#100
Expand Down
5 changes: 2 additions & 3 deletions src/inmanta/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
from logging import Logger
from typing import Any, Dict, Optional, Union, cast

import pkg_resources

import inmanta.util
from inmanta import const, data, env, protocol
from inmanta.agent import config as cfg
from inmanta.agent import handler
Expand Down Expand Up @@ -1460,7 +1459,7 @@ async def _install(self, sources: list[ModuleSource], requirements: Sequence[str
await loop.run_in_executor(
self.thread_pool,
self._env.install_for_config,
list(pkg_resources.parse_requirements(requirements)),
inmanta.util.parse_requirements(requirements),
pip_config,
)
await loop.run_in_executor(self.thread_pool, self._loader.deploy_version, sources)
Expand Down
Loading