File tree Expand file tree Collapse file tree 11 files changed +47
-14
lines changed Expand file tree Collapse file tree 11 files changed +47
-14
lines changed Original file line number Diff line number Diff line change
1
+ tidelift : pypi/importlib-resources
Original file line number Diff line number Diff line change 1
1
repos :
2
2
- repo : https://github.com/psf/black
3
- rev : 22.1 .0
3
+ rev : 22.6 .0
4
4
hooks :
5
5
- id : black
Original file line number Diff line number Diff line change 5
5
representing a directory and (when needed) renders the
6
6
full tree to a temporary directory.
7
7
8
+ v5.8.1
9
+ ======
10
+
11
+ * #253: In ``MultiplexedPath ``, restore expectation that
12
+ a compound path with a non-existent directory does not
13
+ raise an exception.
14
+
8
15
v5.8.0
9
16
======
10
17
Original file line number Diff line number Diff line change 20
20
.. image :: https://img.shields.io/badge/skeleton-2022-informational
21
21
:target: https://blog.jaraco.com/skeleton
22
22
23
+ .. image :: https://tidelift.com/badges/package/pypi/importlib-resources
24
+ :target: https://tidelift.com/subscription/pkg/pypi-importlib-resources?utm_source=pypi-importlib-resources&utm_medium=readme
25
+
23
26
``importlib_resources `` is a backport of Python standard library
24
27
`importlib.resources
25
28
<https://docs.python.org/3/library/importlib.html#module-importlib.resources> `_
@@ -53,3 +56,19 @@ were contributed to different versions in the standard library:
53
56
- 3.9
54
57
* - 0.5 (?)
55
58
- 3.7
59
+
60
+ For Enterprise
61
+ ==============
62
+
63
+ Available as part of the Tidelift Subscription.
64
+
65
+ This project and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use.
66
+
67
+ `Learn more <https://tidelift.com/subscription/pkg/pypi-importlib-resources?utm_source=pypi-importlib-resources&utm_medium=referral&utm_campaign=github >`_.
68
+
69
+ Security Contact
70
+ ================
71
+
72
+ To report a security vulnerability, please use the
73
+ `Tidelift security contact <https://tidelift.com/security >`_.
74
+ Tidelift will coordinate the fix and disclosure.
Original file line number Diff line number Diff line change 38
38
intersphinx_mapping = {
39
39
'python' : ('https://docs.python.org/3' , None ),
40
40
}
41
+
42
+ extensions += ['jaraco.tidelift' ]
Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ The documentation here includes a general :ref:`usage <using>` guide and a
31
31
migration.rst
32
32
history.rst
33
33
34
+ .. tidelift-referral-banner ::
35
+
34
36
35
37
Indices and tables
36
38
==================
Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ a package is a directory or not::
148
148
149
149
The ``importlib_resources `` equivalent is straightforward::
150
150
151
- if importlib_resources.files('my.package').joinpath('resource').isdir ():
151
+ if importlib_resources.files('my.package').joinpath('resource').is_dir ():
152
152
print('A directory')
153
153
154
154
Original file line number Diff line number Diff line change @@ -85,13 +85,10 @@ def is_file(self):
85
85
def joinpath (self , * descendants ):
86
86
try :
87
87
return super ().joinpath (* descendants )
88
- except abc .TraversalError as exc :
89
- # One of the paths didn't resolve.
90
- msg , target , names = exc .args
91
- if names : # pragma: nocover
92
- raise
93
- # It was the last; construct result with the first path.
94
- return self ._paths [0 ].joinpath (target )
88
+ except abc .TraversalError :
89
+ # One of the paths did not resolve (a directory does not exist).
90
+ # Just return something that will not exist.
91
+ return self ._paths [0 ].joinpath (* descendants )
95
92
96
93
def open (self , * args , ** kwargs ):
97
94
raise FileNotFoundError (f'{ self } is not a file' )
Original file line number Diff line number Diff line change @@ -77,6 +77,10 @@ def test_join_path(self):
77
77
)
78
78
self .assertEqual (path .joinpath (), path )
79
79
80
+ def test_join_path_compound (self ):
81
+ path = MultiplexedPath (self .folder )
82
+ assert not path .joinpath ('imaginary/foo.py' ).exists ()
83
+
80
84
def test_repr (self ):
81
85
self .assertEqual (
82
86
repr (MultiplexedPath (self .folder )),
Original file line number Diff line number Diff line change @@ -7,14 +7,14 @@ skip-string-normalization = true
7
7
8
8
[tool .setuptools_scm ]
9
9
10
- [pytest . enabler .black ]
10
+ [tool . pytest- enabler .black ]
11
11
addopts = " --black"
12
12
13
- [pytest . enabler .mypy ]
13
+ [tool . pytest- enabler .mypy ]
14
14
addopts = " --mypy"
15
15
16
- [pytest . enabler .flake8 ]
16
+ [tool . pytest- enabler .flake8 ]
17
17
addopts = " --flake8"
18
18
19
- [pytest . enabler .cov ]
19
+ [tool . pytest- enabler .cov ]
20
20
addopts = " --cov"
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ testing =
41
41
pytest-mypy >= 0.9.1; \
42
42
# workaround for jaraco/skeleton#22
43
43
python_implementation != " PyPy"
44
- pytest-enabler >= 1.0.1
44
+ pytest-enabler >= 1.3
45
45
46
46
# local
47
47
50
50
sphinx
51
51
jaraco.packaging >= 9
52
52
rst.linker >= 1.9
53
+ jaraco.tidelift >= 1.4
53
54
54
55
# local
You can’t perform that action at this time.
0 commit comments