diff --git a/makefile b/makefile index 34b54698..aab715d5 100644 --- a/makefile +++ b/makefile @@ -1,33 +1,39 @@ -CODE = overhave VENV ?= .venv -WORK_DIR ?= . -MIN_COVERAGE = 89.1 + +CODE = overhave +ALL = $(CODE) $(DOCS_DIR) tests demo + PACKAGE_BUILD_DIR ?= dist -PYTHON_VERSION ?= 3.11 +WORK_DIR ?= . DOCS_DIR ?= docs DOCS_BUILD_DIR ?= _build DOCS_BUILDER ?= html DOCS_INCLUDES_DIR = $(DOCS_DIR)/includes DOCS_IMAGES_DIR = $(DOCS_INCLUDES_DIR)/images -COV_BADGE_SVG = $(DOCS_IMAGES_DIR)/coverage.svg DOCS_REFERENCES_DIR = $(DOCS_INCLUDES_DIR)/_references SPHINXAPIDOC_OPTS = -f -d 3 --ext-autodoc + +COV_BADGE_SVG = $(DOCS_IMAGES_DIR)/coverage.svg MYPY_CACHE_DIR = .mypy_cache -ALL = $(CODE) $(DOCS_DIR) tests demo +MIN_COVERAGE = 89.1 +PYTHON_VERSION ?= 3.11 JOBS ?= 4 -pre-init: +UNAME ?= $(shell uname) +pre-init: pre-init-$(UNAME) + +pre-init-Linux: sudo apt install python$(PYTHON_VERSION) python$(PYTHON_VERSION)-venv python$(PYTHON_VERSION)-dev python$(PYTHON_VERSION)-distutils gcc\ libsasl2-dev libldap2-dev libssl-dev libpq-dev g++ libgnutls28-dev -mac-pre-init: - brew install python@$(PYTHON_VERSION) gcc libsasl2 openldap libiconv libpq tmux libxml2 libxslt +pre-init-Darwin: + brew install python@$(PYTHON_VERSION) gcc cyrus-sasl openldap init: - python$(PYTHON_VERSION) -m venv $(VENV) + test -d $(VENV) || python$(PYTHON_VERSION) -m venv $(VENV) $(VENV)/bin/python -m pip install --upgrade pip $(VENV)/bin/python -m pip install poetry $(VENV)/bin/poetry install diff --git a/pyproject.toml b/pyproject.toml index 37756836..6b15102e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "overhave" -version = "5.1.7" +version = "5.1.8" description = "Overhave - web-framework for BDD" readme = "README.rst" authors = [ diff --git a/tests/db_utils.py b/tests/db_utils.py index 5e3c16de..55af990c 100644 --- a/tests/db_utils.py +++ b/tests/db_utils.py @@ -11,7 +11,6 @@ from sqlalchemy import event from overhave import db -from overhave.db import create_session BEFORE_CURSOR_EXECUTE_EVENT_NAME = "before_cursor_execute" AFTER_CURSOR_EXECUTE_EVENT_NAME = "after_cursor_execute" @@ -81,7 +80,7 @@ def validate_db_session(*args: Any, **kwargs: Any) -> None: break else: raise RuntimeError( - f"Using db.{create_session.__name__}() without {SQLCounter.__name__}! " + f"Using db.{db.create_session.__name__}() without {SQLCounter.__name__}! " f"Please, add `with {count_queries.__name__}(expected_count=n):` to your test" )