Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion appengine/flexible/django_cloudsql/mysite/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@
# In the flexible environment, you connect to CloudSQL using a unix socket.
# Locally, you can use the CloudSQL proxy to proxy a localhost connection
# to the instance
DATABASES['default']['HOST'] = '/cloudsql/<your-cloudsql-connection-string>'
DATABASES['default']['HOST'] = '/cloudsql/<your-cloudsql-connection-string>'
if os.getenv('GAE_APPENGINE_HOSTNAME'):
pass
else:
DATABASES['default']['HOST'] = '127.0.0.1'
# [END dbconfig]
Expand Down
2 changes: 1 addition & 1 deletion appengine/flexible/django_cloudsql/mysite/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from django.conf import settings
from django.conf.urls import include, url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.conf import settings

urlpatterns = [url(r'^', include('polls.urls')),
url(r'^admin/', admin.site.urls)]
Expand Down
4 changes: 2 additions & 2 deletions appengine/standard/angular/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

import json

import model

import webapp2

import model


def AsDict(guest):
return {'id': guest.key.id(), 'first': guest.first, 'last': guest.last}
Expand Down
4 changes: 2 additions & 2 deletions appengine/standard/i18n/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
For more information, see README.md
"""

from i18n_utils import BaseHandler

import webapp2

from i18n_utils import BaseHandler


class MainHandler(BaseHandler):
"""A simple handler with internationalized strings.
Expand Down
15 changes: 11 additions & 4 deletions container_engine/django_tutorial/polls/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,29 @@ class Migration(migrations.Migration):
migrations.CreateModel(
name='Choice',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('id', models.AutoField(
auto_created=True, primary_key=True, serialize=False,
verbose_name='ID')),
('choice_text', models.CharField(max_length=200)),
('votes', models.IntegerField(default=0)),
],
),
migrations.CreateModel(
name='Question',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('id', models.AutoField(
auto_created=True, primary_key=True, serialize=False,
verbose_name='ID')),
('question_text', models.CharField(max_length=200)),
('pub_date', models.DateTimeField(verbose_name=b'date published')),
('pub_date', models.DateTimeField(
verbose_name=b'date published')),
],
),
migrations.AddField(
model_name='choice',
name='question',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polls.Question'),
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to='polls.Question'),
),
]
15 changes: 10 additions & 5 deletions nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ def list_files(folder, pattern):
yield os.path.join(root, filename)


def collect_sample_dirs(start_dir, blacklist=set()):
def collect_sample_dirs(start_dir, blacklist=set(), suffix='_test.py'):
"""Recursively collects a list of dirs that contain tests.

This works by listing the contents of directories and finding
directories that have `*_test.py` files.
"""
# Collect all the directories that have tests in them.
for parent, subdirs, files in os.walk(start_dir):
if any(f for f in files if f[-8:] == '_test.py'):
if any(f for f in files if f.endswith(suffix) and f not in blacklist):
# Don't recurse further, since py.test will do that.
del subdirs[:]
# This dir has tests in it. yield it.
Expand Down Expand Up @@ -240,9 +240,14 @@ def session_lint(session):
"""Lints each sample."""
sample_directories = session.posargs
if not sample_directories:
sample_directories = collect_sample_dirs('.')

# On travis, on lint changed samples.
# The top-level dir isn't a sample dir - only its subdirs.
_, subdirs, _ = next(os.walk('.'))
sample_directories = (
sample_dir for subdir in subdirs if not subdir.startswith('.')
for sample_dir in collect_sample_dirs(
subdir, suffix='.py', blacklist='conftest.py'))

# On travis, only lint changed samples.
if ON_TRAVIS:
changed_files = get_changed_files()
sample_directories = filter_samples(
Expand Down