Skip to content

feat: make pytest-base-url an optional dependency - #334

Merged
Pavel Feldman (pavelfeldman) merged 3 commits into
mainfrom
feat-311-optional-base-url
Oct 8, 2026
Merged

Pavel Feldman (pavelfeldman) merged 3 commits into
mainfrom
feat-311-optional-base-url

Conversation

@pavelfeldman

@pavelfeldman Pavel Feldman (pavelfeldman) commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

pytest-base-url (MPL-2.0) and its transitive requests/certifi dependencies get flagged by license scanners. It's now an optional extra, pip install pytest-playwright[base-url].

When pytest-base-url is not in use, the plugin itself provides --base-url (defaulting to $PYTEST_BASE_URL), the base_url ini option and the base_url fixture. Only --verify-base-url needs the extra. Whether pytest-base-url is in use is decided in pytest_load_initial_conftests, once every plugin from -p, entry points and the initial conftests is registered, and the options are added there (the command line is parsed afterwards). This covers an installed but not loaded plugin (PYTEST_DISABLE_PLUGIN_AUTOLOAD=1), -p no:base_url, and -p base_url or -p pytest_base_url.plugin in any order relative to this plugin. Environments that already have pytest-base-url installed behave as before.

Tests: --base-url, the ini option, the env var, and no value at all, each with pytest-base-url disabled; and plugin autoload disabled with and without pytest-base-url loaded explicitly (sync + async). A new CI job uninstalls pytest-base-url and runs the base-url tests, so the "not installed" path is covered as well. A fresh install no longer pulls in pytest-base-url, requests or certifi.

Release note: anyone relying on --verify-base-url needs pytest-playwright[base-url]. Docs follow-up: the "Configure base-url" section on playwright.dev should mention the extra.

Fixes #311

Stack created with GitHub Stacks CLI • Give Feedback 💬

Comment thread .github/workflows/ci.yml Fixed
@pavelfeldman
Pavel Feldman (pavelfeldman) force-pushed the feat-311-optional-base-url branch 5 times, most recently from 1060d41 to e0f9557 Compare October 8, 2026 02:12
pytest-base-url (MPL-2.0) and its transitive requests/certifi dependencies
get flagged by license scanners. Move it to an optional extra
(pytest-playwright[base-url]). When it is not installed, or disabled with
-p no:base_url, the plugin provides --base-url (defaulting to
$PYTEST_BASE_URL), the base_url ini option and the base_url fixture itself.
Only --verify-base-url requires the extra.

Fixes #311
…est with plugin autoload disabled, run the base-url tests without pytest-base-url in CI
@pavelfeldman
Pavel Feldman (pavelfeldman) removed this pull request from stack #335 October 8, 2026 02:19
@pavelfeldman
Pavel Feldman (pavelfeldman) changed the base branch from feat-137-api-request-tracing to main October 8, 2026 02:21
…ntain permissions'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@pavelfeldman
Pavel Feldman (pavelfeldman) merged commit 63a07cd into main Oct 8, 2026
15 checks passed
@pavelfeldman
Pavel Feldman (pavelfeldman) deleted the feat-311-optional-base-url branch October 8, 2026 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make pytest-base-url optional to avoid transitive MPL-2.0 dependency (certifi)

2 participants