chore: update pyproject.toml

This commit is contained in:
sebthom
2025-05-12 14:08:50 +02:00
parent ed83052fa4
commit f2e6f0b20b
3 changed files with 15 additions and 7 deletions

View File

@@ -153,7 +153,7 @@ jobs:
- name: Run unit tests - name: Run unit tests
run: pdm run utest run: pdm run utest:cov --cov=src/kleinanzeigen_bot
- name: Run integration tests - name: Run integration tests
@@ -163,9 +163,9 @@ jobs:
case "${{ matrix.os }}" in case "${{ matrix.os }}" in
ubuntu-*) ubuntu-*)
sudo apt-get install --no-install-recommends -y xvfb sudo apt-get install --no-install-recommends -y xvfb
xvfb-run pdm run itest xvfb-run pdm run itest:cov
;; ;;
*) pdm run itest *) pdm run itest:cov
;; ;;
esac esac

View File

@@ -420,10 +420,11 @@ By default a new browser process will be launched. To reuse a manually launched
- Format source code: `pdm run format` - Format source code: `pdm run format`
- Run tests: - Run tests:
- unit tests: `pdm run utest` - unit tests: `pdm run utest` - with coverage: `pdm run utest:cov`
- integration tests: `pdm run itest` - integration tests: `pdm run itest` - with coverage: `pdm run itest:cov`
- all tests: `pdm run test` - all tests: `pdm run test` - with coverage: `pdm run test:cov`
- Run syntax checks: `pdm run lint` - Run syntax checks: `pdm run lint`
- Linting issues found by ruff can be auto-fixed using `pdm run lint:fix`
- Create platform-specific executable: `pdm run compile` - Create platform-specific executable: `pdm run compile`
- Application bootstrap works like this: - Application bootstrap works like this:
```python ```python

View File

@@ -70,6 +70,7 @@ Homepage = "https://github.com/Second-Hand-Friends/kleinanzeigen-bot"
Repository = "https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git" Repository = "https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git"
Documentation = "https://github.com/Second-Hand-Friends/kleinanzeigen-bot/README.md" Documentation = "https://github.com/Second-Hand-Friends/kleinanzeigen-bot/README.md"
Issues = "https://github.com/Second-Hand-Friends/kleinanzeigen-bot/issues" Issues = "https://github.com/Second-Hand-Friends/kleinanzeigen-bot/issues"
CI = "https://github.com/Second-Hand-Friends/kleinanzeigen-bot/actions"
##################### #####################
@@ -85,9 +86,12 @@ write_template = "__version__ = '{}'\n"
app = "python -m kleinanzeigen_bot" app = "python -m kleinanzeigen_bot"
debug = "python -m pdb -m kleinanzeigen_bot" 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"
compile.env = {PYTHONHASHSEED = "1", SOURCE_DATE_EPOCH = "0"} # https://pyinstaller.org/en/stable/advanced-topics.html#creating-a-reproducible-build compile.env = {PYTHONHASHSEED = "1", SOURCE_DATE_EPOCH = "0"} # https://pyinstaller.org/en/stable/advanced-topics.html#creating-a-reproducible-build
# format & lint
format = { composite = ["format:py", "format:yaml"] } format = { composite = ["format:py", "format:yaml"] }
"format:py" = { shell = "autopep8 --recursive --in-place scripts src tests --verbose && python scripts/post_autopep8.py scripts src tests" } "format:py" = { shell = "autopep8 --recursive --in-place scripts src tests --verbose && python scripts/post_autopep8.py scripts src tests" }
"format:yaml" = "yamlfix scripts/ src/ tests/" "format:yaml" = "yamlfix scripts/ src/ tests/"
@@ -98,9 +102,13 @@ lint = { composite = ["lint:ruff", "lint:mypy", "lint:pyright"] }
"lint:pyright" = "basedpyright" "lint:pyright" = "basedpyright"
"lint:fix" = {shell = "ruff check --preview --fix" } "lint:fix" = {shell = "ruff check --preview --fix" }
# tests
test = "python -m pytest --capture=tee-sys -v" test = "python -m pytest --capture=tee-sys -v"
utest = "python -m pytest --capture=tee-sys -v -m 'not itest'" utest = "python -m pytest --capture=tee-sys -v -m 'not itest'"
itest = "python -m pytest --capture=tee-sys -v -m 'itest'" itest = "python -m pytest --capture=tee-sys -v -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"] }
##################### #####################
@@ -303,7 +311,6 @@ addopts = """
--strict-markers --strict-markers
-p no:cacheprovider -p no:cacheprovider
--doctest-modules --doctest-modules
--cov=src/kleinanzeigen_bot
--cov-report=term-missing --cov-report=term-missing
""" """
markers = [ markers = [