mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-04 09:51:45 +00:00
more python versions support
This commit is contained in:
2
.github/workflows/pypi-release.yml
vendored
2
.github/workflows/pypi-release.yml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python 3.10
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.10'
|
||||
- name: Install Tools
|
||||
|
||||
4
.github/workflows/testing.yml
vendored
4
.github/workflows/testing.yml
vendored
@@ -2,10 +2,10 @@ name: tests
|
||||
on: [push, pull_request, workflow_dispatch]
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
|
||||
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -7,6 +7,10 @@ build/
|
||||
tags
|
||||
env
|
||||
venv
|
||||
.venv
|
||||
.venv*
|
||||
.env
|
||||
.env*
|
||||
.pytest_cache
|
||||
.mypy_cache
|
||||
|
||||
|
||||
4
pyproject.toml
vendored
4
pyproject.toml
vendored
@@ -11,11 +11,15 @@ license = 'GPL-3.0'
|
||||
requires-python = ">=3"
|
||||
classifiers = [
|
||||
'Development Status :: 5 - Production/Stable',
|
||||
'Programming Language :: Python :: 3.6',
|
||||
'Programming Language :: Python :: 3.7',
|
||||
'Programming Language :: Python :: 3.8',
|
||||
'Programming Language :: Python :: 3.9',
|
||||
'Programming Language :: Python :: 3.10',
|
||||
'Programming Language :: Python :: 3.11',
|
||||
'Programming Language :: Python :: 3.12',
|
||||
'Programming Language :: Python :: 3.13',
|
||||
'Programming Language :: Python :: 3.14',
|
||||
]
|
||||
keywords = ['dotfiles', 'jinja2']
|
||||
dependencies = [
|
||||
|
||||
7
scripts/check-syntax.sh
vendored
7
scripts/check-syntax.sh
vendored
@@ -117,7 +117,12 @@ done
|
||||
# check other python scripts
|
||||
echo "-----------------------------------------"
|
||||
echo "checking other python scripts with pylint"
|
||||
find . -name "*.py" -not -path "./dotdrop/*" -not -regex "\./\.?v?env/.*" | while read -r script; do
|
||||
find . \
|
||||
-path "./dotdrop" -prune -o \
|
||||
-path "./.venv" -prune -o \
|
||||
-path "./venv" -prune -o \
|
||||
-path "./build" -prune -o \
|
||||
-name "*.py" -print | while read -r script; do
|
||||
echo "checking ${script}"
|
||||
pylint -sn \
|
||||
--disable=W0012 \
|
||||
|
||||
84
tests.sh
vendored
84
tests.sh
vendored
@@ -5,6 +5,38 @@
|
||||
# stop on first error
|
||||
set -eu -o errtrace -o pipefail
|
||||
|
||||
MULTI_PYTHON="" # set to test multi python envs
|
||||
PYTHON_VERSIONS=("3.6" "3.7" "3.8" "3.9" "3.10" "3.11" "3.12" "3.13" "3.14")
|
||||
|
||||
test()
|
||||
{
|
||||
echo "=> python version:"
|
||||
python3 --version
|
||||
|
||||
# test syntax
|
||||
echo "checking syntax..."
|
||||
"${cur}"/scripts/check-syntax.sh
|
||||
|
||||
# unittest
|
||||
echo "unittest..."
|
||||
"${cur}"/scripts/check-unittests.sh
|
||||
|
||||
# tests-ng
|
||||
if [ -n "${in_cicd}" ]; then
|
||||
# in CI/CD
|
||||
export DOTDROP_WORKERS=1
|
||||
echo "tests-ng with ${DOTDROP_WORKERS} worker(s)..."
|
||||
"${cur}"/scripts/check-tests-ng.sh
|
||||
|
||||
export DOTDROP_WORKERS=4
|
||||
echo "tests-ng with ${DOTDROP_WORKERS} worker(s)..."
|
||||
"${cur}"/scripts/check-tests-ng.sh
|
||||
else
|
||||
echo "tests-ng..."
|
||||
"${cur}"/scripts/check-tests-ng.sh
|
||||
fi
|
||||
}
|
||||
|
||||
cur=$(cd "$(dirname "${0}")" && pwd)
|
||||
in_cicd="${GITHUB_WORKFLOW:-}"
|
||||
|
||||
@@ -24,32 +56,40 @@ if [ "${dotdrop_version}" != "${man_version}" ]; then
|
||||
fi
|
||||
echo "current dotdrop version ${dotdrop_version}"
|
||||
|
||||
echo "=> python version:"
|
||||
python3 --version
|
||||
|
||||
# test syntax
|
||||
echo "checking syntax..."
|
||||
"${cur}"/scripts/check-syntax.sh
|
||||
|
||||
# unittest
|
||||
echo "unittest..."
|
||||
"${cur}"/scripts/check-unittests.sh
|
||||
|
||||
# tests-ng
|
||||
if [ -n "${in_cicd}" ]; then
|
||||
# in CI/CD
|
||||
export DOTDROP_WORKERS=1
|
||||
echo "tests-ng with ${DOTDROP_WORKERS} worker(s)..."
|
||||
"${cur}"/scripts/check-tests-ng.sh
|
||||
|
||||
export DOTDROP_WORKERS=4
|
||||
echo "tests-ng with ${DOTDROP_WORKERS} worker(s)..."
|
||||
"${cur}"/scripts/check-tests-ng.sh
|
||||
test
|
||||
else
|
||||
echo "tests-ng..."
|
||||
"${cur}"/scripts/check-tests-ng.sh
|
||||
if [ -n "${MULTI_PYTHON}" ]; then
|
||||
if ! hash pyenv &>/dev/null; then
|
||||
echo "install pyenv"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
eval "$(pyenv init -)"
|
||||
for PY in "${PYTHON_VERSIONS[@]}"; do
|
||||
echo "============== python ${PY} =============="
|
||||
pyenv install -s "${PY}"
|
||||
pyenv shell "${PY}"
|
||||
python -m venv ".venv"
|
||||
source ".venv/bin/activate"
|
||||
pip install pip --upgrade
|
||||
pip install -r requirements.txt
|
||||
pip install -r tests-requirements.txt
|
||||
test
|
||||
deactivate
|
||||
done
|
||||
else
|
||||
python3 -m venv ".venv"
|
||||
source ".venv/bin/activate"
|
||||
pip install pip --upgrade
|
||||
pip install -r requirements.txt
|
||||
pip install -r tests-requirements.txt
|
||||
test
|
||||
deactivate
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# merge coverage
|
||||
coverage combine coverages/*
|
||||
coverage xml
|
||||
|
||||
Reference in New Issue
Block a user