GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - smusa/python-docs-samples: Code samples used on cloud.google.com

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

166 Commits
166 Commits

Folders and files

NameName
Last commit message
Last commit date
appengine
appengine
 
 
bigquery
bigquery
 
 
blog
blog
 
 
datastore
datastore
 
 
discoverydoccaching
discoverydoccaching
 
 
lib
lib
 
 
localtesting
localtesting
 
 
monitoring
monitoring
 
 
storage
storage
 
 
tests
tests
 
 
.coveragerc
.coveragerc
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
app.yaml
app.yaml
 
 
favicon.ico
favicon.ico
 
 
python-docs-samples.json.enc
python-docs-samples.json.enc
 
 
queue.yaml
queue.yaml
 
 
tox.ini
tox.ini
 
 

Repository files navigation

Google Cloud Platform Python Samples

This repository holds the samples used in the python documentation on cloud.google.com.

Build Status Coverage Status

For more detailed introduction to a product, check the README in the corresponding folder.

Contributing changes

  • See CONTRIBUTING.md

Testing

Local setup

Before you can run tests locally you must have:

  • The latest tox and pip installed.

      $ sudo pip install --upgrade tox pip
    
  • The Google Cloud SDK installed. You can do so with the following command:

      $ curl https://sdk.cloud.google.com | bash
    
  • Most tests require you to have an active, billing-enabled project on the Google Developers Console.

  • You will need a set of Service Account Credentials for your project in json form.

  • Set the environment variables appropriately for your project.

      $ export GOOGLE_APPLICATION_CREDENTIALS=your-service-account-json-file
      $ export TEST_PROJECT_ID=your-project-id
      $ export TEST_BUCKET_NAME=your-bucket-name
    

If you want to run the Google App Engine tests, you will need:

  • The App Engine Python SDK. You can install this with the Google Cloud SDK:

      $ gcloud components update gae-python
    
  • You will need to set an additional environment variable:

      $ export GAE_PYTHONPATH=~/google-cloud-sdk/platform/google_appengine
    

Test environments

We use tox to configure multiple python environments:

  • py27 contains tests for samples that run in a normal Python 2.7 environment. This is (mostly) everything outside of the appengine directory.
  • gae contains tests for samples that run only in Google App Engine. This is (mostly) everything in the appengine directory.
  • pep8 just runs the linter.

To run tests for a particular environment, invoke tox with the -e flag:

tox -e py27

To run one particular test suite or provide additional parameters to nose, invoke tox like this:

toxe -e py27 -- storage/tests/test_list_objects.py

Note: The gae environment can't be told to run one particular test at this time.

Adding new tests

There are a handful of common testing utilities are located under tests, see existing tests for example usage.

When adding a new top-level directory, be sure to edit .coveragerc to include it in coveralls.

To add new tests that require Google App Engine, please place them in the appengine directory if possible. If you place them elsewhere, you will need to modify tox.ini to make the environments appropriately run or ignore your test.

Licensing

  • See LICENSE

About

Code samples used on cloud.google.com

Resources

Readme
Apache-2.0 license

Contributing

Contributing
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.