Skip to content

Commit

Permalink
chore: assorted nits (#16383)
Browse files Browse the repository at this point in the history
  • Loading branch information
miketheman committed Aug 6, 2024
1 parent 4ca7e31 commit 655886c
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 32 deletions.
2 changes: 1 addition & 1 deletion bin/reformat
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
set -ex

find . -name '*.py' -exec python -m pyupgrade --py311-plus {} +
find . -name '*.py' -exec python -m pyupgrade --py312-plus {} +
python -m isort *.py warehouse/ tests/
python -m black *.py warehouse/ tests/
1 change: 1 addition & 0 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ hupper>=1.9
pip-tools>=1.0
pyramid_debugtoolbar>=2.5
pip-api
watchdog
19 changes: 1 addition & 18 deletions tests/unit/test_forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@
from webob.multidict import MultiDict
from wtforms.validators import StopValidation, ValidationError

from warehouse.forms import (
DBForm,
Form,
PasswordStrengthValidator,
SetLocaleForm,
URIValidator,
)
from warehouse.forms import Form, PasswordStrengthValidator, SetLocaleForm, URIValidator


class TestURIValidator:
Expand Down Expand Up @@ -199,17 +193,6 @@ class Meta:
break


class TestDBForm:
def test_form_requires_db(self):
with pytest.raises(TypeError):
DBForm()

def test_form_accepts_db(self):
db = pretend.stub()
form = DBForm(db=db)
assert form.db is db


class TestSetLocaleForm:
def test_validate(self):
form = SetLocaleForm(MultiDict({"locale_id": "es"}))
Expand Down
6 changes: 0 additions & 6 deletions warehouse/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,6 @@ def errors(self):
return errors


class DBForm(Form):
def __init__(self, *args, db, **kwargs):
super().__init__(*args, **kwargs)
self.db = db


class SetLocaleForm(Form):
__params__ = ["locale_id"]

Expand Down
2 changes: 1 addition & 1 deletion warehouse/static/sass/blocks/_lede-paragraph.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*/

/*
A lede paragaph. Use to highlight important sections in the text.
A lede paragraph. Use to highlight important sections in the text.
<p class="lede-paragraph">I will be larger than my counterparts</p>
*/
Expand Down
8 changes: 4 additions & 4 deletions warehouse/static/sass/blocks/_vertical-tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<div class="vertical-tabs__tabs">
<ul class="vertical-tabs__list">
<li>
<a id="my-tab-id" class="vetical-tabs__tab">
<a id="my-tab-id" class="vertical-tabs__tab">
// Tab
</a>
</li>
Expand All @@ -34,7 +34,7 @@
<nav aria-label="label for navigation">
<ul class="vertical-tabs__list">
<li>
<a id="my-tab-id" class="vetical-tabs__tab vertical-tabs__tab--is-active" aria-selected="true">
<a id="my-tab-id" class="vertical-tabs__tab vertical-tabs__tab--is-active" aria-selected="true">
// Active Tab. Remove --is-active and aria-selected for standard tab
</a>
</li>
Expand All @@ -60,7 +60,7 @@
<nav>
<ul class="vertical-tabs__list" role="tablist">
<li>
<a id="my-tab-id" class="vetical-tabs__tab vertical-tabs__tab--is-active" aria-selected="true" role="tab">
<a id="my-tab-id" class="vertical-tabs__tab vertical-tabs__tab--is-active" aria-selected="true" role="tab">
// Active Tab. Remove --is-active and aria-selected for standard tab
</a>
</li>
Expand All @@ -69,7 +69,7 @@
</div>
<div class="vertical-tabs__panel" role="tabpanel" aria-labelledby="my-tab-id my-mofile-tab-id">
<a id="my-mobile-tab-id" class="vetical-tabs__tab vertical-tabs__tab--mobile vertical-tabs__tab--is-active" aria-selected="true" role="tab">
<a id="my-mobile-tab-id" class="vertical-tabs__tab vertical-tabs__tab--mobile vertical-tabs__tab--is-active" aria-selected="true" role="tab">
// Duplicate Tab to show on smaller screens
// Active Tab. Remove --is-active and aria-selected for standard tab
</a>
Expand Down
2 changes: 2 additions & 0 deletions warehouse/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,8 @@ def includeme(config):
task_serializer="json",
worker_disable_rate_limits=True,
REDBEAT_REDIS_URL=s["celery.scheduler_url"],
# Silence deprecation warning on startup
broker_connection_retry_on_startup=False,
)
config.registry["celery.app"].Task = WarehouseTask
config.registry["celery.app"].pyramid_config = config
Expand Down
2 changes: 1 addition & 1 deletion warehouse/templates/accounts/two-factor.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ <h2>{% trans %}Authenticate with an app{% endtrans %}</h2>
autocapitalize="off",
autocomplete="one-time-code",
inputmode="numeric",
pattern="\d{6}",
pattern="\\d{6}",
required="required",
spellcheck="false",
class_="form-group__field",
Expand Down
2 changes: 1 addition & 1 deletion warehouse/templates/manage/account/totp-provision.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ <h2>{% trans %}Set up your application{% endtrans %}</h2>
autocapitalize="off",
autocomplete="off",
inputmode="numeric",
pattern="\d{6}",
pattern="\\d{6}",
required="required",
spellcheck="false",
class_="form-group__field",
Expand Down

0 comments on commit 655886c

Please sign in to comment.