Skip to content

Commit 7ef161c

Browse files
Apply Black string normalization
Black unifies strings to "".
1 parent 9a6d7d7 commit 7ef161c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+915
-915
lines changed

docs/conf.py

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -14,64 +14,64 @@
1414
# If extensions (or modules to document with autodoc) are in another directory,
1515
# add these directories to sys.path here. If the directory is relative to the
1616
# documentation root, use os.path.abspath to make it absolute, like shown here.
17-
sys.path.insert(0, os.path.dirname(os.path.abspath('.')))
17+
sys.path.insert(0, os.path.dirname(os.path.abspath(".")))
1818

1919

2020
# -- Project information -----------------------------------------------------
2121

22-
project = 'Factory Boy'
23-
copyright = '2011-2015, Raphaël Barrois, Mark Sandstrom'
24-
author = 'adfasf'
22+
project = "Factory Boy"
23+
copyright = "2011-2015, Raphaël Barrois, Mark Sandstrom"
24+
author = "adfasf"
2525

2626
# The full version, including alpha/beta/rc tags
2727
release = factory.__version__
2828
# The short X.Y version.
29-
version = '.'.join(release.split('.')[:2])
29+
version = ".".join(release.split(".")[:2])
3030

3131
# -- General configuration ---------------------------------------------------
3232

3333
# Add any Sphinx extension module names here, as strings. They can be
3434
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3535
# ones.
3636
extensions = [
37-
'sphinx.ext.autodoc',
38-
'sphinx.ext.extlinks',
39-
'sphinx.ext.intersphinx',
40-
'sphinx.ext.viewcode',
37+
"sphinx.ext.autodoc",
38+
"sphinx.ext.extlinks",
39+
"sphinx.ext.intersphinx",
40+
"sphinx.ext.viewcode",
4141
]
4242

4343
extlinks = {
44-
'issue': ('https://github.com/FactoryBoy/factory_boy/issues/%s', 'issue #'),
45-
'pr': ('https://github.com/FactoryBoy/factory_boy/pull/%s', 'pull request #'),
44+
"issue": ("https://github.com/FactoryBoy/factory_boy/issues/%s", "issue #"),
45+
"pr": ("https://github.com/FactoryBoy/factory_boy/pull/%s", "pull request #"),
4646
}
4747

4848
# Add any paths that contain templates here, relative to this directory.
49-
templates_path = ['_templates']
49+
templates_path = ["_templates"]
5050

5151
# The master toctree document.
52-
master_doc = 'index'
52+
master_doc = "index"
5353

5454
# List of patterns, relative to source directory, that match files and
5555
# directories to ignore when looking for source files.
56-
exclude_patterns = ['_build']
56+
exclude_patterns = ["_build"]
5757

5858

5959
# -- Options for HTML output -------------------------------------------------
6060

6161
# The theme to use for HTML and HTML Help pages. See the documentation for
6262
# a list of builtin themes.
63-
html_theme = 'sphinx_rtd_theme'
63+
html_theme = "sphinx_rtd_theme"
6464

65-
if 'READTHEDOCS_VERSION' in os.environ:
65+
if "READTHEDOCS_VERSION" in os.environ:
6666
# Use the readthedocs version string in preference to our known version.
6767
html_title = "{} {} documentation".format(
68-
project, os.environ['READTHEDOCS_VERSION']
68+
project, os.environ["READTHEDOCS_VERSION"]
6969
)
7070

7171
# Add any paths that contain custom static files (such as style sheets) here,
7272
# relative to this directory. They are copied after the builtin static files,
7373
# so a file named "default.css" will overwrite the builtin "default.css".
74-
html_static_path = ['_static']
74+
html_static_path = ["_static"]
7575

7676

7777
# -- linkcheck ---------------------------------------------------------------
@@ -80,19 +80,19 @@
8080

