diff --git a/setup.py b/setup.py index e2c5f617..a74d50bb 100644 --- a/setup.py +++ b/setup.py @@ -46,9 +46,17 @@ [ "flask-reverse-proxy-fix", "@", - "https://github.com/rachmadaniHaryono/flask-reverse-proxy-fix/archive/refs/tags/v0.2.2rc1.zip", + "https://github.com/rachmadaniHaryono/flask-reverse-proxy-fix/archive/refs/tags/v0.2.3.zip", ] ) +install_requires = [ + 'beautifulsoup4>=4.4.1', + 'certifi', + 'cryptography>=1.2.3', + 'html5lib>=1.0.1', + 'pyreadline; sys_platform == \'windows\'', + 'urllib3>=1.23', +] setup( name='buku', @@ -63,19 +71,13 @@ python_requires='>=3.7', # requires pip>=9.0.0 platforms=['any'], py_modules=['buku'], - install_requires=[ - 'beautifulsoup4>=4.4.1', - 'cryptography>=1.2.3', - 'urllib3>=1.23', - 'html5lib>=1.0.1', - ], + install_requires=install_requires, packages=find_packages(exclude=['tests']), include_package_data=True, entry_points={ 'console_scripts': ['buku=buku:main', 'bukuserver=bukuserver.server:cli'] }, extras_require={ - "ca-certificates": ["certifi"], "tests": tests_require + server_require + [reverse_proxy], "server": server_require, "reverse_proxy": [reverse_proxy], diff --git a/tests/test_setup.py b/tests/test_setup.py index 9d4cef1d..c089ba64 100644 --- a/tests/test_setup.py +++ b/tests/test_setup.py @@ -1,15 +1,32 @@ import pathlib +import pytest -def test_bukuserver_requirement(monkeypatch): - def m_setup(**kwargs): + +@pytest.fixture +def setup_obj(monkeypatch): + def m_setup(**_): return None import setuptools monkeypatch.setattr(setuptools, 'setup', m_setup) import setup + return setup + + +def test_bukuserver_requirement(setup_obj): assert [ x for x in pathlib.Path("bukuserver/requirements.txt").read_text(encoding="utf8", errors="surrogateescape").splitlines() if "flask-reverse-proxy-fix" not in x - ] == setup.server_require + ] == setup_obj.server_require + + +def test_buku_requirement(setup_obj): + assert sorted( + [ + x + for x in pathlib.Path("requirements.txt").read_text(encoding="utf8", errors="surrogateescape").splitlines() + if not x.startswith('#') and x != 'setuptools' + ] + ) == sorted(setup_obj.install_requires)