Conversation
This commit replaces almost all uses of print with the logging module, and more cleanly separates artman output from the output spit out by the processes that artman runs. Additionally, it adds a -v and -q flag to alter how much output you get. Adding -v shows all shell commands.
README.rst
Outdated
artman build --api pubsub --language python | ||
|
||
This assumes that you have checkouts of both `googleapis`_ and `toolkit`_ | ||
on your system (and that toolkit is able to run; e.g. you need Java). |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
# Ask the user for a repository root. | ||
while not answer.get('reporoot'): | ||
logger.info('First, we need to know where you store most code on your ' |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
def get_validate_kwargs(self): | ||
return ['gapic_api_yaml', 'final_repo_dir'] + code_gen.COMMON_REQUIRED | ||
return ['gapic_api_yaml', 'gapic_code_dir'] + code_gen.COMMON_REQUIRED |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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.
Awesome change! Consider converting current BlobUploadTask (https://github.com/googleapis/artman/blob/master/pipeline/tasks/io_tasks.py#L35) into another publish type in a follow-up PR. We can use application default credential for auth.
artman/pipelines/gapic_generation.py
Outdated
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""Pipelines that run GAPIC""" |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -0,0 +1,164 @@ | |||
# Copyright 2016 Google Inc. All Rights Reserved. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
repo_dest = '%s/%s' % (api_repo, git_repo.get('gapic_subpath', '.')) | ||
component = git_repo.get('gapic_component', '.') | ||
src_path = os.path.abspath(os.path.join(gapic_code_dir, component)) | ||
self.exec_command(['rm', '-rf', repo_dest]) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -0,0 +1,114 @@ | |||
# Copyright 2016 Google Inc. All Rights Reserved. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -0,0 +1,86 @@ | |||
# Copyright 2017 Google |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -0,0 +1,353 @@ | |||
# Copyright 2016 Google Inc. All Rights Reserved. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
test/cli/data/gapic/lang/common.yaml
Outdated
@@ -0,0 +1,30 @@ | |||
common: | |||
toolkit_path: ${REPOROOT}/toolkit | |||
staging_repo_dir: ${REPOROOT}/api-client-staging/generated |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I like that idea. Definitely should be a follow-up though. |
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.
From skimming the change, generally looks good to me. (No need to block on my full review if @michaelbausor and @ethanbao are both happy.)
grpc_code_dir (str): The current GRPC code location, if any. | ||
""" | ||
userhome = os.path.expanduser('~') | ||
gapic_loc = os.path.realpath(gapic_code_dir).replace(userhome, '~') |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This will allow that directory to be mounted in Docker.
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.
LGTM, one nit. We should update USAGE.rst as well
README.rst
Outdated
|
||
.. code:: | ||
|
||
artman build --api pubsub --language python |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
cd ~/hack-on-artman | ||
tox -e devenv | ||
sudo pip install virtualenv virtualenvwrapper | ||
mkvirtualenv --python=`which python3` artman |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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.
LGTM
repo_dest = '%s/%s' % (api_repo, git_repo.get('gapic_subpath', '.')) | ||
component = git_repo.get('gapic_component', '.') | ||
src_path = os.path.abspath(os.path.join(gapic_code_dir, component)) | ||
self.exec_command(['rm', '-rf', repo_dest]) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I should probably make |
This PR constitutes a significant refactor of Artman:
pip install googleapis-artman
artman
~/.artman/config.yaml
--api=pubsub
--googleapis=~/Code/Google/googleapis-private
--publish
)--publish=github
)GapicClientPipeline
; you can specify one with--pipeline
.Note that it is not rebased into a single commit due to merge conflicts. It will be squashed into a single commit on merge.