From 83c0d6adf03b779cba20dcb5a7882157a68b951d Mon Sep 17 00:00:00 2001 From: sebthom Date: Thu, 15 May 2025 19:52:41 +0200 Subject: [PATCH] refact: move temp files to /.temp/ --- .github/workflows/build.yml | 3 ++- .gitignore | 8 +------- pyproject.toml | 15 ++++++++++----- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e073222..03e3551 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -100,6 +100,7 @@ jobs: - name: Git Checkout uses: actions/checkout@v4 # https://github.com/actions/checkout + - name: "Install: Chromium Browser" if: env.ACT == 'true' && startsWith(matrix.os, 'ubuntu') run: | @@ -153,7 +154,7 @@ jobs: - name: Run unit tests - run: pdm run utest:cov -vv --cov=src/kleinanzeigen_bot + run: pdm run utest:cov -vv - name: Run integration tests diff --git a/.gitignore b/.gitignore index 55deff7..733c755 100644 --- a/.gitignore +++ b/.gitignore @@ -14,19 +14,13 @@ downloaded-ads # python /.venv __pycache__ -/build /dist +/.temp /.eggs /*.egg-info -/.mypy_cache /.pdm-build/ /.pdm-python -/.ruff_cache -# test coverage -/.coverage -/htmlcov/ -/coverage.xml # Eclipse /.project diff --git a/pyproject.toml b/pyproject.toml index 85e0473..fd8cb30 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,7 +89,7 @@ debug = "python -m pdb -m kleinanzeigen_bot" # build & packaging generate-schemas = "python scripts/generate_schemas.py" -compile.cmd = "python -O -m PyInstaller pyinstaller.spec --clean" +compile.cmd = "python -O -m PyInstaller pyinstaller.spec --clean --workpath .temp" compile.env = {PYTHONHASHSEED = "1", SOURCE_DATE_EPOCH = "0"} # https://pyinstaller.org/en/stable/advanced-topics.html#creating-a-reproducible-build deps = "pdm list --fields name,version,groups" @@ -112,9 +112,9 @@ lint = { composite = ["lint:ruff", "lint:mypy", "lint:pyright"] } test = "python -m pytest --capture=tee-sys" utest = "python -m pytest --capture=tee-sys -m 'not itest'" itest = "python -m pytest --capture=tee-sys -m 'itest'" -"test:cov" = { composite = ["test --cov=src/kleinanzeigen_bot"] } -"utest:cov" = { composite = ["utest --cov=src/kleinanzeigen_bot"] } -"itest:cov" = { composite = ["itest --cov=src/kleinanzeigen_bot"] } +"test:cov" = { composite = ["utest:cov", "itest:cov"] } +"utest:cov" = { composite = ["utest --cov=src/kleinanzeigen_bot --cov-report=xml:.temp/coverage-unit.xml"] } +"itest:cov" = { composite = ["itest --cov=src/kleinanzeigen_bot --cov-report=xml:.temp/coverage-integration.xml"] } ##################### @@ -140,6 +140,7 @@ aggressive = 3 # https://docs.astral.sh/ruff/configuration/ ##################### [tool.ruff] +cache-dir = ".temp/cache_ruff" include = ["pyproject.toml", "scripts/**/*.py", "src/**/*.py", "tests/**/*.py"] line-length = 160 indent-width = 4 @@ -282,6 +283,7 @@ max-public-methods = 25 # max. number of public methods for a class (R0904) [tool.mypy] # https://mypy.readthedocs.io/en/stable/config_file.html #mypy_path = "$MYPY_CONFIG_FILE_DIR/tests/stubs" +cache_dir = ".temp/cache_mypy" python_version = "3.10" files = "scripts,src,tests" strict = true @@ -311,6 +313,7 @@ typeCheckingMode = "standard" # https://pypi.org/project/pytest/ ##################### [tool.pytest.ini_options] +cache_dir = ".temp/cache_pytest" testpaths = [ "src", "tests" @@ -318,7 +321,6 @@ testpaths = [ # https://docs.pytest.org/en/stable/reference.html#confval-addopts addopts = """ --strict-markers - -p no:cacheprovider --doctest-modules --cov-report=term-missing """ @@ -333,6 +335,9 @@ filterwarnings = [ "ignore::DeprecationWarning" ] +[tool.coverage.run] +data_file = ".temp/coverage.sqlite" + ##################### # yamlfix