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

conan-check-update fails if additional arguments are passed to self.requires(...) #3

Closed
h4haase opened this issue Jul 9, 2024 · 4 comments · Fixed by #4
Closed
Labels
bug Something isn't working

Comments

@h4haase
Copy link

h4haase commented Jul 9, 2024

In one of my conan files I have a private requirement, i.e.

def requirements(self):
    self.requires("my_package/1.3.15@myuser/stable", "private")

conan-check-update fails with

Traceback (most recent call last):
File "/home/myuser/.local/bin/conan-check-updates", line 8, in <module>
sys.exit(main())
File "/home/myuser/.local/lib/python3.10/site-packages/conan_check_updates/cli.py", line 186, in wrapper
loop.run_until_complete(func(*args, **kwargs))
File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/home/myuser/.local/lib/python3.10/site-packages/conan_check_updates/cli.py", line 204, in main
results = await check_updates(
File "/home/myuser/.local/lib/python3.10/site-packages/conan_check_updates/main.py", line 69, in check_updates
refs = inspect_requires_conanfile(conanfile)
File "/home/myuser/.local/lib/python3.10/site-packages/conan_check_updates/conan.py", line 262, in inspect_requires_conanfile
return inspect_requires_conanfile_py(conanfile) + inspect_requirements_conanfile_py(
File "/home/myuser/.local/lib/python3.10/site-packages/conan_check_updates/conan.py", line 193, in inspect_requirements_conanfile_py
return list(map(ConanReference.parse, refs))
File "/home/myuser/.local/lib/python3.10/site-packages/conan_check_updates/conan.py", line 141, in parse
raise ValueError(f"Invalid Conan reference '{reference}'")
ValueError: Invalid Conan reference 'my_package/1.3.15@myuser/stable", "private'
@lukasberbuer
Copy link
Owner

Thanks for pointing this out @h4haase. Show be fixed with #4. Can you verify this?

@lukasberbuer lukasberbuer added the bug Something isn't working label Jul 12, 2024
@h4haase
Copy link
Author

h4haase commented Jul 19, 2024

Yes this works, thank you. However, the conan file contains another reference to "yaml-cpp/0.7.0@" which seems to be valid and work fine with conan, but conan-check-update shows an error very similar to the original one:

raise ValueError(f"Invalid Conan reference '{reference}'")
ValueError: Invalid Conan reference 'yaml-cpp/0.7.0@'

Removing the "@" does not show the error.

@lukasberbuer
Copy link
Owner

I see. Conan isn't too clear about how the schema of a reference should look like: https://docs.conan.io/2/reference/conanfile/attributes.html#package-reference

I guess, I seems that we are more strict than Conan here...
What is the reason to just append a @ without providing a user?

@h4haase
Copy link
Author

h4haase commented Jul 22, 2024

There is no particular reason, it probably was just cut‘n pasted from somewhere. The package does not have a user and channel. When searching with Conan v1 (i.e. conan search …) the @ makes a difference. Without the @ it will search for packages with corresponding name/version, with the @ it will list the properties of this particular package. AFAIR, also installing by hand , i.e. conan install yaml-cpp/0.7.0@ requires the @ to be there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants