File tree Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Expand file tree Collapse file tree 3 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -44,11 +44,11 @@ jobs:
44
44
45
45
- name : " Install dependencies"
46
46
run : |
47
+ python -m pip install --upgrade 'pip ${{ matrix.pip-version }}'
47
48
# We use '--ignore-installed' to avoid GitHub's cache which can cause
48
49
# issues - we have seen packages from this cache be cause trouble with
49
50
# pip-extra-reqs.
50
51
python -m pip install --ignore-installed --upgrade --editable .[dev]
51
- python -m pip install --upgrade 'pip ${{ matrix.pip-version }}'
52
52
python -m pip install flake8
53
53
54
54
- name : " Lint"
Original file line number Diff line number Diff line change 1
1
import collections
2
2
import logging
3
+ import pathlib
3
4
import optparse
4
5
import os
5
6
import sys
@@ -28,7 +29,16 @@ def find_extra_reqs(options, requirements_filename):
28
29
else :
29
30
package_name = package .name
30
31
package_location = package .location
31
- package_files = package .files or []
32
+ package_files = []
33
+ for item in (package .files or []):
34
+ here = pathlib .Path ('.' ).resolve ()
35
+ item_location_rel = (pathlib .Path (package_location ) / item )
36
+ item_location = item_location_rel .resolve ()
37
+ if item_location .is_relative_to (here ):
38
+ relative_item_location = item_location .relative_to (here )
39
+ else :
40
+ relative_item_location = item_location
41
+ package_files .append (str (relative_item_location ))
32
42
33
43
log .debug ('installed package: %s (at %s)' , package_name ,
34
44
package_location )
Original file line number Diff line number Diff line change 2
2
import logging
3
3
import optparse
4
4
import os
5
+ import pathlib
5
6
import sys
6
7
7
8
from packaging .utils import canonicalize_name
@@ -35,7 +36,16 @@ def find_missing_reqs(options, requirements_filename):
35
36
else :
36
37
package_name = package .name
37
38
package_location = package .location
38
- package_files = package .files or []
39
+ package_files = []
40
+ for item in (package .files or []):
41
+ here = pathlib .Path ('.' ).resolve ()
42
+ item_location_rel = (pathlib .Path (package_location ) / item )
43
+ item_location = item_location_rel .resolve ()
44
+ if item_location .is_relative_to (here ):
45
+ relative_item_location = item_location .relative_to (here )
46
+ else :
47
+ relative_item_location = item_location
48
+ package_files .append (str (relative_item_location ))
39
49
40
50
log .debug ('installed package: %s (at %s)' , package_name ,
41
51
package_location )
You can’t perform that action at this time.
0 commit comments