Skip to content

Commit c5e4170

Browse files
authored
fix(chore): typing-extensions, lxml compatibility (#639)
* chore: update `requirements.txt`&`pyproject.toml` for `typing-extensions` mainly * style: following the coding style before this commit is for `pre-commit` mainly
1 parent 49ef352 commit c5e4170

3 files changed

Lines changed: 49 additions & 41 deletions

File tree

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ nosetests.xml
4242
.project
4343
.pydevproject
4444
venv
45+
.venv
4546
.vscode
4647

4748
# Ruff cache
@@ -52,4 +53,4 @@ venv
5253
_docs
5354
tests/localdebug
5455
requirements_poetry.txt
55-
tmp
56+
tmp

pyproject.toml

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,20 @@ description = "Simplified python article discovery & extraction."
55
authors = ["Andrei Paraschiv <andrei@thephpfactory.com>"]
66
license = "MIT"
77
readme = "README.md"
8-
packages = [
9-
{include = "newspaper"},
10-
]
8+
packages = [{ include = "newspaper" }]
119
keywords = ["nlp", "scraping", "newspaper", "article", "curation", "extraction"]
1210
classifiers = [
13-
"Development Status :: 4 - Beta",
14-
"Programming Language :: Python :: 3",
15-
"Natural Language :: English",
16-
"Topic :: Text Processing",
17-
"Topic :: Text Processing :: Markup :: HTML",
18-
"Topic :: Software Development :: Libraries :: Python Modules",
19-
"Intended Audience :: Developers",
20-
"Intended Audience :: Education",
21-
"Intended Audience :: Information Technology",
22-
"Intended Audience :: Science/Research",
23-
"License :: OSI Approved :: MIT License",
11+
"Development Status :: 4 - Beta",
12+
"Programming Language :: Python :: 3",
13+
"Natural Language :: English",
14+
"Topic :: Text Processing",
15+
"Topic :: Text Processing :: Markup :: HTML",
16+
"Topic :: Software Development :: Libraries :: Python Modules",
17+
"Intended Audience :: Developers",
18+
"Intended Audience :: Education",
19+
"Intended Audience :: Information Technology",
20+
"Intended Audience :: Science/Research",
21+
"License :: OSI Approved :: MIT License",
2422
]
2523
homepage = "https://github.com/AndyTheFactory/newspaper4k"
2624
repository = "https://github.com/AndyTheFactory/newspaper4k"
@@ -31,28 +29,29 @@ python = "^3.8"
3129
beautifulsoup4 = ">=4.9.3"
3230
Pillow = ">=4.0.0"
3331
PyYAML = ">=5.1"
34-
lxml = ">=4.2.0"
32+
lxml = ">=4.2.0, <5.2.0"
3533
nltk = ">=3.6.6"
3634
requests = ">=2.26.0"
3735
feedparser = ">=6.0.0"
3836
tldextract = ">=2.0.1"
3937
python-dateutil = ">=2.6.1"
4038
numpy = [
41-
{ version = ">=1.25", python = ">=3.11", optional = true},
42-
{ version = "^1.24", python = ">=3.8, <3.11", optional = true}
39+
{ version = ">=1.25", python = ">=3.11", optional = true },
40+
{ version = "^1.24", python = ">=3.8, <3.11", optional = true },
4341
]
4442
pandas = [
45-
{version = ">=2.1.0", optional = true, python = ">=3.11"},
46-
{version = ">=1.4", optional = true, python = ">=3.8, <3.11"}
43+
{ version = ">=2.1.0", optional = true, python = ">=3.11" },
44+
{ version = ">=1.4", optional = true, python = ">=3.8, <3.11" },
4745
]
46+
typing-extensions = ">=4.10.0"
4847

4948
# Language specific dependencies
50-
tinysegmenter = {version = ">=0.4", optional = true}
51-
pythainlp = {version = ">=2.3.2", optional = true}
52-
jieba = {version = ">=0.42.1", optional = true}
53-
indic-nlp-library = {version = ">=0.90", optional = true}
54-
cloudscraper = {version = ">=1.2.0", optional = true}
55-
gnews = {version = ">=0.3.6", optional = true}
49+
tinysegmenter = { version = ">=0.4", optional = true }
50+
pythainlp = { version = ">=2.3.2", optional = true }
51+
jieba = { version = ">=0.42.1", optional = true }
52+
indic-nlp-library = { version = ">=0.90", optional = true }
53+
cloudscraper = { version = ">=1.2.0", optional = true }
54+
gnews = { version = ">=0.3.6", optional = true }
5655

5756
[tool.poetry.extras]
5857
zh = ["jieba"]
@@ -64,26 +63,33 @@ np = ["indic-nlp-library"]
6463
ta = ["indic-nlp-library"]
6564
cloudflare = ["cloudscraper"]
6665
gnews = ["gnews"]
67-
all = ["tinysegmenter", "pythainlp", "jieba", "indic-nlp-library","cloudscraper","gnews"]
66+
all = [
67+
"tinysegmenter",
68+
"pythainlp",
69+
"jieba",
70+
"indic-nlp-library",
71+
"cloudscraper",
72+
"gnews",
73+
]
6874

6975
[tool.poetry.group.dev.dependencies]
70-
coverage = {version = ">=7.3.2", python = "^3.8"}
71-
pre-commit = {version = ">=3.5.0", python = "^3.8"}
72-
ruff = {version = ">=0.1.2", python = "^3.8"}
73-
codespell = {version = ">=2.2.6 ", python = "^3.8"}
74-
pytest = {version = ">=7.0.0", python = "^3.8"}
75-
mypy = {version="^1.8.0", python="^3.8"}
76-
lxml-stubs = {version = "^0.5.1", python = "^3.8"}
77-
types-pillow = {version = "^10.2.0.20240213", python = "^3.8"}
78-
types-python-dateutil = {version = "^2.8.19.20240106", python = "^3.8"}
76+
coverage = { version = ">=7.3.2", python = "^3.8" }
77+
pre-commit = { version = ">=3.5.0", python = "^3.8" }
78+
ruff = { version = ">=0.1.2", python = "^3.8" }
79+
codespell = { version = ">=2.2.6 ", python = "^3.8" }
80+
pytest = { version = ">=7.0.0", python = "^3.8" }
81+
mypy = { version = "^1.8.0", python = "^3.8" }
82+
lxml-stubs = { version = "^0.5.1", python = "^3.8" }
83+
types-pillow = { version = "^10.2.0.20240213", python = "^3.8" }
84+
types-python-dateutil = { version = "^2.8.19.20240106", python = "^3.8" }
7985
types-requests = "^2.27.1"
80-
types-beautifulsoup4 = {version = "^4.12.0.20240106", python = "^3.8"}
81-
virtualenv = {version = ">=20.25.1"}
86+
types-beautifulsoup4 = { version = "^4.12.0.20240106", python = "^3.8" }
87+
virtualenv = { version = ">=20.25.1" }
8288

8389
[tool.poetry.group.docs.dependencies]
84-
sphinx = {version = ">=7.0.0", python = "^3.8"}
85-
sphinx-argparse = {version = "*", python = "^3.8"}
86-
sphinx-rtd-theme = {version = ">=1.3.0", python = "^3.8"}
90+
sphinx = { version = ">=7.0.0", python = "^3.8" }
91+
sphinx-argparse = { version = "*", python = "^3.8" }
92+
sphinx-rtd-theme = { version = ">=1.3.0", python = "^3.8" }
8793

8894
[build-system]
8995
requires = ["poetry-core"]

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ tinysegmenter==0.4 ; python_version >= "3.8" and python_version < "4.0"
2626
tldextract==3.1.2 ; python_version >= "3.8" and python_version < "4.0"
2727
tqdm==4.64.1 ; python_version >= "3.8" and python_version < "4.0"
2828
urllib3==1.26.18 ; python_version >= "3.8" and python_version < "4.0"
29+
typing-extensions==4.10.0 ; python_version >= "3.8" and python_version < "4.0"

0 commit comments

Comments
 (0)