diff --git a/examples/test-mongodb-covered-query.py b/examples/test-mongodb-covered-query.py index 9ee70b1..ec7c330 100644 --- a/examples/test-mongodb-covered-query.py +++ b/examples/test-mongodb-covered-query.py @@ -62,7 +62,7 @@ def docs_in_db(mongodb_instance): coll.drop() coll.create_index('number') n_records = 100 - for n in itertools.islice(itertools.count(), n_records): + for _ in itertools.islice(itertools.count(), n_records): doc = dict(number=random.randint(0, 2**32 - 1), value='some value') conn.test_db.test_coll.insert_one(doc) return coll diff --git a/pip_run/deps.py b/pip_run/deps.py index e9efef7..91efaec 100644 --- a/pip_run/deps.py +++ b/pip_run/deps.py @@ -58,6 +58,7 @@ def _mode_compat(): if mode := os.environ.get('PIP_RUN_MODE'): # pragma: no cover warnings.warn( 'PIP_RUN_MODE is deprecated. Use PIP_RUN_RETENTION_STRATEGY instead.', + stacklevel=1, ) return mode.replace('ephemeral', 'destroy') diff --git a/pip_run/scripts.py b/pip_run/scripts.py index cc18655..32baff6 100644 --- a/pip_run/scripts.py +++ b/pip_run/scripts.py @@ -134,7 +134,8 @@ def read_comments(self): lines = match.group(1).splitlines() warnings.warn( "Comment-style script declarations are deprecated. " - "Please use Python style or PEP 723 TOML style." + "Please use Python style or PEP 723 TOML style.", + stacklevel=1, ) except AttributeError: lines = []