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

Create stubs without a pyproject.toml #99

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tvanbaak
Copy link

@tvanbaak tvanbaak commented Nov 1, 2024

This change adds StubInfo::from_project_root, which allows passing in the default module name and project root explicitly instead of requiring them to be derived from the location and contents of a pyproject.toml file.

c78176a: Since StubInfo only needs a PyProject to determine python_path, the logic to compute python_path can be shifted earlier in the build process. This enables the second change.

2460bc0 adds the from_project_root method allowing usage without pyproject.toml.

Fixes #71

To support generating stubs without a pyproject.toml file, it needs to be possible to build a StubInfo without one. The StubInfo only uses it to find the python root, so that value can be determined earlier in the process and passed along instead of the PyProject.

StubInfoBuilder is not exported, so its ::new() can be renamed without causing backwards incompatibility.
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

Successfully merging this pull request may close these issues.

Create stubs without a pyproject.toml
1 participant