Repository: Asugawara/requests-html-playwright (language: python)

Issue:
PyPy instalation ends with file in the wrong place
Hi,

Was interested in seeing what progress you made in this integration, looks like your setup ends with files in site-packages/src

Hope this helps :-)

D.


Discussion / hints:
Hi!

Thank you for your information:)
I appreciate your help in pointing out the potential issues. 
I will investigate this!

Fix patch:
diff --git a/pyproject.toml b/pyproject.toml
index 440d2e5..5df0a8e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,12 +1,27 @@
 [tool.poetry]
 name = "requests-html-playwright"
-version = "0.11.1"
+version = "0.11.2"
 description = "Requests-HTML(with microsoft/playwright-python): HTML Parsing for Humans™"
 authors = ["Asugawara <asgasw@gmail.com>"]
 readme = "README.md"
-packages = [{include = "src"}]
+packages = [{include = "requests_html_playwright"}]
 homepage = "https://github.com/Asugawara/requests-html-playwright"
 repository = "https://github.com/Asugawara/requests-html-playwright"
+license = "MIT"
+keywords = [
+  "requests-html",
+  "playwright"
+]
+classifiers=[
+        "License :: OSI Approved :: MIT License",
+        "Programming Language :: Python",
+        "Programming Language :: Python :: 3 :: Only",
+        "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: 3.10",
+        "Programming Language :: Python :: 3.11",
+        "Programming Language :: Python :: 3.12",
+        "Programming Language :: Python :: Implementation :: PyPy"
+]
 
 [tool.poetry.dependencies]
 python = "^3.9"
@@ -33,6 +48,9 @@ types-requests = "^2.31.0.0"
 pre-commit = "^3.5.0"
 isort = "^5.12.0"
 
+[tool.isort]
+profile = "black"
+
 [build-system]
 requires = ["poetry-core>=1.7.0"]
 build-backend = "poetry.core.masonry.api"
diff --git a/src/__init__.py b/requests_html_playwright/__init__.py
similarity index 100%
rename from src/__init__.py
rename to requests_html_playwright/__init__.py
diff --git a/src/requests_html.py b/requests_html_playwright/requests_html.py
similarity index 100%
rename from src/requests_html.py
rename to requests_html_playwright/requests_html.py


Test patch:
diff --git a/tests/test_internet.py b/tests/test_internet.py
index f2608c8..ab1f559 100644
--- a/tests/test_internet.py
+++ b/tests/test_internet.py
@@ -1,6 +1,10 @@
 import pytest
 
-from src.requests_html import AsyncHTMLSession, HTMLResponse, HTMLSession
+from requests_html_playwright.requests_html import (
+    AsyncHTMLSession,
+    HTMLResponse,
+    HTMLSession,
+)
 
 urls = [
     "https://xkcd.com/1957/",
diff --git a/tests/test_requests_html.py b/tests/test_requests_html.py
index 3906404..1ae36e4 100644
--- a/tests/test_requests_html.py
+++ b/tests/test_requests_html.py
@@ -9,7 +9,12 @@
 from playwright.sync_api import Browser, Error
 from requests_file import FileAdapter
 
-from src.requests_html import HTML, AsyncHTMLSession, HTMLSession, Retry
+from requests_html_playwright.requests_html import (
+    HTML,
+    AsyncHTMLSession,
+    HTMLSession,
+    Retry,
+)
 
 
 @pytest.mark.parametrize("version", ("3.9", "3.10", "3.11", "3.12"))
@@ -18,8 +23,8 @@ def test_import(version: str):
     with patch.object(sys, "version_info") as mock_version, patch.dict("sys.modules"):
         mock_version.major = major
         mock_version.minor = minor
-        del sys.modules["src.requests_html"]
-        assert importlib.import_module("src.requests_html")
+        del sys.modules["requests_html_playwright.requests_html"]
+        assert importlib.import_module("requests_html_playwright.requests_html")
 
 
 @pytest.mark.parametrize("version", ("3.7", "3.8"))
@@ -28,9 +33,9 @@ def test_import_fail(version: str):
     with patch.object(sys, "version_info") as mock_version, patch.dict("sys.modules"):
         mock_version.major = major
         mock_version.minor = minor
-        del sys.modules["src.requests_html"]
+        del sys.modules["requests_html_playwright.requests_html"]
         with pytest.raises(RuntimeError):
-            importlib.import_module("src.requests_html")
+            importlib.import_module("requests_html_playwright.requests_html")
 
 
 @pytest.mark.parametrize("tries", (3, 4, 5))