From fc1fc6ff177091691f874fc82266a5f595555b0c Mon Sep 17 00:00:00 2001 From: James Kachel Date: Tue, 5 Nov 2024 06:45:46 -0800 Subject: [PATCH] Add necessary migration for geoip app and some minor build tweaks (#171) --- README.md | 10 ++++- docker-compose.yml | 2 +- pyproject.toml | 2 + .../changelog.d/20241105_143822_jkachel.md | 40 ++++++++++++++++++ src/common/mitol/common/apps.py | 2 +- src/common/mitol/common/utils/base.py | 2 +- .../changelog.d/20241105_143822_jkachel.md | 40 ++++++++++++++++++ .../mitol/digitalcredentials/apps.py | 2 +- .../0001_add_digital_credentials_models.py | 4 +- .../0002_rename_courseware_to_credentialed.py | 4 +- .../mitol/digitalcredentials/views.py | 6 +-- .../changelog.d/20241104_210241_somebody.md | 41 +++++++++++++++++++ .../changelog.d/20241105_143822_jkachel.md | 40 ++++++++++++++++++ src/geoip/mitol/geoip/admin.py | 6 +-- src/geoip/mitol/geoip/apps.py | 2 +- .../geoip/migrations/0001_add_geoip_tables.py | 4 +- .../0002_rename_maxmind_tables_to_geoip.py | 27 ++++++++++++ src/geoip/mitol/geoip/models.py | 6 +-- .../changelog.d/20241105_143822_jkachel.md | 40 ++++++++++++++++++ .../mitol/google_sheets/admin.py | 2 +- src/google_sheets/mitol/google_sheets/apps.py | 2 +- .../google_sheets/migrations/0001_initial.py | 4 +- ...lter_filewatchrenewalattempt_sheet_type.py | 4 +- .../mitol/google_sheets/utils.py | 2 +- .../changelog.d/20241105_143822_jkachel.md | 40 ++++++++++++++++++ .../mitol/google_sheets_deferrals/apps.py | 2 +- .../migrations/0001_initial.py | 4 +- .../changelog.d/20241105_143822_jkachel.md | 40 ++++++++++++++++++ .../mitol/google_sheets_refunds/apps.py | 2 +- .../migrations/0001_initial.py | 4 +- .../changelog.d/20241105_143822_jkachel.md | 40 ++++++++++++++++++ src/hubspot_api/mitol/hubspot_api/apps.py | 2 +- .../hubspot_api/migrations/0001_initial.py | 4 +- src/hubspot_api/mitol/hubspot_api/models.py | 4 +- .../changelog.d/20241105_143822_jkachel.md | 40 ++++++++++++++++++ .../mitol/oauth_toolkit_extensions/admin.py | 2 +- .../oauth_toolkit_extensions/factories.py | 2 +- .../migrations/0001_add_application_access.py | 4 +- .../changelog.d/20241105_143822_jkachel.md | 40 ++++++++++++++++++ .../mitol/payment_gateway/api.py | 2 +- .../mitol/payment_gateway/apps.py | 2 +- tests/mitol/common/test_apps.py | 4 +- tests/testapp/factories.py | 2 +- tests/testapp/migrations/0001_initial.py | 4 +- .../migrations/0002_auditabletestmodel.py | 4 +- .../0003_auditabletestmodelaudit.py | 4 +- uv.lock | 2 +- 47 files changed, 493 insertions(+), 55 deletions(-) create mode 100644 src/common/changelog.d/20241105_143822_jkachel.md create mode 100644 src/digitalcredentials/changelog.d/20241105_143822_jkachel.md create mode 100644 src/geoip/changelog.d/20241104_210241_somebody.md create mode 100644 src/geoip/changelog.d/20241105_143822_jkachel.md create mode 100644 src/geoip/mitol/geoip/migrations/0002_rename_maxmind_tables_to_geoip.py create mode 100644 src/google_sheets/changelog.d/20241105_143822_jkachel.md create mode 100644 src/google_sheets_deferrals/changelog.d/20241105_143822_jkachel.md create mode 100644 src/google_sheets_refunds/changelog.d/20241105_143822_jkachel.md create mode 100644 src/hubspot_api/changelog.d/20241105_143822_jkachel.md create mode 100644 src/oauth_toolkit_extensions/changelog.d/20241105_143822_jkachel.md create mode 100644 src/payment_gateway/changelog.d/20241105_143822_jkachel.md diff --git a/README.md b/README.md index 0d3538b6..1854378b 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ The Compose environment includes a container for general use called `shell` and - Build the containers: `docker compose build` - Get a shell in the `shell` container: `docker compose run --rm -ti shell bash` +The database server is exposed on port 55432 locally - you can override this by setting `POSTGRES_PORT` in your environment. + #### Using the `release` container The `release` container is special and is set up to run `build` commands, including generating releases. It's special because it _does not_ mount your local copy of the codebase (mainly because of file permission issues). So, it requires a bit more care before using. @@ -71,7 +73,13 @@ To add a new one, it's easiest to copy one of the existing apps. There's one cal You can now add your code and tests. -If you need to run Django commands, +### Running Django commands + +You can run Django commands by using the `testapp` that's included: + +`uv run tests/manage.py` + +The management commands for each ol-django app should be available. If you need to run things that require a database, run it in the Docker Compose setup as it contains a PostgreSQL database. ### Running tests diff --git a/docker-compose.yml b/docker-compose.yml index b74ed007..29141104 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,7 +7,7 @@ services: POSTGRES_DB: ol_django POSTGRES_PASSWORD: postgres ports: - - "5432:5432" + - "${POSTGRES_PORT:-55432}:5432" shell: build: diff --git a/pyproject.toml b/pyproject.toml index 1cb880f4..aa8ed5f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -203,6 +203,7 @@ lint.ignore = [ "RET506", "RET507", "RET508", + "RUF012", "UP007" ] lint.typing-modules = ["colour.hints"] @@ -216,3 +217,4 @@ inline-quotes = "double" [tool.ruff.lint.per-file-ignores] "tests/**" = ["S101"] "test_*.py" = ["S101"] +"**/migrations/**" = ["ARG001", "D100", "D101", "E501"] diff --git a/src/common/changelog.d/20241105_143822_jkachel.md b/src/common/changelog.d/20241105_143822_jkachel.md new file mode 100644 index 00000000..6380a829 --- /dev/null +++ b/src/common/changelog.d/20241105_143822_jkachel.md @@ -0,0 +1,40 @@ + + + + +### Changed + +- Removes unnecessary noqa's. + + + + diff --git a/src/common/mitol/common/apps.py b/src/common/mitol/common/apps.py index 739c65ee..42913538 100644 --- a/src/common/mitol/common/apps.py +++ b/src/common/mitol/common/apps.py @@ -11,7 +11,7 @@ class BaseApp(AppConfig): """Base application class""" - required_settings: List[str] = [] # noqa: FA100, RUF012 + required_settings: List[str] = [] # noqa: FA100 def validate_required_settings(self): """ diff --git a/src/common/mitol/common/utils/base.py b/src/common/mitol/common/utils/base.py index 9e9569c8..a588a466 100644 --- a/src/common/mitol/common/utils/base.py +++ b/src/common/mitol/common/utils/base.py @@ -5,7 +5,7 @@ def base_register_subclasses_factory(*mixin_classes): class BaseRegisterSubclasses(abc.ABC, *mixin_classes): - _SUBCLASSES = {} # noqa: RUF012 + _SUBCLASSES = {} def __init_subclass__(cls, *, subclass_type, **kwargs): super().__init_subclass__() diff --git a/src/digitalcredentials/changelog.d/20241105_143822_jkachel.md b/src/digitalcredentials/changelog.d/20241105_143822_jkachel.md new file mode 100644 index 00000000..6380a829 --- /dev/null +++ b/src/digitalcredentials/changelog.d/20241105_143822_jkachel.md @@ -0,0 +1,40 @@ + + + + +### Changed + +- Removes unnecessary noqa's. + + + + diff --git a/src/digitalcredentials/mitol/digitalcredentials/apps.py b/src/digitalcredentials/mitol/digitalcredentials/apps.py index e81c24f8..8d6d6b35 100644 --- a/src/digitalcredentials/mitol/digitalcredentials/apps.py +++ b/src/digitalcredentials/mitol/digitalcredentials/apps.py @@ -12,7 +12,7 @@ class DigitalCredentialsApp(BaseApp): label = "digitalcredentials" verbose_name = "Digital Credentials" - required_settings = [ # noqa: RUF012 + required_settings = [ "MITOL_DIGITAL_CREDENTIALS_VERIFY_SERVICE_BASE_URL", "MITOL_DIGITAL_CREDENTIALS_BUILD_CREDENTIAL_FUNC", "MITOL_DIGITAL_CREDENTIALS_HMAC_SECRET", diff --git a/src/digitalcredentials/mitol/digitalcredentials/migrations/0001_add_digital_credentials_models.py b/src/digitalcredentials/mitol/digitalcredentials/migrations/0001_add_digital_credentials_models.py index 6b2ef257..4fdd12d8 100644 --- a/src/digitalcredentials/mitol/digitalcredentials/migrations/0001_add_digital_credentials_models.py +++ b/src/digitalcredentials/mitol/digitalcredentials/migrations/0001_add_digital_credentials_models.py @@ -10,12 +10,12 @@ class Migration(migrations.Migration): initial = True - dependencies = [ # noqa: RUF012 + dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("contenttypes", "0002_remove_content_type_name"), ] - operations = [ # noqa: RUF012 + operations = [ migrations.CreateModel( name="LearnerDID", fields=[ diff --git a/src/digitalcredentials/mitol/digitalcredentials/migrations/0002_rename_courseware_to_credentialed.py b/src/digitalcredentials/mitol/digitalcredentials/migrations/0002_rename_courseware_to_credentialed.py index 9c3754a8..15117e7a 100644 --- a/src/digitalcredentials/mitol/digitalcredentials/migrations/0002_rename_courseware_to_credentialed.py +++ b/src/digitalcredentials/mitol/digitalcredentials/migrations/0002_rename_courseware_to_credentialed.py @@ -4,11 +4,11 @@ class Migration(migrations.Migration): - dependencies = [ # noqa: RUF012 + dependencies = [ ("digitalcredentials", "0001_add_digital_credentials_models"), ] - operations = [ # noqa: RUF012 + operations = [ migrations.RenameField( model_name="digitalcredential", old_name="courseware_content_type", diff --git a/src/digitalcredentials/mitol/digitalcredentials/views.py b/src/digitalcredentials/mitol/digitalcredentials/views.py index ba9fcb10..3ccf9269 100644 --- a/src/digitalcredentials/mitol/digitalcredentials/views.py +++ b/src/digitalcredentials/mitol/digitalcredentials/views.py @@ -15,9 +15,9 @@ class DigitalCredentialIssueView(GenericAPIView): """Digital credential API views""" - authentication_classes = [OAuth2Authentication] # noqa: RUF012 - permission_classes = [IsAuthenticated, TokenHasScope] # noqa: RUF012 - required_scopes = ["digitalcredentials"] # noqa: RUF012 + authentication_classes = [OAuth2Authentication] + permission_classes = [IsAuthenticated, TokenHasScope] + required_scopes = ["digitalcredentials"] serializer_class = DigitalCredentialIssueSerializer lookup_field = "uuid" diff --git a/src/geoip/changelog.d/20241104_210241_somebody.md b/src/geoip/changelog.d/20241104_210241_somebody.md new file mode 100644 index 00000000..66ac71a3 --- /dev/null +++ b/src/geoip/changelog.d/20241104_210241_somebody.md @@ -0,0 +1,41 @@ + + + + + + + +### Fixed + +- Adding migrations to rename the maxmind indexes to geoip. + + diff --git a/src/geoip/changelog.d/20241105_143822_jkachel.md b/src/geoip/changelog.d/20241105_143822_jkachel.md new file mode 100644 index 00000000..6380a829 --- /dev/null +++ b/src/geoip/changelog.d/20241105_143822_jkachel.md @@ -0,0 +1,40 @@ + + + + +### Changed + +- Removes unnecessary noqa's. + + + + diff --git a/src/geoip/mitol/geoip/admin.py b/src/geoip/mitol/geoip/admin.py index 60170a63..970ef282 100644 --- a/src/geoip/mitol/geoip/admin.py +++ b/src/geoip/mitol/geoip/admin.py @@ -8,9 +8,9 @@ class NetBlockAdmin(admin.ModelAdmin): """Admin for netblock""" - list_display = ["network", "ip_start", "ip_end", "is_ipv6"] # noqa: RUF012 - list_filter = ["is_ipv6"] # noqa: RUF012 - search_fields = ["ip_start", "ip_end", "network"] # noqa: RUF012 + list_display = ["network", "ip_start", "ip_end", "is_ipv6"] + list_filter = ["is_ipv6"] + search_fields = ["ip_start", "ip_end", "network"] admin.site.register(models.Geoname) diff --git a/src/geoip/mitol/geoip/apps.py b/src/geoip/mitol/geoip/apps.py index cd6e5543..a2d46dc9 100644 --- a/src/geoip/mitol/geoip/apps.py +++ b/src/geoip/mitol/geoip/apps.py @@ -12,7 +12,7 @@ class GeoIPApp(BaseApp): label = "geoip" verbose_name = "GeoIP" - required_settings = [] # noqa: RUF012 + required_settings = [] # necessary because this is a namespaced app path = os.path.dirname(os.path.abspath(__file__)) # noqa: PTH100, PTH120 diff --git a/src/geoip/mitol/geoip/migrations/0001_add_geoip_tables.py b/src/geoip/mitol/geoip/migrations/0001_add_geoip_tables.py index bf3fc11f..f260de01 100644 --- a/src/geoip/mitol/geoip/migrations/0001_add_geoip_tables.py +++ b/src/geoip/mitol/geoip/migrations/0001_add_geoip_tables.py @@ -6,9 +6,9 @@ class Migration(migrations.Migration): initial = True - dependencies = [] # noqa: RUF012 + dependencies = [] - operations = [ # noqa: RUF012 + operations = [ migrations.CreateModel( name="Geoname", fields=[ diff --git a/src/geoip/mitol/geoip/migrations/0002_rename_maxmind_tables_to_geoip.py b/src/geoip/mitol/geoip/migrations/0002_rename_maxmind_tables_to_geoip.py new file mode 100644 index 00000000..fa7995c2 --- /dev/null +++ b/src/geoip/mitol/geoip/migrations/0002_rename_maxmind_tables_to_geoip.py @@ -0,0 +1,27 @@ +# Generated by Django 4.2.16 on 2024-11-04 20:47 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("geoip", "0001_add_geoip_tables"), + ] + + operations = [ + migrations.RenameIndex( + model_name="netblock", + new_name="geoip_netbl_decimal_d4f6be_idx", + old_name="maxmind_net_decimal_dfdb1a_idx", + ), + migrations.RenameIndex( + model_name="netblock", + new_name="geoip_netbl_decimal_29d863_idx", + old_name="maxmind_net_decimal_6166c4_idx", + ), + migrations.RenameIndex( + model_name="netblock", + new_name="geoip_netbl_decimal_724563_idx", + old_name="maxmind_net_decimal_ab7249_idx", + ), + ] diff --git a/src/geoip/mitol/geoip/models.py b/src/geoip/mitol/geoip/models.py index 685c5a20..72c6a88e 100644 --- a/src/geoip/mitol/geoip/models.py +++ b/src/geoip/mitol/geoip/models.py @@ -32,7 +32,7 @@ class Geoname(models.Model): is_in_european_union = models.BooleanField(blank=True, null=True, default=False) class Meta: - constraints = [ # noqa: RUF012 + constraints = [ models.UniqueConstraint( fields=["geoname_id", "locale_code"], name="unique_geoname_id_locale" ) @@ -89,7 +89,7 @@ class NetBlock(models.Model): accuracy_radius = models.IntegerField(blank=True, null=True) class Meta: - constraints = [ # noqa: RUF012 + constraints = [ models.CheckConstraint( check=models.Q(geoname_id__isnull=False) | models.Q(registered_country_geoname_id__isnull=False) @@ -97,7 +97,7 @@ class Meta: name="at_least_one_geoname_id", ) ] - indexes = [ # noqa: RUF012 + indexes = [ models.Index(fields=["decimal_ip_start"]), models.Index(fields=["decimal_ip_end"]), models.Index(fields=["decimal_ip_start", "decimal_ip_end"]), diff --git a/src/google_sheets/changelog.d/20241105_143822_jkachel.md b/src/google_sheets/changelog.d/20241105_143822_jkachel.md new file mode 100644 index 00000000..6380a829 --- /dev/null +++ b/src/google_sheets/changelog.d/20241105_143822_jkachel.md @@ -0,0 +1,40 @@ + + + + +### Changed + +- Removes unnecessary noqa's. + + + + diff --git a/src/google_sheets/mitol/google_sheets/admin.py b/src/google_sheets/mitol/google_sheets/admin.py index a3487599..ff78449e 100644 --- a/src/google_sheets/mitol/google_sheets/admin.py +++ b/src/google_sheets/mitol/google_sheets/admin.py @@ -28,7 +28,7 @@ class GoogleFileWatchAdmin(admin.ModelAdmin): "expiration_date", "last_request_received", ) - ordering = ["-expiration_date"] # noqa: RUF012 + ordering = ["-expiration_date"] def save_form(self, request, form, change): if not change: diff --git a/src/google_sheets/mitol/google_sheets/apps.py b/src/google_sheets/mitol/google_sheets/apps.py index fce25fe1..da76c914 100644 --- a/src/google_sheets/mitol/google_sheets/apps.py +++ b/src/google_sheets/mitol/google_sheets/apps.py @@ -12,7 +12,7 @@ class GoogleSheetsApp(BaseApp): label = "google_sheets" verbose_name = "Google Sheets" - required_settings = [] # noqa: RUF012 + required_settings = [] # necessary because this is a namespaced app path = os.path.dirname(os.path.abspath(__file__)) # noqa: PTH100, PTH120 diff --git a/src/google_sheets/mitol/google_sheets/migrations/0001_initial.py b/src/google_sheets/mitol/google_sheets/migrations/0001_initial.py index f97acbbf..cedc23b9 100644 --- a/src/google_sheets/mitol/google_sheets/migrations/0001_initial.py +++ b/src/google_sheets/mitol/google_sheets/migrations/0001_initial.py @@ -8,11 +8,11 @@ class Migration(migrations.Migration): initial = True - dependencies = [ # noqa: RUF012 + dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] - operations = [ # noqa: RUF012 + operations = [ migrations.CreateModel( name="FileWatchRenewalAttempt", fields=[ diff --git a/src/google_sheets/mitol/google_sheets/migrations/0002_alter_filewatchrenewalattempt_sheet_type.py b/src/google_sheets/mitol/google_sheets/migrations/0002_alter_filewatchrenewalattempt_sheet_type.py index 560924b7..17c57e0d 100644 --- a/src/google_sheets/mitol/google_sheets/migrations/0002_alter_filewatchrenewalattempt_sheet_type.py +++ b/src/google_sheets/mitol/google_sheets/migrations/0002_alter_filewatchrenewalattempt_sheet_type.py @@ -4,11 +4,11 @@ class Migration(migrations.Migration): - dependencies = [ # noqa: RUF012 + dependencies = [ ("google_sheets", "0001_initial"), ] - operations = [ # noqa: RUF012 + operations = [ migrations.AlterField( model_name="filewatchrenewalattempt", name="sheet_type", diff --git a/src/google_sheets/mitol/google_sheets/utils.py b/src/google_sheets/mitol/google_sheets/utils.py index 5755dc65..e2fda96e 100644 --- a/src/google_sheets/mitol/google_sheets/utils.py +++ b/src/google_sheets/mitol/google_sheets/utils.py @@ -63,7 +63,7 @@ class SheetConfigMixin: worksheet_type = None worksheet_name = None first_data_row = None - non_input_column_indices = set() # noqa: RUF012 + non_input_column_indices = set() num_columns = 0 @property diff --git a/src/google_sheets_deferrals/changelog.d/20241105_143822_jkachel.md b/src/google_sheets_deferrals/changelog.d/20241105_143822_jkachel.md new file mode 100644 index 00000000..6380a829 --- /dev/null +++ b/src/google_sheets_deferrals/changelog.d/20241105_143822_jkachel.md @@ -0,0 +1,40 @@ + + + + +### Changed + +- Removes unnecessary noqa's. + + + + diff --git a/src/google_sheets_deferrals/mitol/google_sheets_deferrals/apps.py b/src/google_sheets_deferrals/mitol/google_sheets_deferrals/apps.py index bc754a8b..5a31b0fc 100644 --- a/src/google_sheets_deferrals/mitol/google_sheets_deferrals/apps.py +++ b/src/google_sheets_deferrals/mitol/google_sheets_deferrals/apps.py @@ -13,7 +13,7 @@ class GoogleSheetsDeferralsApp(BaseApp): verbose_name = "Google Sheets Deferrals" default_auto_field = "django.db.models.BigAutoField" - required_settings = [] # noqa: RUF012 + required_settings = [] # necessary because this is a namespaced app path = os.path.dirname(os.path.abspath(__file__)) # noqa: PTH100, PTH120 diff --git a/src/google_sheets_deferrals/mitol/google_sheets_deferrals/migrations/0001_initial.py b/src/google_sheets_deferrals/mitol/google_sheets_deferrals/migrations/0001_initial.py index 14e8fa01..eed59953 100644 --- a/src/google_sheets_deferrals/mitol/google_sheets_deferrals/migrations/0001_initial.py +++ b/src/google_sheets_deferrals/mitol/google_sheets_deferrals/migrations/0001_initial.py @@ -6,9 +6,9 @@ class Migration(migrations.Migration): initial = True - dependencies = [] # noqa: RUF012 + dependencies = [] - operations = [ # noqa: RUF012 + operations = [ migrations.CreateModel( name="DeferralRequest", fields=[ diff --git a/src/google_sheets_refunds/changelog.d/20241105_143822_jkachel.md b/src/google_sheets_refunds/changelog.d/20241105_143822_jkachel.md new file mode 100644 index 00000000..6380a829 --- /dev/null +++ b/src/google_sheets_refunds/changelog.d/20241105_143822_jkachel.md @@ -0,0 +1,40 @@ + + + + +### Changed + +- Removes unnecessary noqa's. + + + + diff --git a/src/google_sheets_refunds/mitol/google_sheets_refunds/apps.py b/src/google_sheets_refunds/mitol/google_sheets_refunds/apps.py index aa32b212..e182a3c8 100644 --- a/src/google_sheets_refunds/mitol/google_sheets_refunds/apps.py +++ b/src/google_sheets_refunds/mitol/google_sheets_refunds/apps.py @@ -12,7 +12,7 @@ class GoogleSheetsRefundsApp(BaseApp): label = "google_sheets_refunds" verbose_name = "Google Sheets Refunds" - required_settings = [] # noqa: RUF012 + required_settings = [] # necessary because this is a namespaced app path = os.path.dirname(os.path.abspath(__file__)) # noqa: PTH100, PTH120 diff --git a/src/google_sheets_refunds/mitol/google_sheets_refunds/migrations/0001_initial.py b/src/google_sheets_refunds/mitol/google_sheets_refunds/migrations/0001_initial.py index 000086ce..a10ff9d4 100644 --- a/src/google_sheets_refunds/mitol/google_sheets_refunds/migrations/0001_initial.py +++ b/src/google_sheets_refunds/mitol/google_sheets_refunds/migrations/0001_initial.py @@ -6,9 +6,9 @@ class Migration(migrations.Migration): initial = True - dependencies = [] # noqa: RUF012 + dependencies = [] - operations = [ # noqa: RUF012 + operations = [ migrations.CreateModel( name="RefundRequest", fields=[ diff --git a/src/hubspot_api/changelog.d/20241105_143822_jkachel.md b/src/hubspot_api/changelog.d/20241105_143822_jkachel.md new file mode 100644 index 00000000..6380a829 --- /dev/null +++ b/src/hubspot_api/changelog.d/20241105_143822_jkachel.md @@ -0,0 +1,40 @@ + + + + +### Changed + +- Removes unnecessary noqa's. + + + + diff --git a/src/hubspot_api/mitol/hubspot_api/apps.py b/src/hubspot_api/mitol/hubspot_api/apps.py index 279a4d66..2c2e09b9 100644 --- a/src/hubspot_api/mitol/hubspot_api/apps.py +++ b/src/hubspot_api/mitol/hubspot_api/apps.py @@ -12,7 +12,7 @@ class HubspotApiApp(BaseApp): label = "hubspot_api" verbose_name = "Hubspot OL Integration" - required_settings = [] # noqa: RUF012 + required_settings = [] # necessary because this is a namespaced app path = os.path.dirname(os.path.abspath(__file__)) # noqa: PTH100, PTH120 diff --git a/src/hubspot_api/mitol/hubspot_api/migrations/0001_initial.py b/src/hubspot_api/mitol/hubspot_api/migrations/0001_initial.py index adf51690..938a7bdc 100644 --- a/src/hubspot_api/mitol/hubspot_api/migrations/0001_initial.py +++ b/src/hubspot_api/mitol/hubspot_api/migrations/0001_initial.py @@ -7,11 +7,11 @@ class Migration(migrations.Migration): initial = True - dependencies = [ # noqa: RUF012 + dependencies = [ ("contenttypes", "0002_remove_content_type_name"), ] - operations = [ # noqa: RUF012 + operations = [ migrations.CreateModel( name="HubspotObject", fields=[ diff --git a/src/hubspot_api/mitol/hubspot_api/models.py b/src/hubspot_api/mitol/hubspot_api/models.py index ec9db7d9..2550832a 100644 --- a/src/hubspot_api/mitol/hubspot_api/models.py +++ b/src/hubspot_api/mitol/hubspot_api/models.py @@ -16,13 +16,13 @@ class HubspotObject(models.Model): content_object = GenericForeignKey("content_type", "object_id") class Meta: - indexes = [ # noqa: RUF012 + indexes = [ models.Index( fields=["content_type", "object_id"], name="hubspot_api_content_object_idx", ), ] - constraints = [ # noqa: RUF012 + constraints = [ models.UniqueConstraint( fields=["object_id", "content_type"], name="hubspot_api_unique_object_id_type", diff --git a/src/oauth_toolkit_extensions/changelog.d/20241105_143822_jkachel.md b/src/oauth_toolkit_extensions/changelog.d/20241105_143822_jkachel.md new file mode 100644 index 00000000..6380a829 --- /dev/null +++ b/src/oauth_toolkit_extensions/changelog.d/20241105_143822_jkachel.md @@ -0,0 +1,40 @@ + + + + +### Changed + +- Removes unnecessary noqa's. + + + + diff --git a/src/oauth_toolkit_extensions/mitol/oauth_toolkit_extensions/admin.py b/src/oauth_toolkit_extensions/mitol/oauth_toolkit_extensions/admin.py index 56ae147e..8d08f2ba 100644 --- a/src/oauth_toolkit_extensions/mitol/oauth_toolkit_extensions/admin.py +++ b/src/oauth_toolkit_extensions/mitol/oauth_toolkit_extensions/admin.py @@ -17,7 +17,7 @@ class ApplicationAccessInlineAdmin(admin.StackedInline): class ApplicationWithAccessAdmin(ApplicationAdmin): """Admin for Application""" - inlines = [ApplicationAccessInlineAdmin] # noqa: RUF012 + inlines = [ApplicationAccessInlineAdmin] Application = get_application_model() diff --git a/src/oauth_toolkit_extensions/mitol/oauth_toolkit_extensions/factories.py b/src/oauth_toolkit_extensions/mitol/oauth_toolkit_extensions/factories.py index b8f73529..dc71b03d 100644 --- a/src/oauth_toolkit_extensions/mitol/oauth_toolkit_extensions/factories.py +++ b/src/oauth_toolkit_extensions/mitol/oauth_toolkit_extensions/factories.py @@ -104,7 +104,7 @@ class ApplicationAccessFactory(DjangoModelFactory): "mitol.oauth_toolkit_extensions.factories.ApplicationFactory" ) - scopes = ["custom_scope_1", "custom_scope_2"] # noqa: RUF012 + scopes = ["custom_scope_1", "custom_scope_2"] class Meta: model = ApplicationAccess diff --git a/src/oauth_toolkit_extensions/mitol/oauth_toolkit_extensions/migrations/0001_add_application_access.py b/src/oauth_toolkit_extensions/mitol/oauth_toolkit_extensions/migrations/0001_add_application_access.py index 1d25c285..45a44a43 100644 --- a/src/oauth_toolkit_extensions/mitol/oauth_toolkit_extensions/migrations/0001_add_application_access.py +++ b/src/oauth_toolkit_extensions/mitol/oauth_toolkit_extensions/migrations/0001_add_application_access.py @@ -8,11 +8,11 @@ class Migration(migrations.Migration): initial = True - dependencies = [ # noqa: RUF012 + dependencies = [ migrations.swappable_dependency(settings.OAUTH2_PROVIDER_APPLICATION_MODEL), ] - operations = [ # noqa: RUF012 + operations = [ migrations.CreateModel( name="ApplicationAccess", fields=[ diff --git a/src/payment_gateway/changelog.d/20241105_143822_jkachel.md b/src/payment_gateway/changelog.d/20241105_143822_jkachel.md new file mode 100644 index 00000000..6380a829 --- /dev/null +++ b/src/payment_gateway/changelog.d/20241105_143822_jkachel.md @@ -0,0 +1,40 @@ + + + + +### Changed + +- Removes unnecessary noqa's. + + + + diff --git a/src/payment_gateway/mitol/payment_gateway/api.py b/src/payment_gateway/mitol/payment_gateway/api.py index 1e56f275..9dc63f78 100644 --- a/src/payment_gateway/mitol/payment_gateway/api.py +++ b/src/payment_gateway/mitol/payment_gateway/api.py @@ -138,7 +138,7 @@ class PaymentGateway(abc.ABC): the processor to capture card information). """ - _GATEWAYS = {} # noqa: RUF012 + _GATEWAYS = {} def __init_subclass__(cls, *, gateway_class, **kwargs): super().__init_subclass__() diff --git a/src/payment_gateway/mitol/payment_gateway/apps.py b/src/payment_gateway/mitol/payment_gateway/apps.py index b5d956ac..4c69d368 100644 --- a/src/payment_gateway/mitol/payment_gateway/apps.py +++ b/src/payment_gateway/mitol/payment_gateway/apps.py @@ -12,7 +12,7 @@ class PaymentGatewayApp(BaseApp): label = "payment_gateway" verbose_name = "Payment Gateway" - required_settings = [ # noqa: RUF012 + required_settings = [ "MITOL_PAYMENT_GATEWAY_CYBERSOURCE_ACCESS_KEY", "MITOL_PAYMENT_GATEWAY_CYBERSOURCE_PROFILE_ID", "MITOL_PAYMENT_GATEWAY_CYBERSOURCE_SECURITY_KEY", diff --git a/tests/mitol/common/test_apps.py b/tests/mitol/common/test_apps.py index 7b3fa680..ff6a6357 100644 --- a/tests/mitol/common/test_apps.py +++ b/tests/mitol/common/test_apps.py @@ -23,7 +23,7 @@ def test_base_app_required_settings(settings): class RequiredSettingsApp(BaseApp): """Test app that requires settings""" - required_settings = ["TEST_SETTING"] # noqa: RUF012 + required_settings = ["TEST_SETTING"] settings.TEST_SETTING = True @@ -38,7 +38,7 @@ def test_base_app_required_settings_missing(settings): class RequiredSettingsApp(BaseApp): """Test app that requires settings""" - required_settings = ["TEST_SETTING", "TEST_SETTING2"] # noqa: RUF012 + required_settings = ["TEST_SETTING", "TEST_SETTING2"] settings.TEST_SETTING = True diff --git a/tests/testapp/factories.py b/tests/testapp/factories.py index 9ea64dd4..6a8195c8 100644 --- a/tests/testapp/factories.py +++ b/tests/testapp/factories.py @@ -57,7 +57,7 @@ class Meta: ip_address = FAKE.ipv4() reference = fuzzy.FuzzyText(length=6) username = FAKE.safe_email() - items = [] # noqa: RUF012 + items = [] class RefundFactory(Factory): diff --git a/tests/testapp/migrations/0001_initial.py b/tests/testapp/migrations/0001_initial.py index 26da429a..56ddfa8b 100644 --- a/tests/testapp/migrations/0001_initial.py +++ b/tests/testapp/migrations/0001_initial.py @@ -8,12 +8,12 @@ class Migration(migrations.Migration): initial = True - dependencies = [ # noqa: RUF012 + dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("contenttypes", "0002_remove_content_type_name"), ] - operations = [ # noqa: RUF012 + operations = [ migrations.CreateModel( name="SecondLevel1", fields=[ diff --git a/tests/testapp/migrations/0002_auditabletestmodel.py b/tests/testapp/migrations/0002_auditabletestmodel.py index 85995c8a..43e7842c 100644 --- a/tests/testapp/migrations/0002_auditabletestmodel.py +++ b/tests/testapp/migrations/0002_auditabletestmodel.py @@ -4,11 +4,11 @@ class Migration(migrations.Migration): - dependencies = [ # noqa: RUF012 + dependencies = [ ("testapp", "0001_initial"), ] - operations = [ # noqa: RUF012 + operations = [ migrations.CreateModel( name="AuditableTestModel", fields=[ diff --git a/tests/testapp/migrations/0003_auditabletestmodelaudit.py b/tests/testapp/migrations/0003_auditabletestmodelaudit.py index b870d10f..7ceb40c1 100644 --- a/tests/testapp/migrations/0003_auditabletestmodelaudit.py +++ b/tests/testapp/migrations/0003_auditabletestmodelaudit.py @@ -6,12 +6,12 @@ class Migration(migrations.Migration): - dependencies = [ # noqa: RUF012 + dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("testapp", "0002_auditabletestmodel"), ] - operations = [ # noqa: RUF012 + operations = [ migrations.CreateModel( name="AuditableTestModelAudit", fields=[ diff --git a/uv.lock b/uv.lock index fa318b4c..82ca6c4e 100644 --- a/uv.lock +++ b/uv.lock @@ -1338,7 +1338,7 @@ requires-dist = [ [[package]] name = "mitol-django-geoip" -version = "2023.12.19.1" +version = "2024.10.25" source = { editable = "src/geoip" } dependencies = [ { name = "django" },