mirror of
https://github.com/Second-Hand-Friends/kleinanzeigen-bot.git
synced 2026-03-12 02:31:45 +01:00
use venv
This commit is contained in:
13
.github/workflows/build.yml
vendored
13
.github/workflows/build.yml
vendored
@@ -85,15 +85,11 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
- name: "Install Python and PDM" # https://github.com/pdm-project/setup-pdm
|
||||||
|
uses: pdm-project/setup-pdm@v3
|
||||||
with:
|
with:
|
||||||
python-version: "${{ matrix.PYTHON_VERSION }}"
|
python-version: "${{ matrix.PYTHON_VERSION }}"
|
||||||
|
cache: true
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: __pypackages__
|
|
||||||
key: ${{ runner.os }}-pypackages-${{ hashFiles('pdm.lock') }}
|
|
||||||
|
|
||||||
|
|
||||||
- name: "Install: Python dependencies"
|
- name: "Install: Python dependencies"
|
||||||
@@ -103,6 +99,9 @@ jobs:
|
|||||||
python --version
|
python --version
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install --upgrade pdm
|
pip install --upgrade pdm
|
||||||
|
if [[ ! -e .venv ]]; then
|
||||||
|
pdm venv create || true
|
||||||
|
fi
|
||||||
pdm install -v
|
pdm install -v
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -8,11 +8,11 @@ _LOCAL/
|
|||||||
/config.yaml
|
/config.yaml
|
||||||
/data
|
/data
|
||||||
/*.log
|
/*.log
|
||||||
kleinanzeigen_bot/_version.py
|
/src/kleinanzeigen_bot/_version.py
|
||||||
downloaded-ads
|
downloaded-ads
|
||||||
|
|
||||||
# python
|
# python
|
||||||
/__pypackages__
|
/.venv
|
||||||
__pycache__
|
__pycache__
|
||||||
/build
|
/build
|
||||||
/dist
|
/dist
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ RUN <<EOF
|
|||||||
git `# required by pdm to generate app version` \
|
git `# required by pdm to generate app version` \
|
||||||
|
|
||||||
# upgrade pip
|
# upgrade pip
|
||||||
python -m pip install --upgrade pip \
|
python -m pip install --upgrade pip
|
||||||
|
|
||||||
# install pdm
|
# install pdm
|
||||||
pip install pdm
|
pip install pdm
|
||||||
@@ -69,16 +69,14 @@ EOF
|
|||||||
|
|
||||||
ENV PATH="/opt/upx:${PATH}"
|
ENV PATH="/opt/upx:${PATH}"
|
||||||
|
|
||||||
COPY kleinanzeigen_bot /opt/app/kleinanzeigen_bot
|
COPY . /opt/app/
|
||||||
COPY .git /opt/app/.git
|
|
||||||
COPY README.md pdm.lock pyinstaller.spec pyproject.toml version.py /opt/app/
|
|
||||||
|
|
||||||
RUN <<EOF
|
RUN <<EOF
|
||||||
|
|
||||||
cd /opt/app
|
cd /opt/app
|
||||||
ls -la .
|
ls -la .
|
||||||
pdm install -v
|
pdm install -v
|
||||||
ls -la kleinanzeigen_bot
|
ls -la src/kleinanzeigen_bot
|
||||||
pdm run compile
|
pdm run compile
|
||||||
ls -l dist
|
ls -l dist
|
||||||
|
|
||||||
|
|||||||
2
pdm.lock
generated
2
pdm.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
groups = ["default", "dev"]
|
groups = ["default", "dev"]
|
||||||
strategy = ["cross_platform"]
|
strategy = ["cross_platform"]
|
||||||
lock_version = "4.4"
|
lock_version = "4.4.1"
|
||||||
content_hash = "sha256:710d12dd05635102f9a19f332ace367f6fbc903fe2f780a1fc017aca023e0e1f"
|
content_hash = "sha256:710d12dd05635102f9a19f332ace367f6fbc903fe2f780a1fc017aca023e0e1f"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ if platform != "darwin":
|
|||||||
|
|
||||||
# https://github.com/pyinstaller/pyinstaller/blob/f563dce1e83fd5ec72a20dffd2ac24be3e647150/PyInstaller/building/build_main.py#L320
|
# https://github.com/pyinstaller/pyinstaller/blob/f563dce1e83fd5ec72a20dffd2ac24be3e647150/PyInstaller/building/build_main.py#L320
|
||||||
analysis = Analysis(
|
analysis = Analysis(
|
||||||
['kleinanzeigen_bot/__main__.py'],
|
['src/kleinanzeigen_bot/__main__.py'],
|
||||||
# pathex = [],
|
# pathex = [],
|
||||||
# binaries = [],
|
# binaries = [],
|
||||||
datas = datas,
|
datas = datas,
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ app = "python -m kleinanzeigen_bot"
|
|||||||
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 = "autopep8 --recursive --in-place kleinanzeigen_bot tests --verbose"
|
format = "autopep8 --recursive --in-place kleinanzeigen_bot tests --verbose"
|
||||||
lint = {shell = "pylint -v kleinanzeigen_bot tests && autopep8 -v --exit-code --recursive --diff kleinanzeigen_bot tests && echo No issues found."}
|
lint = {shell = "pylint -v src tests && autopep8 -v --exit-code --recursive --diff src tests && echo No issues found."}
|
||||||
scan = "bandit -c pyproject.toml -r kleinanzeigen_bot"
|
scan = "bandit -c pyproject.toml -r kleinanzeigen_bot"
|
||||||
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'"
|
||||||
@@ -215,7 +215,7 @@ max-public-methods = 30 # maximum number of public methods for a class (R0904)
|
|||||||
#####################
|
#####################
|
||||||
[tool.pytest.ini_options]
|
[tool.pytest.ini_options]
|
||||||
# https://docs.pytest.org/en/stable/reference.html#confval-addopts
|
# https://docs.pytest.org/en/stable/reference.html#confval-addopts
|
||||||
addopts = "--strict-markers -p no:cacheprovider --doctest-modules --ignore=__pypackages__ --ignore=kleinanzeigen_bot/__main__.py"
|
addopts = "--strict-markers -p no:cacheprovider --doctest-modules --ignore=kleinanzeigen_bot/__main__.py"
|
||||||
markers = [
|
markers = [
|
||||||
"itest: marks a test as an integration test (i.e. a test with external dependencies)"
|
"itest: marks a test as an integration test (i.e. a test with external dependencies)"
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user