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

feat(python): support src/packagename/__init__.py #1062

Merged
merged 5 commits into from Sep 24, 2021
Merged

feat(python): support src/packagename/__init__.py #1062

merged 5 commits into from Sep 24, 2021

Conversation

scop
Copy link
Contributor

@scop scop commented Sep 20, 2021

For the popular src directory layout,
https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Refs #1026

Basically just monkeying what was done with earlier related python changes recently and git grepping what might need updating without really understanding it all, could very well be that I've missed something.

@scop scop requested a review from a team September 20, 2021 20:11
@scop scop requested a review from a team as a code owner September 20, 2021 20:11
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Sep 20, 2021
@@ -115,6 +115,14 @@ export class Python extends ReleasePR {
packageName: packageName.name,
})
);
updates.push(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind adding a // TODO: figure out refactor that makes logic for updating __init__.py, etc., configurable

I'm a little worried about the number of optional paths we've added at this point.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

FWIW after this one's in, pretty much the last one re filenames I'm aware some projects could appreciate would be updating __version__.py files anywhere in the tree. That could be handled just like version.py currently is.

But at that point I think all the "standard" ways to refer to the version would be addressed and a reasonable alternative to configurability might be to nudge projects to use a more common filename to place their __version__ in.

Then again while the __version__ symbol is probably the most prominent, some projects use just version or VERSION...

@chingor13 chingor13 merged commit 598667d into googleapis:main Sep 24, 2021
@scop scop deleted the feat-src-init-py branch September 25, 2021 19:13
scop added a commit to scop/pytekukko that referenced this pull request Oct 4, 2021
release-please(-action) supports that now.

Refs googleapis/release-please#1062
scop added a commit to scop/hashpipe that referenced this pull request Nov 6, 2021
This reverts commit 08457a1.

release-please(-action) supports __version__ in __init__.py now.

Refs googleapis/release-please#1062
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants