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

Update generated validation code using validate_pyproject==0.12.1 #3798

Merged
merged 5 commits into from
Feb 1, 2023

Conversation

abravalheri
Copy link
Contributor

@abravalheri abravalheri commented Jan 25, 2023

Summary of changes

  • Bump validate_pyproject==0.12.1 in tox.ini
  • Update generated validation code

Closes #3796

Pull Request Checklist

@abravalheri abravalheri marked this pull request as ready for review January 25, 2023 21:41
@b-kamphorst
Copy link

b-kamphorst commented Jan 26, 2023

Hi @abravalheri! This PR allows stub names in packages. Just checking: does it also allow stub names in the keys of package-dir (and possibly other attributes where this is sensible)?

@abravalheri
Copy link
Contributor Author

abravalheri commented Jan 26, 2023

Do you want to map your package directory to a different folder?

That would require further changes.

Do you know if basic setup.py handles package_dir with stub names?

@b-kamphorst
Copy link

Do you want to map your package directory to a different folder?

That would require further changes.

Do you know if basic setup.py handles package_dir with stub names?

Yes, we currently have a setup.cfg that has this section:

name = namespace.mod.stubs

[options]
packages =
    otherpkg-stubs
    namespace.mod.stubs
package_dir =
    otherpkg-stubs = namespace/mod/stubs

I'm not saying this is the best approach. If we install our package, it will install the package content twice -- once as the stubs of another package, and once as a standalone package in our namespace. Our package is not stub-only -- it provides stubs of another package but also two function wrappers that are needed to perform better type annotation with the other package. These wrappers should be imported by clients and therefore we provide a non-stubs import that allows that.

@abravalheri
Copy link
Contributor Author

I'm not saying this is the best approach.

No problems. Thank you very much for the example, it should be enough to create a test for it.

Sorry, I did not understand that part at first!

@abravalheri abravalheri changed the title Update generated validation code using validate_pyproject==0.12 Update generated validation code using validate_pyproject==0.12.1 Jan 27, 2023
@b-kamphorst
Copy link

Sorry, I did not understand that part at first!

No problem at all!

Again I am pleasantly surprised by your quick response. Moreover, I can confirm that this PR solves my issue. Looking forward to the release and thank you so much!

@abravalheri
Copy link
Contributor Author

Probably next week. I try to avoid releases on Friday 😝

@b-kamphorst
Copy link

Probably next week. I try to avoid releases on Friday 😝

That is quite sensible 😅

@abravalheri abravalheri merged commit 455704c into pypa:main Feb 1, 2023
@abravalheri abravalheri deleted the update-validate-pyproject branch February 1, 2023 13:28
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.

[BUG] Cannot define stub-only packages
2 participants