Skip to content

Commit

Permalink
Merge pull request jarun#665 from rachmadaniHaryono/bugfix/window-setup
Browse files Browse the repository at this point in the history
Bugfix/window setup
  • Loading branch information
jarun authored Jan 21, 2023
2 parents fb8b15c + c6515fd commit c19853c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
18 changes: 10 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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],
Expand Down
23 changes: 20 additions & 3 deletions tests/test_setup.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit c19853c

Please sign in to comment.