Skip to content
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

package_with_function_call_as_name failure on openSUSE builds #280

Open
jayvdb opened this issue Nov 13, 2020 · 1 comment
Open

package_with_function_call_as_name failure on openSUSE builds #280

jayvdb opened this issue Nov 13, 2020 · 1 comment

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Nov 13, 2020

I'm not sure why this one is failing. When I test locally, the .name is correct. Injected a print to show what is going on inside.

I checked most of the dependencies and they are up to date.

[   68s] _______________________ test_parse_function_call_as_name _______________________
[   68s] 
[   68s] setup_py_dir = PosixPath('/home/abuild/rpmbuild/BUILD/requirementslib-1.5.16/tests/fixtures/setup_py')
[   68s] pathlib_tmpdir = PosixPath('/tmp/pytest-of-abuild/pytest-0/test_parse_function_call_as_na0')
[   68s] 
[   68s]     def test_parse_function_call_as_name(setup_py_dir, pathlib_tmpdir):
[   68s]         package_dir = pathlib_tmpdir.joinpath("package_with_function_call_as_name").as_posix()
[   68s]         setup_dir = setup_py_dir.joinpath("package_with_function_call_as_name").as_posix()
[   68s]         shutil.copytree(setup_dir, package_dir)
[   68s]         req = Requirement.from_line("-e {}".format(package_dir))
[   68s] >       print(repr(req)); assert req.name == "package-with-function-call-as-name"
[   68s] E       AssertionError: assert None == 'package-with-function-call-as-name'
[   68s] E         +None
[   68s] E         -'package-with-function-call-as-name'
[   68s] 
[   68s] tests/unit/test_setup_info.py:259: AssertionError
[   68s] ----------------------------- Captured stdout call -----------------------------
[   68s] Requirement(_name=None, vcs=None, req=FileRequirement(setup_path='/tmp/pytest-of-abuild/pytest-0/test_parse_function_call_as_na0/package_with_function_call_as_name/setup.py', path='/tmp/pytest-of-abuild/pytest-0/test_parse_function_call_as_na0/package_with_function_call_as_name', editable=True, extras=(), _uri_scheme='path', uri='file:///tmp/pytest-of-abuild/pytest-0/test_parse_function_call_as_na0/package_with_function_call_as_name', link=<Link file:///tmp/pytest-of-abuild/pytest-0/test_parse_function_call_as_na0/package_with_function_call_as_name>, pyproject_requires=None, pyproject_backend=None, pyproject_path=None, subdirectory=None, _setup_info=SetupInfo(name=None, base_dir='/tmp/pytest-of-abuild/pytest-0/test_parse_function_call_as_na0/package_with_function_call_as_name', _version='1.0.0', _requirements=frozenset(), build_requires=(), build_backend='setuptools.build_meta:__legacy__', setup_requires=(), python_requires=None, _extras_requirements=(), setup_cfg=PosixPath('/tmp/pytest-of-abuild/pytest-0/test_parse_function_call_as_na0/package_with_function_call_as_name/setup.cfg'), setup_py=PosixPath('/tmp/pytest-of-abuild/pytest-0/test_parse_function_call_as_na0/package_with_function_call_as_name/setup.py'), pyproject=PosixPath('/tmp/pytest-of-abuild/pytest-0/test_parse_function_call_as_na0/package_with_function_call_as_name/pyproject.toml'), ireq=<InstallRequirement object: file:///tmp/pytest-of-abuild/pytest-0/test_parse_function_call_as_na0/package_with_function_call_as_name editable=True>, extra_kwargs={'build_dir': '/tmp/reqlib-buildtql_b8xe', 'src_dir': '/tmp/reqlib-srcz7zhgk2o', 'download_dir': '/home/abuild/.cache/pipenv/pkgs', 'wheel_download_dir': '/home/abuild/.cache/pipenv/wheels'}, metadata=None, stack=<contextlib.ExitStack object at 0xb5e1e430>, _finalizer=<finalize object at 0xb557dc40; for 'SetupInfo' at 0xb5835130>), _has_hashed_name=False, _parsed_line=<Line (editable=True, name=None, path=/tmp/pytest-of-abuild/pytest-0/test_parse_function_call_as_na0/package_with_function_call_as_name, uri=file:///tmp/pytest-of-abuild/pytest-0/test_parse_function_call_as_na0/package_with_function_call_as_name, extras=(), markers=None, vcs=None, specifier===1.0.0, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=file:///tmp/pytest-of-abuild/pytest-0/test_parse_function_call_as_na0/package_with_function_call_as_name)>, name=None, req=None), markers=None, _specifiers='', index=None, editable=True, hashes=frozenset(), extras=(), abstract_dep=None, _line_instance=<Line (editable=True, name=None, path=/tmp/pytest-of-abuild/pytest-0/test_parse_function_call_as_na0/package_with_function_call_as_name, uri=file:///tmp/pytest-of-abuild/pytest-0/test_parse_function_call_as_na0/package_with_function_call_as_name, extras=(), markers=None, vcs=None, specifier===1.0.0, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=file:///tmp/pytest-of-abuild/pytest-0/test_parse_function_call_as_na0/package_with_function_call_as_name)>, _ireq=None)
@bnavigator
Copy link

Still an issue with 1.6.1

setup_py_dir = PosixPath('/home/abuild/rpmbuild/BUILD/requirementslib-1.6.1/tests/fixtures/setup_py')
pathlib_tmpdir = PosixPath('/tmp/pytest-of-abuild/pytest-11/test_parse_function_call_as_na0')

    def test_parse_function_call_as_name(setup_py_dir, pathlib_tmpdir):
        package_dir = pathlib_tmpdir.joinpath("package_with_function_call_as_name").as_posix()
        setup_dir = setup_py_dir.joinpath("package_with_function_call_as_name").as_posix()
        shutil.copytree(setup_dir, package_dir)
        req = Requirement.from_line("-e {}".format(package_dir))
>       assert req.name == "package-with-function-call-as-name"
E       AssertionError: assert None == 'package-with...-call-as-name'
E         +None
E         -'package-with-function-call-as-name'

tests/unit/test_setup_info.py:225: AssertionError
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> entering PDB >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> PDB post_mortem (IO-capturing turned off) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> /home/abuild/rpmbuild/BUILD/requirementslib-1.6.1/tests/unit/test_setup_info.py(225)test_parse_function_call_as_name()
-> assert req.name == "package-with-function-call-as-name"
(Pdb) p package_dir
'/tmp/pytest-of-abuild/pytest-11/test_parse_function_call_as_na0/package_with_function_call_as_name'
(Pdb) p req
Requirement(_name=None, vcs=None, req=FileRequirement(setup_path='/tmp/pytest-of-abuild/pytest-11/test_parse_function_call_as_na0/package_with_function_call_as_name/setup.py', path='/tmp/pytest-of-abuild/pytest-11/test_parse_function_call_as_na0/package_with_function_call_as_name', editable=True, extras=(), _uri_scheme='path', uri='file:///tmp/pytest-of-abuild/pytest-11/test_parse_function_call_as_na0/package_with_function_call_as_name', link=<Link file:///tmp/pytest-of-abuild/pytest-11/test_parse_function_call_as_na0/package_with_function_call_as_name>, pyproject_requires=None, pyproject_backend=None, pyproject_path=None, subdirectory=None, _setup_info=SetupInfo(name=None, base_dir='/tmp/pytest-of-abuild/pytest-11/test_parse_function_call_as_na0/package_with_function_call_as_name', _version=None, _requirements=frozenset(), build_requires=None, build_backend='setuptools.build_meta:__legacy__', setup_requires=None, python_requires=None, _extras_requirements=None, setup_cfg=PosixPath('/tmp/pytest-of-abuild/pytest-11/test_parse_function_call_as_na0/package_with_function_call_as_name/setup.cfg'), setup_py=PosixPath('/tmp/pytest-of-abuild/pytest-11/test_parse_function_call_as_na0/package_with_function_call_as_name/setup.py'), pyproject=PosixPath('/tmp/pytest-of-abuild/pytest-11/test_parse_function_call_as_na0/package_with_function_call_as_name/pyproject.toml'), ireq=<InstallRequirement object: file:///tmp/pytest-of-abuild/pytest-11/test_parse_function_call_as_na0/package_with_function_call_as_name editable=True>, extra_kwargs={'build_dir': '/tmp/reqlib-build1w6zwq9s', 'src_dir': '/tmp/reqlib-srca_8bo4ui', 'download_dir': '/home/abuild/.cache/pipenv/pkgs', 'wheel_download_dir': '/home/abuild/.cache/pipenv/wheels'}, metadata=None, stack=<contextlib.ExitStack object at 0x7fc21da7cdd8>, _finalizer=<finalize object at 0x7fc21deaa3d0; for 'SetupInfo' at 0x7fc21da38498>), _has_hashed_name=False, _parsed_line=<Line (editable=True, name=None, path=/tmp/pytest-of-abuild/pytest-11/test_parse_function_call_as_na0/package_with_function_call_as_name, uri=file:///tmp/pytest-of-abuild/pytest-11/test_parse_function_call_as_na0/package_with_function_call_as_name, extras=(), markers=None, vcs=None, specifier=None, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=file:///tmp/pytest-of-abuild/pytest-11/test_parse_function_call_as_na0/package_with_function_call_as_name)>, name=None, req=None), markers=None, _specifiers='', index=None, editable=True, hashes=frozenset(), extras=(), abstract_dep=None, _line_instance=<Line (editable=True, name=None, path=/tmp/pytest-of-abuild/pytest-11/test_parse_function_call_as_na0/package_with_function_call_as_name, uri=file:///tmp/pytest-of-abuild/pytest-11/test_parse_function_call_as_na0/package_with_function_call_as_name, extras=(), markers=None, vcs=None, specifier=None, pyproject=None, pyproject_requires=None, pyproject_backend=None, ireq=file:///tmp/pytest-of-abuild/pytest-11/test_parse_function_call_as_na0/package_with_function_call_as_name)>, _ireq=None)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants