issue due to setuptools
See original GitHub issueJust want to make it documented in case somebody faces the same issue due to the bug in virtualenv
reorder-python-imports
fails with
Traceback (most recent call last):
File "/home/runner/.cache/pre-commit/repoizu8jol0/py_env-python3.10/bin/reorder-python-imports", line 8, in <module>
sys.exit(main())
File "/home/runner/.cache/pre-commit/repoizu8jol0/py_env-python3.10/lib/python3.10/site-packages/reorder_python_imports.py", line 907, in main
retv |= _fix_file(filename, args)
File "/home/runner/.cache/pre-commit/repoizu8jol0/py_env-python3.10/lib/python3.10/site-packages/reorder_python_imports.py", line 475, in _fix_file
new_contents = fix_file_contents(
File "/home/runner/.cache/pre-commit/repoizu8jol0/py_env-python3.10/lib/python3.10/site-packages/reorder_python_imports.py", line 456, in fix_file_contents
partitioned = step(partitioned)
File "/home/runner/.cache/pre-commit/repoizu8jol0/py_env-python3.10/lib/python3.10/site-packages/reorder_python_imports.py", line 366, in apply_import_sorting
sorted_blocks = sort(import_obj_to_partition.keys(), **sort_kwargs)
File "/home/runner/.cache/pre-commit/repoizu8jol0/py_env-python3.10/lib/python3.10/site-packages/aspy/refactor_imports/sort.py", line 96, in sort
imports_partitioned[classify_func(import_obj)].append(import_obj)
File "/home/runner/.cache/pre-commit/repoizu8jol0/py_env-python3.10/lib/python3.10/site-packages/aspy/refactor_imports/sort.py", line 73, in classify_func
return classify_import(obj.import_statement.module, **kwargs)
File "/home/runner/.cache/pre-commit/repoizu8jol0/py_env-python3.10/lib/python3.10/site-packages/aspy/refactor_imports/classify.py", line 138, in classify_import
found, module_path, is_builtin = _get_module_info(
File "/home/runner/.cache/pre-commit/repoizu8jol0/py_env-python3.10/lib/python3.10/site-packages/aspy/refactor_imports/classify.py", line 103, in _get_module_info
assert spec.submodule_search_locations is not None
AssertionError
solution will be to update CI to force downgrade virtualenv:
name: pre-commit
on:
push:
branches:
- master
pull_request:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
# Install venv to avoid issues https://github.com/pre-commit/action/issues/135
- name: Install virtualenv
run: |
python -m pip install -U virtualenv==20.10.0
- uses: pre-commit/action@v2.0.3
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Issues · pypa/setuptools - GitHub
Official project repository for the Setuptools build system - Issues · pypa/setuptools. ... Test suite failing due to deprecated --rsyncdir.
Read more >sudo pip install setuptools --upgrade error - Stack Overflow
So far, so good :) My problem comes when I try to run: pip install --upgrade setuptools. The installation appears to work OK,...
Read more >History - setuptools 65.6.3.post20221220 documentation
#2953: Fixed a bug that easy install incorrectly parsed Python 3.10 version string. #3006: Fixed startup performance issue of Python interpreter due to...
Read more >2020635 – pip install fails if the setuptools weak dep is not ...
Description of problem: pip install fails if setuptools is not installed on the system. It is a weak dependency, but those are meant...
Read more >setuptools 6.1 - PyPI
To install setuptools on Python 2.4 or Python 2.5, use the bootstrap ... Issue #262: Fixed regression in pip install due to egg-info...
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
there’s a bunch of choices:
entry
to set the variable:entry: env SETUPTOOLS_USE_DISTUTILS=stdlib reorder-python-imports
additional_dependencies: [setuptools<60]
I confirm that this also solves the issue