diff --git a/.azure-pipelines/publish.yml b/.azure-pipelines/publish.yml index 60ab9d7..13a9d03 100644 --- a/.azure-pipelines/publish.yml +++ b/.azure-pipelines/publish.yml @@ -36,7 +36,7 @@ extends: - script: | python -m pip install --upgrade pip pip install -r local-requirements.txt - python setup.py sdist bdist_wheel + python -m build --sdist displayName: 'Install & Build' - task: EsrpRelease@7 inputs: diff --git a/local-requirements.txt b/local-requirements.txt index 0a6a346..68879e5 100644 --- a/local-requirements.txt +++ b/local-requirements.txt @@ -1,7 +1,7 @@ black==24.3.0 pytest-cov==3.0.0 mypy==0.961 -setuptools==70.3.0 +build==1.2.2.post1 twine==4.0.1 wheel==0.38.1 flake8==4.0.1 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..486ed68 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,41 @@ +[build-system] +requires = ["setuptools==75.4.0", "setuptools_scm==8.1.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "pytest-playwright" +description = "A pytest wrapper with fixtures for Playwright to automate web browsers" +readme = "README.md" +authors = [ + {name = "Microsoft"} +] +license = {file = "LICENSE"} +requires-python = ">=3.9" +classifiers = [ + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Framework :: Pytest", +] +dynamic = ["version"] +dependencies = [ + "playwright>=1.18", + "pytest>=6.2.4,<9.0.0", + "pytest-base-url>=1.0.0,<3.0.0", + "python-slugify>=6.0.0,<9.0.0", +] + +[project.urls] +homepage = "https://github.com/microsoft/playwright-pytest" + +[project.entry-points.pytest11] +playwright = "pytest_playwright.pytest_playwright" + +[tool.setuptools] +packages = ["pytest_playwright"] +[tool.setuptools_scm] diff --git a/setup.py b/setup.py deleted file mode 100644 index 5530c33..0000000 --- a/setup.py +++ /dev/null @@ -1,42 +0,0 @@ -import setuptools - -with open("README.md", "r", encoding="utf-8") as fh: - long_description = fh.read() - -setuptools.setup( - name="pytest-playwright", - author="Microsoft", - author_email="", - description="A pytest wrapper with fixtures for Playwright to automate web browsers", - license="Apache-2.0", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/microsoft/playwright-pytest", - packages=["pytest_playwright"], - include_package_data=True, - install_requires=[ - "playwright>=1.18", - "pytest>=6.2.4,<9.0.0", - "pytest-base-url>=1.0.0,<3.0.0", - "python-slugify>=6.0.0,<9.0.0", - ], - entry_points={"pytest11": ["playwright = pytest_playwright.pytest_playwright"]}, - classifiers=[ - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "License :: OSI Approved :: Apache Software License", - "Operating System :: OS Independent", - "Framework :: Pytest", - ], - python_requires=">=3.9", - use_scm_version={ - "version_scheme": "post-release", - "write_to": "pytest_playwright/_repo_version.py", - "write_to_template": 'version = "{version}"\n', - }, - setup_requires=["setuptools_scm"], -) diff --git a/tests/assets/django/settings.py b/tests/assets/django/settings.py index 9e88e8b..25b5519 100644 --- a/tests/assets/django/settings.py +++ b/tests/assets/django/settings.py @@ -91,8 +91,6 @@ USE_I18N = True -USE_L10N = True - USE_TZ = True diff --git a/tests/test_playwright.py b/tests/test_playwright.py index ea6d806..8d67dc3 100644 --- a/tests/test_playwright.py +++ b/tests/test_playwright.py @@ -13,6 +13,7 @@ # limitations under the License. import os +from pathlib import Path import sys import pytest @@ -438,6 +439,8 @@ def test_base_url(page): def test_django(testdir: pytest.Testdir) -> None: + # Workaround for https://github.com/pytest-dev/pytest/issues/10651 + os.environ.setdefault("PYTHONPATH", str(Path(__file__).parent.parent)) testdir.makepyfile( """ from django.test import TestCase