-
Notifications
You must be signed in to change notification settings - Fork 28
Backports not properly ignored #46
Description
Describe the bug
Even if I add --backport argparse to vermin, it still reports a minimum version requirement of Python 2.7.
To Reproduce
$ cat > foo.py
import argparse
$ vermin --backport argparse -vvvv foo.py
Detecting python files..
Analyzing using 4 processes..
2.7, 3.2 /Users/Adam/Downloads/foo.py
L1 C7: 'argparse' requires 2.7, 3.2
Minimum required versions: 2.7, 3.2Expected behavior
Any version of Python should work for this file.
Environment
- Vermin 0.10.4
- macOS 10.15.7
- Python 3.8.5
Additional information
If you have any trouble reproducing this, I suspect that this is a macOS + Python 3.8 bug. See https://docs.python.org/3.8/library/multiprocessing.html#contexts-and-start-methods:
Changed in version 3.8: On macOS, the spawn start method is now the default. The fork start method should be considered unsafe as it can lead to crashes of the subprocess. See bpo-33725.
One workaround would be to force it to always use the fork start method by replacing multiprocessing with multiprocessing.get_context('fork') everywhere it's used. We recently had to do this for Spack: spack/spack#18124
A more permanent workaround would be to ensure that both spawn and fork work as expected.