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

Add project metadata generation to Python #2746

Merged
merged 1 commit into from
Aug 6, 2015

Conversation

soltanmm
Copy link
Contributor

cc #2520 (does not fix, but enables fix if acceptable)

n.b. alternatives include requiring setuptools to use pkg_resources or putting the version data outside setup.py.

@@ -34,6 +34,7 @@
import sys

import setuptools
import setuptools.command.build_py as build_py

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"?

Copy link
Contributor Author

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.

@nathanielmanistaatgoogle
Copy link
Member

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?

@soltanmm
Copy link
Contributor Author

_grpc_metadata.py will not exist during development unless invoking setup.py in developer mode. I put this kind of derived-metadata in the same boat as e.g. _c.so/_c.pyd, so I don't think this is a problem.

def run(self):
print os.getcwd()
with open('grpc/_grpcio_metadata.py', 'w') as module_file:
module_file.write('__version__ = """{}"""'.format(

Choose a reason for hiding this comment

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

Why triple-double quotes?

Copy link
Contributor Author

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.

@nathanielmanistaatgoogle
Copy link
Member

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?

@soltanmm
Copy link
Contributor Author

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?

@nathanielmanistaatgoogle
Copy link
Member

Looks like this needs conflict resolution. Rebase?

@soltanmm soltanmm force-pushed the user-agent branch 2 times, most recently from 97b3fca to a8c7767 Compare August 4, 2015 23:24
pass

def run(self):
print os.getcwd()

Choose a reason for hiding this comment

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

Leftover debugging print?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeeeep...

@nathanielmanistaatgoogle
Copy link
Member

LGTM; waiting on test results.

@soltanmm
Copy link
Contributor Author

soltanmm commented Aug 5, 2015

Jenkins green (for Python)!

nathanielmanistaatgoogle added a commit that referenced this pull request Aug 6, 2015
Add project metadata generation to Python.
@nathanielmanistaatgoogle nathanielmanistaatgoogle merged commit 7098b1b into grpc:master Aug 6, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jan 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants