Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Docker support #44

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pytest_logikal/browser/chromium.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from abc import abstractmethod
from typing import Any, Dict, Type

Expand Down Expand Up @@ -33,6 +34,7 @@ def init_args(self) -> Dict[str, Any]:
'--disable-search-engine-choice-screen',
# Web platform behavior
f'--js-flags=--random-seed={DEFAULT_JS_RANDOM_SEED}',
*(['--no-sandbox'] if os.getenv('DOCKER_RUN') == '1' else [])
]

options = self.options_class()
Expand Down
2 changes: 1 addition & 1 deletion pytest_logikal/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def pytest_addoption(parser: pytest.Parser) -> None:
group.addoption('--no-pylint', action='store_true', help='do not use pylint')
group.addoption('--no-requirements', action='store_true', help='do not check requirements')
group.addoption('--no-style', action='store_true', help='do not use pycodestyle & pydocstyle')
group.addoption('--no-install', action='store_true', help='do not install packages')

if EXTRAS['django']:
group.addoption('--no-migration', action='store_true', help='do not check migrations')
Expand All @@ -55,7 +56,6 @@ def pytest_addoption(parser: pytest.Parser) -> None:
group.addoption('--no-css', action='store_true', help='do not run css checks')
group.addoption('--no-svg', action='store_true', help='do not run svg checks')
group.addoption('--no-js', action='store_true', help='do not run js checks')
group.addoption('--no-install', action='store_true', help='do not install packages')

for option, entry in DEFAULT_INI_OPTIONS.items():
parser.addini(option, default=str(entry['value']), help=entry['help'])
Expand Down
3 changes: 2 additions & 1 deletion pytest_logikal/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def pytest_sessionstart(session: pytest.Session) -> None:
if not session.config.getoption('no_install'):
install_node_packages()

if not session.config.getoption('no_css') and not session.config.getoption('no_svg'):
css_or_svg = not session.config.getoption('no_css') or not session.config.getoption('no_svg')
if not session.config.getoption('fast') and css_or_svg:
# We start the validator service here to avoid pytest's output capturing
Validator.service_url()

Expand Down
10 changes: 5 additions & 5 deletions requirements/dev.txt.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## DO NOT EDIT THIS FILE.
## This is a locked requirements file generated by pyorbs.
##
## Requirements hash: f41544170eeafc53ce555705b2513ad9b8019d8fc81a71c2a9d656e0ccbc615c
## Requirements hash: e189ad6b93754b6df783fa8060dce845e5d8090ead3f4b22f46bfc947929765a
##
###################################################################################################
-e .
Expand Down Expand Up @@ -32,7 +32,7 @@ django-migration-linter==5.1.0
django-stubs==4.2.7
django-stubs-ext==5.0.0
djlint==1.34.1
docker==7.0.0
docker==7.1.0
docutils==0.20.1
EditorConfig==0.12.4
exceptiongroup==1.2.1
Expand All @@ -59,7 +59,7 @@ jsbeautifier==1.15.1
json5==0.9.25
keyring==25.2.1
logikal-docs==1.1.4
logikal-utils==1.1.0
logikal-utils==1.1.1
markdown-it-py==3.0.0
MarkupSafe==2.1.5
mccabe==0.7.0
Expand Down Expand Up @@ -102,7 +102,7 @@ pytz==2024.1
PyYAML==6.0.1
readme_renderer==43.0
regex==2023.12.25
requests==2.31.0
requests==2.32.2
requests-toolbelt==1.0.0
rfc3986==2.0.0
rich==13.7.1
Expand Down Expand Up @@ -135,7 +135,7 @@ trio-websocket==0.11.1
twine==5.1.0
types-pytz==2024.1.0.20240417
types-PyYAML==6.0.12.20240311
types-requests==2.31.0.20240406
types-requests==2.32.0.20240523
types-tqdm==4.66.0.20240417
typing_extensions==4.11.0
urllib3==2.2.1
Expand Down
10 changes: 5 additions & 5 deletions requirements/docs.txt.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## DO NOT EDIT THIS FILE.
## This is a locked requirements file generated by pyorbs.
##
## Requirements hash: 49046982207a816fa7a4a207626836f702b212515e8a94283769de8473b710b3
## Requirements hash: 569e4a42677a7862a3c16175b3497fe03a500929bcf719b0839e3f3cfe62d036
##
###################################################################################################
-e .
Expand All @@ -28,7 +28,7 @@ django-migration-linter==5.1.0
django-stubs==4.2.7
django-stubs-ext==5.0.0
djlint==1.34.1
docker==7.0.0
docker==7.1.0
docutils==0.20.1
EditorConfig==0.12.4
exceptiongroup==1.2.1
Expand All @@ -49,7 +49,7 @@ Jinja2==3.1.4
jsbeautifier==1.15.1
json5==0.9.25
logikal-docs==1.1.4
logikal-utils==1.1.0
logikal-utils==1.1.1
markdown-it-py==3.0.0
MarkupSafe==2.1.5
mccabe==0.7.0
Expand Down Expand Up @@ -86,7 +86,7 @@ python-dateutil==2.9.0.post0
pytz==2024.1
PyYAML==6.0.1
regex==2023.12.25
requests==2.31.0
requests==2.32.2
rich==13.7.1
selenium==4.21.0
setuptools==70.0.0
Expand Down Expand Up @@ -114,7 +114,7 @@ trio==0.25.1
trio-websocket==0.11.1
types-pytz==2024.1.0.20240417
types-PyYAML==6.0.12.20240311
types-requests==2.31.0.20240406
types-requests==2.32.0.20240523
types-tqdm==4.66.0.20240417
typing_extensions==4.11.0
urllib3==2.2.1
Expand Down
4 changes: 2 additions & 2 deletions requirements/extras/browser.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
requests<2.32 # see https://github.com/docker/docker-py/issues/3256
types-requests<2.32 # see https://github.com/docker/docker-py/issues/3256
requests~=2.32
types-requests~=2.32
tqdm~=4.66
types-tqdm~=4.66
selenium==4.21.0
Expand Down
4 changes: 2 additions & 2 deletions requirements/extras/django.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ pytest-django==4.8.0
pytest-factoryboy==2.7.0

# Validator
requests<2.32 # see https://github.com/docker/docker-py/issues/3256
types-requests<2.32 # see https://github.com/docker/docker-py/issues/3256
requests~=2.32
types-requests~=2.32
logikal-utils[docker]~=1.1