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

[feature] Provide stubs for Python API #17454

Open
1 task done
marlamb opened this issue Dec 12, 2024 · 2 comments
Open
1 task done

[feature] Provide stubs for Python API #17454

marlamb opened this issue Dec 12, 2024 · 2 comments

Comments

@marlamb
Copy link
Contributor

marlamb commented Dec 12, 2024

What is your suggestion?

Hi, I started using the API provided by Conan2 and enjoy it a lot. However, I am missing stubs, which would bring multiple benefits

  • Simpler coding using auto-completion offered by IDEs.
  • Enables static checks, e.g. via mypy or pyright, such that users can also easily detect changes in new versions, even if not covered by tests.

I think at least the first point would also apply to all kind of functionality used in conanfiles, but for the API I would consider them even more beneficial, as one can safely assume that a growing number of users will have custom code relying on the API and is not that formally restricted than conanfiles are.

Note that already others tried to provide some stubs for conanfiles, but according to their documentation it is for version 1.59 only. Even if there would be more activity, providing them from directly within the package would be great, as it would not suffer from any outdate-ness problem.

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@memsharded
Copy link
Member

Hi @marlamb

Thanks for your suggestion.

I think this is still a bit too far away, there are many other steps that need to be done first:

  • Stabilization and further public documentation of subapis
  • Proper modeling and interface for model objects like Remote, Graph, etc
  • Better (or some) type annotations in the interfaces

Note that most of the API is still undocumented, and this is because we didn't have enough time, it is just a matter of priorities. And while this would be a convenient thing, it is just a "nice to have" compared with many other aspects or features that are very necessary from the functional point of view, like workspaces.

So I am afraid that this will not be happening any time soon, sorry! (we will try to improve over the above points in the short and mid term future)

@marlamb
Copy link
Contributor Author

marlamb commented Dec 12, 2024

Very much appreciated. I fully understand that it is not the highest priority as of now, nevertheless looking forward to it at some point in time 👍 .

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

No branches or pull requests

2 participants