-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why is the test_convert_deps_to_pip
flaky, especially on Mac OS?
#5303
Comments
@dqkqd I was digging into this locally, and I discovered that one of the test cases you added I ran it locally in pycharm, and one of the test cases fail, specifically:
Seems maybe the test runner just isn't running it? When you run that locally what happens? This is not specifically the cause of the above issue, but the tests are co-located, so figured I would just tag you here. Also do you have any interest in joining the |
I suspect that test failure is expected based on: sarugaku/requirementslib#306 |
Actually though it did run and passed in the CI, I just wasn't searching the test output properly. I am confused on this one. |
I would love to join slack group. About the gw0 [7] / gw1 [7] / gw2 [7] / gw3 [7] / gw4 [7] / gw5 [7] / gw6 [7] / gw7 [7] / gw8 [7] / gw9 [7] / gw10 [7] / gw11 [7] / gw12 [7] / gw13 [7] / gw14 [7] / gw15 [7]
scheduling tests via LoadScheduling
tests/unit/test_utils.py::test_get_constraints_from_deps[deps2-expected2]
tests/unit/test_utils.py::test_get_constraints_from_deps[deps5-expected5]
tests/unit/test_utils.py::test_get_constraints_from_deps[deps3-expected3]
tests/unit/test_utils.py::test_get_constraints_from_deps[deps0-expected0]
tests/unit/test_utils.py::test_get_constraints_from_deps[deps6-expected6]
tests/unit/test_utils.py::test_get_constraints_from_deps[deps1-expected1]
tests/unit/test_utils.py::test_get_constraints_from_deps[deps4-expected4]
[gw0] [ 14%] PASSED tests/unit/test_utils.py::test_get_constraints_from_deps[deps0-expected0]
[gw2] [ 28%] PASSED tests/unit/test_utils.py::test_get_constraints_from_deps[deps2-expected2]
[gw3] [ 42%] PASSED tests/unit/test_utils.py::test_get_constraints_from_deps[deps3-expected3]
[gw5] [ 57%] PASSED tests/unit/test_utils.py::test_get_constraints_from_deps[deps5-expected5]
[gw4] [ 71%] PASSED tests/unit/test_utils.py::test_get_constraints_from_deps[deps4-expected4]
[gw6] [ 85%] PASSED tests/unit/test_utils.py::test_get_constraints_from_deps[deps6-expected6]
[gw1] [100%] PASSED tests/unit/test_utils.py::test_get_constraints_from_deps[deps1-expected1] UPDATE: [packages]
"e1839a8" = {path = ".", editable = true} DockerfileFROM archlinux
ENV LANG C.UTF-8
RUN pacman -Syu git python3 python-pip --noconfirm
RUN python -m pip install pipenv
COPY Pipfile .
RUN pipenv install resultStep 6/6 : RUN pipenv install
---> Running in 74f5d7f4f2fd
Creating a virtualenv for this project...
Pipfile: /Pipfile
Using /usr/sbin/python (3.10.6) to create virtualenv...
⠼ Creating virtual environment...created virtual environment CPython3.10.6.final.0-64 in 201ms
creator CPython3Posix(dest=/root/.local/share/virtualenvs/-x-v5uFv0, clear=False, no_vcs_ignore=False, global=False)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/root/.local/share/virtualenv)
added seed packages: pip==22.2.2, setuptools==63.4.1, wheel==0.37.1
activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
✔ Successfully created virtual environment!
Virtualenv location: /root/.local/share/virtualenvs/-x-v5uFv0
Pipfile.lock not found, creating...
Locking [packages] dependencies...
Building requirements...
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 102, in __init__
req = REQUIREMENT.parseString(requirement_string)
File "/usr/lib/python3.10/site-packages/pkg_resources/_vendor/pyparsing/core.py", line 1141, in parse_string
raise exc.with_traceback(None)
pkg_resources._vendor.pyparsing.exceptions.ParseException: Expected W:(0-9A-Za-z), found '.' (at char 0), (line:1, col:1)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.10/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 966, in _parse_name_from_line
self._requirement = init_requirement(self.line)
File "/usr/lib/python3.10/site-packages/pipenv/vendor/requirementslib/models/utils.py", line 194, in init_requirement
req = Requirement.parse(name)
File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3147, in parse
req, = parse_requirements(s)
File "/usr/lib/python3.10/site-packages/pkg_resources/__init__.py", line 3102, in __init__
super(Requirement, self).__init__(requirement_string)
File "/usr/lib/python3.10/site-packages/pkg_resources/_vendor/packaging/requirements.py", line 104, in __init__
raise InvalidRequirement(
pkg_resources.extern.packaging.requirements.InvalidRequirement: Parse error at "'.'": Expected W:(0-9A-Za-z)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/sbin/pipenv", line 8, in <module>
sys.exit(cli())
File "/usr/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3.10/site-packages/pipenv/cli/options.py", line 56, in main
return super().main(*args, **kwargs, windows_expand_args=False)
File "/usr/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/usr/lib/python3.10/site-packages/pipenv/vendor/click/decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/lib/python3.10/site-packages/pipenv/vendor/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/usr/lib/python3.10/site-packages/pipenv/cli/command.py", line 233, in install
do_install(
File "/usr/lib/python3.10/site-packages/pipenv/core.py", line 2064, in do_install
do_init(
File "/usr/lib/python3.10/site-packages/pipenv/core.py", line 1325, in do_init
do_lock(
File "/usr/lib/python3.10/site-packages/pipenv/core.py", line 1122, in do_lock
venv_resolve_deps(
File "/usr/lib/python3.10/site-packages/pipenv/utils/resolver.py", line 1026, in venv_resolve_deps
deps = convert_deps_to_pip(deps, project, r=False, include_index=True)
File "/usr/lib/python3.10/site-packages/pipenv/utils/dependencies.py", line 261, in convert_deps_to_pip
new_dep = Requirement.from_pipfile(dep_name, dep)
File "/usr/lib/python3.10/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 2746, in from_pipfile
r = FileRequirement.from_pipfile(name, pipfile)
File "/usr/lib/python3.10/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 1838, in from_pipfile
arg_dict["parsed_line"] = Line(line)
File "/usr/lib/python3.10/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 173, in __init__
self.parse()
File "/usr/lib/python3.10/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 1304, in parse
self.parse_name()
File "/usr/lib/python3.10/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 1027, in parse_name
name = self._parse_name_from_line()
File "/usr/lib/python3.10/site-packages/pipenv/vendor/requirementslib/models/requirements.py", line 968, in _parse_name_from_line
raise RequirementError(
pipenv.vendor.requirementslib.exceptions.RequirementError: Failed parsing requirement from '.' |
@dqkqd Try joining the slack group here: pythondev.slack.com |
I think the reason that test passes maybe is because it is generally being invoked from the pipenv root which has an installable thing at path ="." |
Ok the tests have been passing since I made this change to the tests: 46f8c86 What I discovered is that requirementslib will inspect into a directory named requests to find the setup.py version info and the test that I skipped is likely the biggest culprit of this because it copies in the requests tarball and extracts it. We would like to get that test back to not-skipped, but it needs to cleanup after itself. We should also look into if this is a bug in requirementslib that it can get confused like this. |
I am considering we should skip this test so we don't appear to have broken CI builds 90% of the time, and use this ticket to document the fact we still need to understand why this test sometimes fails on Mac OS CI.
Issue description
Example: https://github.com/pypa/pipenv/runs/8057466423?check_suite_focus=true
FAILED tests/unit/test_utils.py::test_convert_deps_to_pip[deps0-requests] - A...
FAILED tests/unit/test_utils.py::test_convert_deps_to_pip[deps1-requests[socks]]
Expected result
The test used to pass consistently.
The text was updated successfully, but these errors were encountered: