Skip to content

Update generated validation code using validate_pyproject==0.12.1#3798

Merged
abravalheri merged 5 commits into
pypa:mainfrom
abravalheri:update-validate-pyproject
Feb 1, 2023
Merged

Update generated validation code using validate_pyproject==0.12.1#3798
abravalheri merged 5 commits into
pypa:mainfrom
abravalheri:update-validate-pyproject

Conversation

@abravalheri

@abravalheri abravalheri commented Jan 25, 2023

Copy link
Copy Markdown
Contributor

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

b-kamphorst commented Jan 26, 2023

Copy link
Copy Markdown

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

abravalheri commented Jan 26, 2023

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown

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
Copy Markdown
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
@abravalheri abravalheri force-pushed the update-validate-pyproject branch from 21479b0 to 21d138e Compare January 27, 2023 11:31
@b-kamphorst

Copy link
Copy Markdown

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
Copy Markdown
Contributor Author

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

@b-kamphorst

Copy link
Copy Markdown

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