Dev Improvements (#2058)

* added ruff cache to git ignore

* moved venv to project and added interpreter path

* added dummy method to LDAP test

* removed unused setting
This commit is contained in:
Michael Genson 2023-01-28 18:49:09 -06:00 committed by GitHub
parent ed797ef8b2
commit 2340ee5bfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 8 deletions

View File

@ -20,7 +20,8 @@ ENV PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=off \ PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \ PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \ PIP_DEFAULT_TIMEOUT=100 \
POETRY_HOME="/opt/poetry" POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_IN_PROJECT=true
# prepend poetry and venv to path # prepend poetry and venv to path
ENV PATH="$POETRY_HOME/bin:$PATH" ENV PATH="$POETRY_HOME/bin:$PATH"

1
.gitignore vendored
View File

@ -86,6 +86,7 @@ coverage.xml
*.cover *.cover
.hypothesis/ .hypothesis/
.pytest_cache/ .pytest_cache/
.ruff_cache/
test.db test.db
# Translations # Translations

35
.vscode/settings.json vendored
View File

@ -1,5 +1,9 @@
{ {
"cSpell.enableFiletypes": ["!javascript", "!python", "!yaml"], "cSpell.enableFiletypes": [
"!javascript",
"!python",
"!yaml"
],
"cSpell.words": [ "cSpell.words": [
"chowdown", "chowdown",
"compression", "compression",
@ -14,7 +18,9 @@
"source.organizeImports": false "source.organizeImports": false
}, },
"editor.formatOnSave": true, "editor.formatOnSave": true,
"eslint.workingDirectories": ["./frontend"], "eslint.workingDirectories": [
"./frontend"
],
"files.exclude": { "files.exclude": {
"**/__pycache__": true, "**/__pycache__": true,
"**/.DS_Store": true, "**/.DS_Store": true,
@ -23,24 +29,39 @@
"**/.svn": true, "**/.svn": true,
"**/CVS": true "**/CVS": true
}, },
"i18n-ally.enabledFrameworks": ["vue"], "i18n-ally.enabledFrameworks": [
"vue"
],
"i18n-ally.keystyle": "nested", "i18n-ally.keystyle": "nested",
"i18n-ally.localesPaths": "frontend/lang/messages", "i18n-ally.localesPaths": "frontend/lang/messages",
"i18n-ally.sourceLanguage": "en-US", "i18n-ally.sourceLanguage": "en-US",
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
"python.formatting.provider": "black", "python.formatting.provider": "black",
"python.linting.enabled": true, "python.linting.enabled": true,
"python.linting.flake8Enabled": false, "python.linting.flake8Enabled": false,
"python.linting.pylintEnabled": false, "python.linting.pylintEnabled": false,
"python.linting.pylintArgs": ["--rcfile=${workspaceFolder}/.pylintrc"], "python.linting.pylintArgs": [
"--rcfile=${workspaceFolder}/.pylintrc"
],
"python.testing.autoTestDiscoverOnSaveEnabled": false, "python.testing.autoTestDiscoverOnSaveEnabled": false,
"python.testing.pytestArgs": ["tests"], "python.testing.pytestArgs": [
"tests"
],
"python.testing.pytestEnabled": true, "python.testing.pytestEnabled": true,
"python.testing.unittestEnabled": false, "python.testing.unittestEnabled": false,
"python.analysis.typeCheckingMode": "off", "python.analysis.typeCheckingMode": "off",
"python.linting.mypyEnabled": true, "python.linting.mypyEnabled": true,
"isort.path": ["${workspaceFolder}/.venv/bin/isort"], "isort.path": [
"${workspaceFolder}/.venv/bin/isort"
],
"search.mode": "reuseEditor", "search.mode": "reuseEditor",
"python.testing.unittestArgs": ["-v", "-s", "./tests", "-p", "test_*.py"], "python.testing.unittestArgs": [
"-v",
"-s",
"./tests",
"-p",
"test_*.py"
],
"explorer.fileNesting.enabled": true, "explorer.fileNesting.enabled": true,
"explorer.fileNesting.patterns": { "explorer.fileNesting.patterns": {
"package.json": "package-lock.json, yarn.lock, .eslintrc.js, tsconfig.json, .prettierrc, .editorconfig", "package.json": "package-lock.json, yarn.lock, .eslintrc.js, tsconfig.json, .prettierrc, .editorconfig",

View File

@ -40,6 +40,9 @@ def test_ldap_authentication_mocked(monkeypatch: MonkeyPatch):
assert scope == ldap.SCOPE_SUBTREE assert scope == ldap.SCOPE_SUBTREE
return [()] return [()]
def set_option(*args, **kwargs):
pass
def ldap_initialize_mock(url): def ldap_initialize_mock(url):
assert url == "" assert url == ""
return LdapConnMock() return LdapConnMock()