1.1.0: TypeError: installed_distributions() got an unexpected keyword argument 'paths'
See original GitHub issueBug description
I tried running the self tests for 1.1.0 using the github source file on NetBSD.
Reproduction steps
Build, and run pytest
.
Screenshots and logs
___________________________________________________________ test_pip_source ___________________________________________________________
self = <pip_audit._dependency_source.pip.PipSource object at 0x77deac90a910>
def collect(self) -> Iterator[Dependency]:
"""
Collect all of the dependencies discovered by this `PipSource`.
Raises a `PipSourceError` on any errors.
"""
# The `pip list` call that underlies `pip_api` could fail for myriad reasons.
# We collect them all into a single well-defined error.
try:
> for (_, dist) in pip_api.installed_distributions(
local=self._local, paths=list(self._paths)
).items():
E TypeError: installed_distributions() got an unexpected keyword argument 'paths'
pip_audit/_dependency_source/pip.py:72: TypeError
The above exception was the direct cause of the following exception:
def test_pip_source():
source = pip.PipSource()
# We're running under pytest, so we can safely assume that pytest is in
# our execution environment. We're also running pip_audit itself, so we
# can safely test for ourselves.
pytest_spec = ResolvedDependency(name="pytest", version=Version(pytest.__version__))
pip_audit_spec = ResolvedDependency(name="pip-audit", version=Version(pip_audit.__version__))
> specs = list(source.collect())
test/dependency_source/test_pip.py:24:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pip_audit._dependency_source.pip.PipSource object at 0x77deac90a910>
def collect(self) -> Iterator[Dependency]:
"""
Collect all of the dependencies discovered by this `PipSource`.
Raises a `PipSourceError` on any errors.
"""
# The `pip list` call that underlies `pip_api` could fail for myriad reasons.
# We collect them all into a single well-defined error.
try:
for (_, dist) in pip_api.installed_distributions(
local=self._local, paths=list(self._paths)
).items():
dep: Dependency
try:
dep = ResolvedDependency(name=dist.name, version=Version(str(dist.version)))
if self.state is not None:
self.state.update_state(
f"Collecting {dep.name} ({dep.version})"
) # pragma: no cover
except InvalidVersion:
skip_reason = (
"Package has invalid version and could not be audited: "
f"{dist.name} ({dist.version})"
)
logger.debug(skip_reason)
dep = SkippedDependency(name=dist.name, skip_reason=skip_reason)
yield dep
except Exception as e:
> raise PipSourceError("failed to list installed distributions") from e
E pip_audit._dependency_source.pip.PipSourceError: failed to list installed distributions
pip_audit/_dependency_source/pip.py:91: PipSourceError
Platform information
- NetBSD 9.99.82
- pip-audit 1.1.0
- python 3.9.9
- pip 21.3.1
Other
One other test is failing, the one that’s trying to install ansible-core. But that’s just a reminder since you said you’d find a way to disable this one.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
[TypeError] distributions() got an unexpected keyword ...
If an exception occurs when executing a command, I executed it again in debug mode ( -vvv option). Poetry Version: 1.0.0 Python: 3.6.8 ......
Read more >custom() got an unexpected keyword argument 'path ...
Try to re-clone the repository and place your model in "/home/runs/train/yolov7x-custom/weights" path, or easily you can clone the repo ...
Read more >TypeError: __init__() got an unexpected keyword argument ...
Hi, I have followed the steps given in the chapter to set up mflix app. ... TypeError: init() got an unexpected keyword argument...
Read more >What's new in 1.1.0 (July 28, 2020)
The DataFrame.to_feather() method now supports additional keyword arguments (e.g. to set the compression) that are added in pyarrow 0.17 (GH33422).
Read more >TypeError: copy() got an unexpected keyword argument ' ...
currently we have 2 prediction model and we setup the prediction model in ... TypeError: copy() got an unexpected keyword argument 'deep'.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
But
pip-audit
works fine now!Yes, that fixes the test failure for me. Now I just have the one where it wants to install ansible-core. Thanks again!