File: remove-importlib_resources.patch

package info (click to toggle)
dials-data 2.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 944 kB
  • sloc: python: 647; sh: 31; makefile: 24
file content (81 lines) | stat: -rw-r--r-- 2,291 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
--- a/dials_data/datasets.py
+++ b/dials_data/datasets.py
@@ -8,7 +8,7 @@
 from pathlib import Path
 from typing import Any
 
-import importlib_resources
+import importlib.resources
 import yaml
 
 _hashinfo_formatversion = 1
@@ -25,8 +25,8 @@
     global definition, fileinfo_dirty
     definition = {}
     fileinfo_dirty = set()
-    base_directory = importlib_resources.files("dials_data") / "definitions"
-    hash_directory = importlib_resources.files("dials_data") / "hashinfo"
+    base_directory = importlib.resources.files("dials_data") / "definitions"
+    hash_directory = importlib.resources.files("dials_data") / "hashinfo"
     for definition_file in base_directory.glob("*.yml"):
         dataset_definition = definition_file.read_bytes()
         dataset_name = definition_file.stem
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -3,5 +3,5 @@
 build-backend = "setuptools.build_meta"
 
 [[tool.mypy.overrides]]
-module = [ "py", "py.path", "pytest", "importlib_resources" ]
+module = [ "py", "py.path", "pytest" ]
 ignore_missing_imports = true
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,3 @@
-importlib_resources==5.4.0
 py==1.11.0
 pytest==7.0.1
 pyyaml==6.0
--- a/requirements_dev.txt
+++ b/requirements_dev.txt
@@ -1,6 +1,5 @@
 collective.checkdocs==0.2
 coverage==6.3.2
-importlib_resources==5.4.0
 py==1.11.0
 pytest==7.0.1
 pyyaml==6.0
--- a/setup.cfg
+++ b/setup.cfg
@@ -28,7 +28,6 @@
 [options]
 include_package_data = True
 install_requires =
-    importlib_resources>=1.1
     pytest
     pyyaml
     requests
--- a/tests/test_yaml_files.py
+++ b/tests/test_yaml_files.py
@@ -3,18 +3,18 @@
 import collections
 import string
 
-import importlib_resources
+import importlib.resources
 import pytest
 import yaml
 
 definition_yamls = collections.OrderedDict(
     (fn.name, fn)
-    for fn in importlib_resources.files("dials_data").joinpath("definitions").iterdir()
+    for fn in importlib.resources.files("dials_data").joinpath("definitions").iterdir()
     if fn.suffix != ".MD"
 )
 hashinfo_yamls = collections.OrderedDict(
     (fn.name, fn)
-    for fn in importlib_resources.files("dials_data").joinpath("hashinfo").iterdir()
+    for fn in importlib.resources.files("dials_data").joinpath("hashinfo").iterdir()
     if fn.suffix != ".MD"
 )