8181
# -- intersphinx -------------------------------------------------------------
8282
intersphinx_mapping = {
83-
'https://docs.python.org/': None,
84-
'django': (
85-
'https://docs.djangoproject.com/en/dev/',
86-
'https://docs.djangoproject.com/en/dev/_objects/',
83+
"https://docs.python.org/": None,
84+
"django": (
85+
"https://docs.djangoproject.com/en/dev/",
86+
"https://docs.djangoproject.com/en/dev/_objects/",
8787
),
88-
'sqlalchemy': (
89-
'https://docs.sqlalchemy.org/en/latest/',
90-
'https://docs.sqlalchemy.org/en/latest/objects.inv',
88+
"sqlalchemy": (
89+
"https://docs.sqlalchemy.org/en/latest/",
90+
"https://docs.sqlalchemy.org/en/latest/objects.inv",
9191
),
9292
}
9393

9494

9595
# -- spelling ---------------------------------------------------------------
9696
spelling_exclude_patterns = [
97-
'credits.rst',
97+
"credits.rst",
9898
]

examples/django_demo/django_demo/settings.py

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# See https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
2121

2222
# SECURITY WARNING: keep the secret key used in production secret!
23-
SECRET_KEY = 'kh)1s3@93ju6f6$qx!758f6h^(_3d0brqzoxubo@xsn3*%2wgu'
23+
SECRET_KEY = "kh)1s3@93ju6f6$qx!758f6h^(_3d0brqzoxubo@xsn3*%2wgu"
2424

2525
# SECURITY WARNING: don't run with debug turned on in production!
2626
DEBUG = True
@@ -31,53 +31,53 @@
3131
# Application definition
3232

3333
INSTALLED_APPS = [
34-
'django.contrib.admin',
35-
'django.contrib.auth',
36-
'django.contrib.contenttypes',
37-
'django.contrib.sessions',
38-
'django.contrib.messages',
39-
'django.contrib.staticfiles',
40-
'generic_foreignkey',
34+
"django.contrib.admin",
35+
"django.contrib.auth",
36+
"django.contrib.contenttypes",
37+
"django.contrib.sessions",
38+
"django.contrib.messages",
39+
"django.contrib.staticfiles",
40+
"generic_foreignkey",
4141
]
4242

4343
MIDDLEWARE = [
44-
'django.middleware.security.SecurityMiddleware',
45-
'django.contrib.sessions.middleware.SessionMiddleware',
46-
'django.middleware.common.CommonMiddleware',
47-
'django.middleware.csrf.CsrfViewMiddleware',
48-
'django.contrib.auth.middleware.AuthenticationMiddleware',
49-
'django.contrib.messages.middleware.MessageMiddleware',
50-
'django.middleware.clickjacking.XFrameOptionsMiddleware',
44+
"django.middleware.security.SecurityMiddleware",
45+
"django.contrib.sessions.middleware.SessionMiddleware",
46+
"django.middleware.common.CommonMiddleware",
47+
"django.middleware.csrf.CsrfViewMiddleware",
48+
"django.contrib.auth.middleware.AuthenticationMiddleware",
49+
"django.contrib.messages.middleware.MessageMiddleware",
50+
"django.middleware.clickjacking.XFrameOptionsMiddleware",
5151
]
5252

53-
ROOT_URLCONF = 'django_demo.urls'
53+
ROOT_URLCONF = "django_demo.urls"
5454

5555
TEMPLATES = [
5656
{
57-
'BACKEND': 'django.template.backends.django.DjangoTemplates',
58-
'DIRS': [],
59-
'APP_DIRS': True,
60-
'OPTIONS': {
61-
'context_processors': [
62-
'django.template.context_processors.debug',
63-
'django.template.context_processors.request',
64-
'django.contrib.auth.context_processors.auth',
65-
'django.contrib.messages.context_processors.messages',
57+
"BACKEND": "django.template.backends.django.DjangoTemplates",
58+
"DIRS": [],
59+
"APP_DIRS": True,
60+
"OPTIONS": {
61+
"context_processors": [
62+
"django.template.context_processors.debug",
63+
"django.template.context_processors.request",
64+
"django.contrib.auth.context_processors.auth",
65+
"django.contrib.messages.context_processors.messages",
6666
],
6767
},
6868
},
6969
]
7070

71-
WSGI_APPLICATION = 'django_demo.wsgi.application'
71+
WSGI_APPLICATION = "django_demo.wsgi.application"
7272

7373

7474
# Database
7575
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
7676

7777
DATABASES = {
78-
'default': {
79-
'ENGINE': 'django.db.backends.sqlite3',
80-
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
78+
"default": {
79+
"ENGINE": "django.db.backends.sqlite3",
80+
"NAME": os.path.join(BASE_DIR, "db.sqlite3"),
8181
}
8282
}
8383

@@ -87,26 +87,26 @@
8787

8888
AUTH_PASSWORD_VALIDATORS = [
8989
{
90-
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
90+
"NAME": "django.contrib.auth.password_validation.UserAttributeSimilarityValidator",
9191
},
9292
{
93-
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
93+
"NAME": "django.contrib.auth.password_validation.MinimumLengthValidator",
9494
},
9595
{
96-
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
96+
"NAME": "django.contrib.auth.password_validation.CommonPasswordValidator",
9797
},
9898
{
99-
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
99+
"NAME": "django.contrib.auth.password_validation.NumericPasswordValidator",
100100
},
101101
]
102102

103103

104104
# Internationalization
105105
# https://docs.djangoproject.com/en/1.10/topics/i18n/
106106

107-
LANGUAGE_CODE = 'en-us'
107+
LANGUAGE_CODE = "en-us"
108108

109-
TIME_ZONE = 'UTC'
109+
TIME_ZONE = "UTC"
110110

111111
USE_I18N = True
112112

@@ -118,4 +118,4 @@
118118
# Static files (CSS, JavaScript, Images)
119119
# https://docs.djangoproject.com/en/1.10/howto/static-files/
120120

121-
STATIC_URL = '/static/'
121+
STATIC_URL = "/static/"

examples/django_demo/django_demo/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
from django.contrib import admin
1818

1919
urlpatterns = [
20-
url(r'^admin/', admin.site.urls),
20+
url(r"^admin/", admin.site.urls),
2121
]

examples/django_demo/generic_foreignkey/apps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
class GenericForeignKeyConfig(AppConfig):
5-
name = 'generic_foreignkey'
5+
name = "generic_foreignkey"

examples/django_demo/generic_foreignkey/factories.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@
77

88

99
class UserFactory(factory.django.DjangoModelFactory):
10-
first_name = 'Adam'
10+
first_name = "Adam"
1111

1212
class Meta:
1313
model = User
1414

1515

1616
class GroupFactory(factory.django.DjangoModelFactory):
17-
name = 'group'
17+
name = "group"
1818

1919
class Meta:
2020
model = Group
2121

2222

2323
class TaggedItemFactory(factory.django.DjangoModelFactory):
24-
object_id = factory.SelfAttribute('content_object.id')
24+
object_id = factory.SelfAttribute("content_object.id")
2525
content_type = factory.LazyAttribute(
2626
lambda o: ContentType.objects.get_for_model(o.content_object)
2727
)
2828

2929
class Meta:
30-
exclude = ['content_object']
30+
exclude = ["content_object"]
3131
abstract = True
3232

3333

examples/django_demo/generic_foreignkey/migrations/0001_initial.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,29 @@ class Migration(migrations.Migration):
77
initial = True
88

99
dependencies = [
10-
('contenttypes', '0002_remove_content_type_name'),
10+
("contenttypes", "0002_remove_content_type_name"),
1111
]
1212

1313
operations = [
1414
migrations.CreateModel(
15-
name='TaggedItem',
15+
name="TaggedItem",
1616
fields=[
1717
(
18-
'id',
18+
"id",
1919
models.AutoField(
2020
auto_created=True,
2121
primary_key=True,
2222
serialize=False,
23-
verbose_name='ID',
23+
verbose_name="ID",
2424
),
2525
),
26-
('tag', models.SlugField()),
27-
('object_id', models.PositiveIntegerField()),
26+
("tag", models.SlugField()),
27+
("object_id", models.PositiveIntegerField()),
2828
(
29-
'content_type',
29+
"content_type",
3030
models.ForeignKey(
3131
on_delete=django.db.models.deletion.CASCADE,
32-
to='contenttypes.ContentType',
32+
to="contenttypes.ContentType",
3333
),
3434
),
3535
],

examples/django_demo/generic_foreignkey/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class TaggedItem(models.Model):
99
tag = models.SlugField()
1010
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
1111
object_id = models.PositiveIntegerField()
12-
content_object = GenericForeignKey('content_type', 'object_id')
12+
content_object = GenericForeignKey("content_type", "object_id")
1313

1414
def __str__(self):
1515
return self.tag

examples/django_demo/generic_foreignkey/tests.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@
88
class GenericFactoryTest(TestCase):
99
def test_user_factory(self):
1010
user = UserFactory()
11-
self.assertEqual(user.first_name, 'Adam')
11+
self.assertEqual(user.first_name, "Adam")
1212

1313
def test_group_factory(self):
1414
group = GroupFactory()
15-
self.assertEqual(group.name, 'group')
15+
self.assertEqual(group.name, "group")
1616

1717
def test_generic_user(self):
18-
model = TaggedUserFactory(tag='user')
19-
self.assertEqual(model.tag, 'user')
18+
model = TaggedUserFactory(tag="user")
19+
self.assertEqual(model.tag, "user")
2020
self.assertTrue(isinstance(model.content_object, User))
2121
self.assertEqual(
2222
model.content_type,
2323
ContentType.objects.get_for_model(model.content_object),
2424
)
2525

2626
def test_generic_group(self):
27-
model = TaggedGroupFactory(tag='group')
28-
self.assertEqual(model.tag, 'group')
27+
model = TaggedGroupFactory(tag="group")
28+
self.assertEqual(model.tag, "group")
2929
self.assertTrue(isinstance(model.content_object, Group))
3030
self.assertEqual(
3131
model.content_type,

examples/flask_alchemy/demoapp.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from flask_sqlalchemy import SQLAlchemy
55

66
app = Flask(__name__)
7-
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////tmp/test.db'
7+
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:////tmp/test.db"
88
db = SQLAlchemy(app)
99

1010

@@ -18,19 +18,19 @@ def __init__(self, username, email):
1818
self.email = email
1919

2020
def __repr__(self):
21-
return '<User %r>' % self.username
21+
return "<User %r>" % self.username
2222

2323

2424
class UserLog(db.Model):
2525
id = db.Column(db.Integer, primary_key=True)
2626
message = db.Column(db.String(1000))
2727

28-
user_id = db.Column(db.Integer, db.ForeignKey('user.id'))
29-
user = db.relationship('User', backref=db.backref('logs', lazy='dynamic'))
28+
user_id = db.Column(db.Integer, db.ForeignKey("user.id"))
29+
user = db.relationship("User", backref=db.backref("logs", lazy="dynamic"))
3030

3131
def __init__(self, message, user):
3232
self.message = message
3333
self.user = user
3434

3535
def __repr__(self):
36-
return f'<Log for {self.user!r}: {self.message}>'
36+
return f"<Log for {self.user!r}: {self.message}>"

0 commit comments

Comments
 (0)