mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-11 15:28:59 +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:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Set up Python 3.10
|
- name: Set up Python 3.10
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: '3.10'
|
python-version: '3.10'
|
||||||
- name: Install Tools
|
- 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]
|
on: [push, pull_request, workflow_dispatch]
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
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:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Set up Python ${{ matrix.python-version }}
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
|
|||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -7,6 +7,10 @@ build/
|
|||||||
tags
|
tags
|
||||||
env
|
env
|
||||||
venv
|
venv
|
||||||
|
.venv
|
||||||
|
.venv*
|
||||||
|
.env
|
||||||
|
.env*
|
||||||
.pytest_cache
|
.pytest_cache
|
||||||
.mypy_cache
|
.mypy_cache
|
||||||
|
|
||||||
|
|||||||
4
pyproject.toml
vendored
4
pyproject.toml
vendored
@@ -11,11 +11,15 @@ license = 'GPL-3.0'
|
|||||||
requires-python = ">=3"
|
requires-python = ">=3"
|
||||||
classifiers = [
|
classifiers = [
|
||||||
'Development Status :: 5 - Production/Stable',
|
'Development Status :: 5 - Production/Stable',
|
||||||
|
'Programming Language :: Python :: 3.6',
|
||||||
'Programming Language :: Python :: 3.7',
|
'Programming Language :: Python :: 3.7',
|
||||||
'Programming Language :: Python :: 3.8',
|
'Programming Language :: Python :: 3.8',
|
||||||
'Programming Language :: Python :: 3.9',
|
'Programming Language :: Python :: 3.9',
|
||||||
'Programming Language :: Python :: 3.10',
|
'Programming Language :: Python :: 3.10',
|
||||||
'Programming Language :: Python :: 3.11',
|
'Programming Language :: Python :: 3.11',
|
||||||
|
'Programming Language :: Python :: 3.12',
|
||||||
|
'Programming Language :: Python :: 3.13',
|
||||||
|
'Programming Language :: Python :: 3.14',
|
||||||
]
|
]
|
||||||
keywords = ['dotfiles', 'jinja2']
|
keywords = ['dotfiles', 'jinja2']
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
|||||||
7
scripts/check-syntax.sh
vendored
7
scripts/check-syntax.sh
vendored
@@ -117,7 +117,12 @@ done
|
|||||||
# check other python scripts
|
# check other python scripts
|
||||||
echo "-----------------------------------------"
|
echo "-----------------------------------------"
|
||||||
echo "checking other python scripts with pylint"
|
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}"
|
echo "checking ${script}"
|
||||||
pylint -sn \
|
pylint -sn \
|
||||||
--disable=W0012 \
|
--disable=W0012 \
|
||||||
|
|||||||
76
tests.sh
vendored
76
tests.sh
vendored
@@ -5,25 +5,11 @@
|
|||||||
# stop on first error
|
# stop on first error
|
||||||
set -eu -o errtrace -o pipefail
|
set -eu -o errtrace -o pipefail
|
||||||
|
|
||||||
cur=$(cd "$(dirname "${0}")" && pwd)
|
MULTI_PYTHON="" # set to test multi python envs
|
||||||
in_cicd="${GITHUB_WORKFLOW:-}"
|
PYTHON_VERSIONS=("3.6" "3.7" "3.8" "3.9" "3.10" "3.11" "3.12" "3.13" "3.14")
|
||||||
|
|
||||||
if [ -n "${in_cicd}" ]; then
|
|
||||||
# patch TERM var in ci/cd
|
|
||||||
if [ -z "${TERM}" ]; then
|
|
||||||
export TERM="linux"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# make sure both version.py and manpage dotdrop.1 are in sync
|
|
||||||
dotdrop_version=$(grep version dotdrop/version.py | sed 's/^.*= .\(.*\).$/\1/g')
|
|
||||||
man_version=$(grep '^\.TH' manpage/dotdrop.1 | sed 's/^.*"dotdrop-\(.*\)\" "Save your.*$/\1/g')
|
|
||||||
if [ "${dotdrop_version}" != "${man_version}" ]; then
|
|
||||||
echo "ERROR version.py (${dotdrop_version}) and manpage (${man_version}) differ!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "current dotdrop version ${dotdrop_version}"
|
|
||||||
|
|
||||||
|
test()
|
||||||
|
{
|
||||||
echo "=> python version:"
|
echo "=> python version:"
|
||||||
python3 --version
|
python3 --version
|
||||||
|
|
||||||
@@ -49,6 +35,60 @@ else
|
|||||||
echo "tests-ng..."
|
echo "tests-ng..."
|
||||||
"${cur}"/scripts/check-tests-ng.sh
|
"${cur}"/scripts/check-tests-ng.sh
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
cur=$(cd "$(dirname "${0}")" && pwd)
|
||||||
|
in_cicd="${GITHUB_WORKFLOW:-}"
|
||||||
|
|
||||||
|
if [ -n "${in_cicd}" ]; then
|
||||||
|
# patch TERM var in ci/cd
|
||||||
|
if [ -z "${TERM}" ]; then
|
||||||
|
export TERM="linux"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# make sure both version.py and manpage dotdrop.1 are in sync
|
||||||
|
dotdrop_version=$(grep version dotdrop/version.py | sed 's/^.*= .\(.*\).$/\1/g')
|
||||||
|
man_version=$(grep '^\.TH' manpage/dotdrop.1 | sed 's/^.*"dotdrop-\(.*\)\" "Save your.*$/\1/g')
|
||||||
|
if [ "${dotdrop_version}" != "${man_version}" ]; then
|
||||||
|
echo "ERROR version.py (${dotdrop_version}) and manpage (${man_version}) differ!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "current dotdrop version ${dotdrop_version}"
|
||||||
|
|
||||||
|
if [ -n "${in_cicd}" ]; then
|
||||||
|
test
|
||||||
|
else
|
||||||
|
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
|
# merge coverage
|
||||||
coverage combine coverages/*
|
coverage combine coverages/*
|
||||||
|
|||||||
Reference in New Issue
Block a user