Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
declearn2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Magnet
DecLearn
declearn2
Commits
afc29510
Verified
Commit
afc29510
authored
1 year ago
by
ANDREY Paul
Browse files
Options
Downloads
Patches
Plain Diff
Replace deprecated 'pkg_resources' with 'importlib.metadata'.
parent
a8cfa7cc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#816251
failed
1 year ago
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
declearn/test_utils/_vectors.py
+3
-3
3 additions, 3 deletions
declearn/test_utils/_vectors.py
with
3 additions
and
3 deletions
declearn/test_utils/_vectors.py
+
3
−
3
View file @
afc29510
...
...
@@ -18,11 +18,11 @@
"""
Shared objects for testing purposes.
"""
import
importlib
import
importlib.metadata
import
typing
from
typing
import
List
,
Literal
,
Optional
,
Type
import
numpy
as
np
import
pkg_resources
# type: ignore
from
numpy.typing
import
ArrayLike
from
declearn.model.api
import
Vector
...
...
@@ -43,8 +43,8 @@ def list_available_frameworks() -> List[FrameworkType]:
available
=
[]
for
framework
in
typing
.
get_args
(
FrameworkType
):
try
:
pkg_resources
.
require
(
framework
)
except
pkg_resources
.
Distribution
NotFound
:
importlib
.
metadata
.
distribution
(
framework
)
except
importlib
.
metadata
.
Package
NotFound
Error
:
pass
else
:
available
.
append
(
framework
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment