-
Notifications
You must be signed in to change notification settings - Fork 10.6k
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
Add project metadata generation to Python #2746
Conversation
@@ -34,6 +34,7 @@ | |||
import sys | |||
|
|||
import setuptools | |||
import setuptools.command.build_py as build_py |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not "from setuptools.command import build_py"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I happen to enjoy turning my brain off, it seems.
This looks like it creates a _grpc_metadata.py module during grpcio package creation. What's the story during development? Will a _grpc_metadata.py file exist then, with some value available for use? |
|
def run(self): | ||
print os.getcwd() | ||
with open('grpc/_grpcio_metadata.py', 'w') as module_file: | ||
module_file.write('__version__ = """{}"""'.format( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why triple-double quotes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A vague notion of not wanting to ever parse quote escapes and laziness to look up something that implements quote escapes. In short: entirely arbitrary.
Still unsure about generating the file dynamically - both google-api-python-client and oauth2client have a static file checked in and import it from their setup.py - you indicated that you found something indicating that that was wrong? |
Importing isn't outright wrong (and there are workarounds similar to importing that effectively result in the same sort of static-file-with-project-metadata-deal), but I thought we'd agreed earlier that it was preferable to keep all the project metadata in one place? |
Looks like this needs conflict resolution. Rebase? |
97b3fca
to
a8c7767
Compare
pass | ||
|
||
def run(self): | ||
print os.getcwd() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover debugging print?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeeeep...
LGTM; waiting on test results. |
Jenkins green (for Python)! |
Add project metadata generation to Python.
cc #2520 (does not fix, but enables fix if acceptable)
n.b. alternatives include requiring
setuptools
to usepkg_resources
or putting the version data outsidesetup.py
.