From c161481d50b60c962c5ed13de19fc57e28fd82db Mon Sep 17 00:00:00 2001 From: Sean Hammond Date: Fri, 10 Jan 2025 19:19:38 +0000 Subject: [PATCH] Remove stuff that I've pulled into separate PRs See: https://github.com/hypothesis/cookiecutters/pull/191 https://github.com/hypothesis/cookiecutters/pull/192 https://github.com/hypothesis/cookiecutters/pull/193 https://github.com/hypothesis/cookiecutters/pull/194 --- _shared/project/pyproject.toml | 10 +--------- .../{{ cookiecutter.package_name }}/scripts/init_db.py | 8 +------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/_shared/project/pyproject.toml b/_shared/project/pyproject.toml index 80f49ba..15ffa00 100644 --- a/_shared/project/pyproject.toml +++ b/_shared/project/pyproject.toml @@ -164,10 +164,6 @@ show_missing = true precision = 2 fail_under = 100.00 skip_covered = true -exclude_also = [ - # # TYPE_CHECKING block is only executed while running mypy - "if TYPE_CHECKING:" -] {% if cookiecutter.get("linter") != "ruff" %} [tool.isort] @@ -273,7 +269,6 @@ pretty = true warn_unused_configs = true warn_redundant_casts = true warn_unused_ignores = true -check_untyped_defs = true disable_error_code = [ # https://mypy.readthedocs.io/en/stable/error_code_list.html#code-import-untyped @@ -284,12 +279,9 @@ disable_error_code = [ ] [[tool.mypy.overrides]] -module = [ +module= [ # Don't try to typecheck the tests for now "tests.*", - {% if include_exists("mypy/ignored_modules") %} - {{- include("mypy/ignored_modules", indent=4) -}} - {% endif %} ] ignore_errors = true {% if include_exists("pyproject.toml") %} diff --git a/pyramid-app/{{ cookiecutter.slug }}/{{ cookiecutter.package_name }}/scripts/init_db.py b/pyramid-app/{{ cookiecutter.slug }}/{{ cookiecutter.package_name }}/scripts/init_db.py index 01b1545..be127c8 100755 --- a/pyramid-app/{{ cookiecutter.slug }}/{{ cookiecutter.package_name }}/scripts/init_db.py +++ b/pyramid-app/{{ cookiecutter.slug }}/{{ cookiecutter.package_name }}/scripts/init_db.py @@ -54,13 +54,7 @@ def delete(engine: Engine) -> None: else: pre_delete(engine) - with engine.connect() as connection: - # Delete the DB "public" schema directly. - # We do this instead of using SQLAlchemy's drop_all because we want to delete all tables in the current DB. - # For example, this will delete tables created by migrations in other branches, not only the ones SQLAlchemy know about in the current code base. - connection.execute(text("DROP SCHEMA PUBLIC CASCADE;")) - connection.execute(text("CREATE SCHEMA PUBLIC;")) - connection.execute(text("COMMIT;")) + Base.metadata.drop_all(engine) try: from {{ cookiecutter.package_name }}.db import post_delete