From 9d99bebf8f2435cd518af20ee7b5e06b170562ca Mon Sep 17 00:00:00 2001 From: Andrei Paraschiv Date: Wed, 17 Jan 2024 08:32:32 +0200 Subject: [PATCH 1/3] Documentation changes v0.9.2 (#610) * Documentation changes v0.9.2 (#604) (#605) * feat(doc): :memo: adding evaluation results * feat(doc): :rocket: Documentation Update. Added Examples, documented new features --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9147e45..9859259 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -126,8 +126,8 @@ source venv/bin/activate # Upgrade pip (very important!) pip install --upgrade pip -# Install Newspaper3k in editable mode -pip install -e '.[dev]' +# Install Newspaper4k in editable mode +pip install -e '.' ``` Last, install the pre-commit hooks with: From 0706cb9a09290a6ae79a33488d87f47ee7868e92 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Mon, 19 Feb 2024 23:47:30 +0000 Subject: [PATCH 2/3] fix: Minimum Python now 3.8 --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- README.md | 4 +- docs/index.rst | 4 +- docs/user_guide/installation.rst | 2 +- poetry.lock | 49 ++++++---------------- pyproject.toml | 2 +- requirements.txt | 61 +++++++++++++--------------- setup.py | 6 +-- 8 files changed, 48 insertions(+), 82 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index fe3011f..4178925 100755 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -25,7 +25,7 @@ If applicable, add screenshots to help explain your problem. **System information** - OS: [Windows / Linux / Macos] - - Python version [e.g. 3.6, 3.9] + - Python version [e.g. 3.8, 3.9] - Library version [e.g. 0.9.0] **Additional context** diff --git a/README.md b/README.md index ba7dc40..f284f5c 100755 --- a/README.md +++ b/README.md @@ -15,9 +15,7 @@ I have duplicated all issues on the original project and will try to fix them. I ## Python compatibility - - Recommended: Python 3.8+ - - Python 3.6+ minimum - - Fixes for Python < 3.8 are low priority and might not be merged + - Python 3.8+ minimum # Quick start diff --git a/docs/index.rst b/docs/index.rst index 8ca2645..9a3e0ef 100755 --- a/docs/index.rst +++ b/docs/index.rst @@ -24,9 +24,7 @@ coding API is kept as much as possible. Python compatibility -------------------- -- Recommended: Python 3.8+ -- Python 3.6+ minimum -- Fixes for Python < 3.8 are low priority and might not be merged +- Python 3.8+ minimum At a glance: diff --git a/docs/user_guide/installation.rst b/docs/user_guide/installation.rst index b480829..d218693 100755 --- a/docs/user_guide/installation.rst +++ b/docs/user_guide/installation.rst @@ -29,7 +29,7 @@ If you want to install the latest version from Github, you can do so:: Requirements ------------ -``newspaper4k`` requires Python 3.7 and above to run. It was not tested on +``newspaper4k`` requires Python 3.8 and above to run. It was not tested on lower versions. The newspaper4k package has the following dependencies: diff --git a/poetry.lock b/poetry.lock index eecbd96..f8ae753 100755 --- a/poetry.lock +++ b/poetry.lock @@ -96,7 +96,6 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""} -importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} [[package]] name = "codespell" @@ -303,7 +302,6 @@ files = [ ] [package.dependencies] -typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} zipp = ">=0.5" [package.extras] @@ -311,24 +309,6 @@ docs = ["jaraco.packaging (>=8.2)", "rst.linker (>=1.9)", "sphinx"] perf = ["ipython"] testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pep517", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.0.1)", "pytest-flake8", "pytest-mypy", "pytest-perf (>=0.9.2)"] -[[package]] -name = "importlib-resources" -version = "5.4.0" -description = "Read resources from Python packages" -optional = false -python-versions = ">=3.6" -files = [ - {file = "importlib_resources-5.4.0-py3-none-any.whl", hash = "sha256:33a95faed5fc19b4bc16b29a6eeae248a3fe69dd55d4d229d2b480e23eeaad45"}, - {file = "importlib_resources-5.4.0.tar.gz", hash = "sha256:d756e2f85dd4de2ba89be0b21dba2a3bbec2e871a42a3a16719258a11f87506b"}, -] - -[package.dependencies] -zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""} - -[package.extras] -docs = ["jaraco.packaging (>=8.2)", "rst.linker (>=1.9)", "sphinx"] -testing = ["pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=1.0.1)", "pytest-flake8", "pytest-mypy"] - [[package]] name = "iniconfig" version = "2.0.0" @@ -790,6 +770,15 @@ files = [ {file = "python_crfsuite-0.9.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5ab333b7cda21b1b5ab76f8e16e5f00654360df057e2092b273681d64850f714"}, {file = "python_crfsuite-0.9.9-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:ee6153ed8a26adaea645445b997c55d67505476976dfc40f4bbd46200b66de15"}, {file = "python_crfsuite-0.9.9-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:c32292f722e293cee87aac0d793abd8b53dc05126e4b6f0202c41e0e7d027005"}, + {file = "python_crfsuite-0.9.9-cp311-cp311-win32.whl", hash = "sha256:3e8bbacff1d86cbc18e1d52f617c85521029127a09c86ed428cd8238384a9db3"}, + {file = "python_crfsuite-0.9.9-cp311-cp311-win_amd64.whl", hash = "sha256:83f87b652108110263aa83c220baccc36c911f04cf422cf6632a5f42121bce6a"}, + {file = "python_crfsuite-0.9.9-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:92f72eb554dac53218805958747b4cd417bd76039f083f66cc9881987d88e167"}, + {file = "python_crfsuite-0.9.9-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5cdd1e823fa9dfe611a573a0c1371941e887ad8b8ffbc25e2d87e4cd6d4f22af"}, + {file = "python_crfsuite-0.9.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:54f94d6fabb14ad8106dc65b5d38665bb0abb16527d4a6aa2ba233670c3480db"}, + {file = "python_crfsuite-0.9.9-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:65ebfab892c49c49b5e1030318d144c559e449bdf86b12983fa7ba0e88f7abdf"}, + {file = "python_crfsuite-0.9.9-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:5c1bb3d2802bb777affbe2855fc723aa32345ead2fe26ad18c7e1417bc104c53"}, + {file = "python_crfsuite-0.9.9-cp312-cp312-win32.whl", hash = "sha256:abef974a2b520c0204cb15b0b799fdbc1c1a0af4be2b9ad7548800de95975345"}, + {file = "python_crfsuite-0.9.9-cp312-cp312-win_amd64.whl", hash = "sha256:ccc4c4f1cd47c74553d03d915c7dd7c06fc23b41310f30f35f2e5c09cdeb9297"}, {file = "python_crfsuite-0.9.9-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:01d279f1c8225aaf66290563312708c1905dce84f70ee5e374ecfb2dec1c2343"}, {file = "python_crfsuite-0.9.9-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:5f29e94fcb9e2f8f52c7323668752b34dcffef91751b0d1e0789ecbbc0069842"}, {file = "python_crfsuite-0.9.9-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:497a8b9c0df152ada10732c07853942a8725cb66fe5b6fe1a64f768ecf583291"}, @@ -870,6 +859,7 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, @@ -1307,9 +1297,6 @@ files = [ {file = "tinydb-4.7.0.tar.gz", hash = "sha256:357eb7383dee6915f17b00596ec6dd2a890f3117bf52be28a4c516aeee581100"}, ] -[package.dependencies] -typing-extensions = {version = ">=3.10.0,<5.0.0", markers = "python_version <= \"3.7\""} - [[package]] name = "tinysegmenter" version = "0.4" @@ -1361,7 +1348,6 @@ files = [ [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""} -importlib-resources = {version = "*", markers = "python_version < \"3.7\""} [package.extras] dev = ["py-make (>=0.1.0)", "twine", "wheel"] @@ -1369,17 +1355,6 @@ notebook = ["ipywidgets (>=6)"] slack = ["slack-sdk"] telegram = ["requests"] -[[package]] -name = "typing-extensions" -version = "4.1.1" -description = "Backported and Experimental Type Hints for Python 3.6+" -optional = false -python-versions = ">=3.6" -files = [ - {file = "typing_extensions-4.1.1-py3-none-any.whl", hash = "sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2"}, - {file = "typing_extensions-4.1.1.tar.gz", hash = "sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42"}, -] - [[package]] name = "urllib3" version = "1.26.18" @@ -1433,5 +1408,5 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=4.6)", "pytest-black ( [metadata] lock-version = "2.0" -python-versions = "^3.6" -content-hash = "239cdfec8fc162ba48319e0728726d97190a55613428f50011d3c73c2a769ee1" +python-versions = "^3.8" +content-hash = "22d984ba939d9828edfe76b2ca929d08ad1274f08073bae31d86b6b3c8bd9deb" diff --git a/pyproject.toml b/pyproject.toml index eeb739f..f1b65af 100755 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,7 +27,7 @@ repository = "https://github.com/AndyTheFactory/newspaper4k" documentation = "https://newspaper4k.readthedocs.io/en/latest/" [tool.poetry.dependencies] -python = "^3.6" +python = "^3.8" beautifulsoup4 = ">=4.12.1" Pillow = ">=4.0.0" PyYAML = ">=5.1" diff --git a/requirements.txt b/requirements.txt index 55fc7bd..4a9df00 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,33 +1,28 @@ -beautifulsoup4==4.12.2 ; python_version >= "3.6" and python_version < "4.0" -certifi==2023.7.22 ; python_version >= "3.6" and python_version < "4.0" -charset-normalizer==2.0.12 ; python_version >= "3.6" and python_version < "4.0" -click==8.0.4 ; python_version >= "3.6" and python_version < "4.0" -colorama==0.4.5 ; python_version >= "3.6" and python_version < "4.0" and platform_system == "Windows" -feedfinder2==0.0.4 ; python_version >= "3.6" and python_version < "4.0" -feedparser==6.0.10 ; python_version >= "3.6" and python_version < "4.0" -filelock==3.4.1 ; python_version >= "3.6" and python_version < "4.0" -idna==3.4 ; python_version >= "3.6" and python_version < "4.0" -importlib-metadata==4.8.3 ; python_version >= "3.6" and python_version < "3.8" -importlib-resources==5.4.0 ; python_version >= "3.6" and python_version < "3.7" -jieba3k==0.35.1 ; python_version >= "3.6" and python_version < "4.0" -joblib==1.1.1 ; python_version >= "3.6" and python_version < "4.0" -lxml==4.9.3 ; python_version >= "3.6" and python_version < "4.0" -nltk==3.6.7 ; python_version >= "3.6" and python_version < "4.0" -pillow==8.4.0 ; python_version >= "3.6" and python_version < "4.0" -pythainlp==2.3.2 ; python_version >= "3.6" and python_version < "4.0" -python-crfsuite==0.9.9 ; python_version >= "3.6" and python_version < "4.0" -python-dateutil==2.8.2 ; python_version >= "3.6" and python_version < "4.0" -pyyaml==6.0.1 ; python_version >= "3.6" and python_version < "4.0" -regex==2023.8.8 ; python_version >= "3.6" and python_version < "4.0" -requests-file==1.5.1 ; python_version >= "3.6" and python_version < "4.0" -requests==2.27.1 ; python_version >= "3.6" and python_version < "4.0" -sgmllib3k==1.0.0 ; python_version >= "3.6" and python_version < "4.0" -six==1.16.0 ; python_version >= "3.6" and python_version < "4.0" -soupsieve==2.3.2.post1 ; python_version >= "3.6" and python_version < "4.0" -tinydb==4.7.0 ; python_version >= "3.6" and python_version < "4.0" -tinysegmenter==0.3 ; python_version >= "3.6" and python_version < "4.0" -tldextract==3.1.2 ; python_version >= "3.6" and python_version < "4.0" -tqdm==4.64.1 ; python_version >= "3.6" and python_version < "4.0" -typing-extensions==4.1.1 ; python_version >= "3.6" and python_version < "3.8" -urllib3==1.26.18 ; python_version >= "3.6" and python_version < "4.0" -zipp==3.6.0 ; python_version >= "3.6" and python_version < "3.8" +beautifulsoup4==4.12.2 ; python_version >= "3.8" and python_version < "4.0" +certifi==2023.11.17 ; python_version >= "3.8" and python_version < "4.0" +charset-normalizer==2.0.12 ; python_version >= "3.8" and python_version < "4.0" +click==8.0.4 ; python_version >= "3.8" and python_version < "4.0" +colorama==0.4.5 ; python_version >= "3.8" and python_version < "4.0" and platform_system == "Windows" +feedparser==6.0.10 ; python_version >= "3.8" and python_version < "4.0" +filelock==3.4.1 ; python_version >= "3.8" and python_version < "4.0" +idna==3.4 ; python_version >= "3.8" and python_version < "4.0" +jieba==0.42.1 ; python_version >= "3.8" and python_version < "4.0" +joblib==1.1.1 ; python_version >= "3.8" and python_version < "4.0" +lxml==4.9.3 ; python_version >= "3.8" and python_version < "4.0" +nltk==3.6.7 ; python_version >= "3.8" and python_version < "4.0" +pillow==8.4.0 ; python_version >= "3.8" and python_version < "4.0" +pythainlp==2.3.2 ; python_version >= "3.8" and python_version < "4.0" +python-crfsuite==0.9.9 ; python_version >= "3.8" and python_version < "4.0" +python-dateutil==2.8.2 ; python_version >= "3.8" and python_version < "4.0" +pyyaml==6.0.1 ; python_version >= "3.8" and python_version < "4.0" +regex==2023.8.8 ; python_version >= "3.8" and python_version < "4.0" +requests-file==1.5.1 ; python_version >= "3.8" and python_version < "4.0" +requests==2.27.1 ; python_version >= "3.8" and python_version < "4.0" +sgmllib3k==1.0.0 ; python_version >= "3.8" and python_version < "4.0" +six==1.16.0 ; python_version >= "3.8" and python_version < "4.0" +soupsieve==2.3.2.post1 ; python_version >= "3.8" and python_version < "4.0" +tinydb==4.7.0 ; python_version >= "3.8" and python_version < "4.0" +tinysegmenter==0.4 ; python_version >= "3.8" and python_version < "4.0" +tldextract==3.1.2 ; python_version >= "3.8" and python_version < "4.0" +tqdm==4.64.1 ; python_version >= "3.8" and python_version < "4.0" +urllib3==1.26.18 ; python_version >= "3.8" and python_version < "4.0" diff --git a/setup.py b/setup.py index 6042aa1..48f8e7b 100755 --- a/setup.py +++ b/setup.py @@ -24,8 +24,8 @@ os.system("python3 setup.py sdist upload -r pypi") sys.exit() -if sys.version_info < (3, 6): - sys.exit("Sorry, Python < 3.6 is not supported") +if sys.version_info < (3, 8): + sys.exit("Sorry, Python < 3.8 is not supported") with open("requirements.txt", encoding="utf-8") as f: @@ -45,7 +45,7 @@ author_email="andrei@thephpfactory.com", url="https://github.com/AndyTheFactory/newspaper4k", packages=packages, - python_requires=">=3.6", + python_requires=">=3.8", include_package_data=True, install_requires=required_packages, license="MIT", From e82930449651c433f2bfc5232e1c7675bfd094e8 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Mon, 19 Feb 2024 23:47:43 +0000 Subject: [PATCH 3/3] build: Also test 3.10/11/12 --- .github/workflows/pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index ebab347..feb4ec4 100755 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -13,7 +13,7 @@ jobs: # jobs. We will have two jobs (test and publish) with multiple steps. runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4