Skip to content

Commit

Permalink
Replace importlib.resources.__read_text__
Browse files Browse the repository at this point in the history
Deprecated
  • Loading branch information
leonlan committed Sep 5, 2023
1 parent 10eb3ae commit 969bfd1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ codecov = "^2.1.13"
pytest-cov = "^4.0.0"
pre-commit = "^2.19.0"

[pytest]
pythonpath = [".", "vrplib"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
Expand Down
4 changes: 2 additions & 2 deletions vrplib/download/list_names.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import importlib.resources as pkg_resource
from functools import lru_cache
from importlib.resources import files
from typing import Optional

from .download_utils import is_vrptw
Expand Down Expand Up @@ -49,7 +49,7 @@ def _read_instance_data():
Reads the instance data. All CVRPLIB instance names are stored in the
`instance_data.csv` file.
"""
fi = pkg_resource.read_text(__package__, "instance_data.csv")
fi = (files("vrplib.download") / "instance_data.csv").read_text()
instances = [line.strip().split(",") for line in fi.split()]

return [
Expand Down

0 comments on commit 969bfd1

Please sign in to comment.