Skip to content

Commit

Permalink
Merge pull request #538 from plone/mrtango-fix-build
Browse files Browse the repository at this point in the history
fix CI
  • Loading branch information
MrTango authored Jan 20, 2023
2 parents b81430a + ab4b062 commit 41dbec9
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 39 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.9", "3.10"]

steps:
- uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: '3.10'
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
Expand All @@ -36,8 +36,8 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 tox tox-gh-actions
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install tox-gh-actions>=3.0.0
pip install -e .
- name: Black-Check
run: |
Expand Down
4 changes: 3 additions & 1 deletion bobtemplates/plone/addon/constraints_plone52.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@
# zc.buildout==2.13.2

isort>=5
black==21.6b0
black==22.8.0
tox==4.3.5
flake8==5.0.4
5 changes: 2 additions & 3 deletions bobtemplates/plone/addon/constraints_plone60.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
#
## SSL Certs on windows, because Python is missing them otherwise:
#certifi ; platform_system == 'Windows'

tox==4.3.5
isort>=5
black==22.8.0
flake8>=5.0.4
flake8-html>=0.4.2
flake8==5.0.4
19 changes: 9 additions & 10 deletions bobtemplates/plone/addon/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ setenv =

deps =
Plone52: -rrequirements_plone52.txt
Plone52: -cconstraints_plone52.txt
# Plone52: -cconstraints_plone52.txt
Plone60: -rrequirements_plone60.txt
Plone60: -cconstraints_plone60.txt
# Plone60: -cconstraints_plone60.txt
coverage


Expand Down Expand Up @@ -84,9 +84,9 @@ deps =
isort
flake8
# helper to generate HTML reports:
flake8-html>=0.4.2
# flake8-html>=0.4.3
# Useful flake8 plugins that are Python and Plone specific:
flake8-coding
; flake8-coding
flake8-debugger
flake8-deprecated
flake8-print
Expand All @@ -107,12 +107,11 @@ deps =

commands =
mkdir -p {toxinidir}/reports/flake8
- flake8 --format=html --htmldir={toxinidir}/reports/flake8 --doctests {toxinidir}/src {toxinidir}/setup.py
flake8 --doctests {toxinidir}/src {toxinidir}/setup.py
isort --check-only {toxinidir}/src {toxinidir}/setup.py
# black --check --diff -v {toxinidir}/src {toxinidir}/setup.py

whitelist_externals =
allowlist_externals =
mkdir


Expand Down Expand Up @@ -154,28 +153,28 @@ basepython = python3.7
skip_install = true
deps = {[lint]deps}
commands = {[lint]commands}
whitelist_externals = {[lint]whitelist_externals}
allowlist_externals = {[lint]allowlist_externals}

[testenv:py38-lint]
basepython = python3.8
skip_install = true
deps = {[lint]deps}
commands = {[lint]commands}
whitelist_externals = {[lint]whitelist_externals}
allowlist_externals = {[lint]allowlist_externals}

[testenv:py39-lint]
basepython = python3.9
skip_install = true
deps = {[lint]deps}
commands = {[lint]commands}
whitelist_externals = {[lint]whitelist_externals}
allowlist_externals = {[lint]allowlist_externals}

[testenv:py310-lint]
basepython = python3.10
skip_install = true
deps = {[lint]deps}
commands = {[lint]commands}
whitelist_externals = {[lint]whitelist_externals}
allowlist_externals = {[lint]allowlist_externals}

[testenv:docs]
skip_install = true
Expand Down
6 changes: 3 additions & 3 deletions constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# -----------------------------------------------
# Pin Versions / Version Ranges if necessary.
setuptools==57.0.0
tox>=3.6
tox==4.3.5
isort>=5
flake8>=5.0.4
flake8-html>=0.4.2
flake8==5.0.4
flake8-html==0.4.2
black==22.8.0
pytest>=4.3.0
coverage>=5.2.0
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-cconstraints.txt
setuptools
Sphinx
flake8
tox
10 changes: 10 additions & 0 deletions skeleton-tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ def file_exists(base_path, file_path):


def run_skeleton_tox_env(wd, config):
logger.info("show_versions: python / tox")
print("show_versions: python / tox")
subprocess.check_call(
["python", "--version"],
cwd=wd,
)
subprocess.check_call(
["tox", "--version"],
cwd=wd,
)
try:
returncode = subprocess.check_call(
["tox", "-e", config.skeleton_tox_env, "-p", "auto", "-o", "-v", "-r"],
Expand Down
38 changes: 19 additions & 19 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ commands =
setenv =
COVERAGE_FILE=.coverage.{envname}
Plone52: VERSION=5.2-latest
Plone60: VERSION=6.0-dev
Plone60: VERSION=6.0-latest
ENVNAME={envname}

passenv =
Expand All @@ -59,12 +59,12 @@ deps =
pytest-mock
pytest-html

whitelist_externals =
allowlist_externals =
mkdir

depends =
{py39}: coverage-clean
coverage-report: py39
{py310}: coverage-clean
coverage-report: py310


[testenv:coverage-report]
Expand Down Expand Up @@ -93,7 +93,7 @@ skip_install = true
commands = coverage erase

[testenv:isort-apply]
basepython = python3.9
basepython = python3.10
deps =
-cconstraints.txt
isort
Expand All @@ -120,55 +120,55 @@ deps =
-cconstraints.txt
flake8
# helper to generate HTML reports:
flake8-html
; flake8-html
# Useful flake8 plugins that are Python and Plone specific:
isort
flake8-blind-except
flake8-coding
flake8-commas
; flake8-coding
; flake8-commas
flake8-debugger
flake8-deprecated
flake8-pep3101
flake8-plone-api
flake8-plone-hasattr
flake8-print
flake8-quotes
flake8-string-format
; flake8-quotes
; flake8-string-format
flake8-todo
; flake8_strict

commands =
mkdir -p {toxinidir}/_build/reports/flake8
isort --check-only {toxinidir}/bobtemplates {toxinidir}/package_tests {toxinidir}/skeleton-tests setup.py
- flake8 --format=html --htmldir={toxinidir}/_build/reports/flake8 --doctests {toxinidir}/bobtemplates {toxinidir}/package_tests {toxinidir}/skeleton-tests setup.py
- flake8 --doctests {toxinidir}/bobtemplates {toxinidir}/package_tests {toxinidir}/skeleton-tests setup.py
flake8 {toxinidir}/bobtemplates {toxinidir}/package_tests {toxinidir}/skeleton-tests setup.py --doctests

whitelist_externals =
allowlist_externals =
mkdir

[testenv:py38-lint]
basepython = python3.8
skip_install = true
deps = {[lint]deps}
commands = {[lint]commands}
whitelist_externals = {[lint]whitelist_externals}
allowlist_externals = {[lint]allowlist_externals}

[testenv:py39-lint]
basepython = python3.9
skip_install = true
deps = {[lint]deps}
commands = {[lint]commands}
whitelist_externals = {[lint]whitelist_externals}
allowlist_externals = {[lint]allowlist_externals}

[testenv:py310-lint]
basepython = python3.10
skip_install = true
deps = {[lint]deps}
commands = {[lint]commands}
whitelist_externals = {[lint]whitelist_externals}
allowlist_externals = {[lint]allowlist_externals}

[testenv:black-check]
basepython = python3.9
basepython = python3.10
skip_install = True
deps =
-cconstraints.txt
Expand All @@ -178,7 +178,7 @@ commands =
black --check --diff -v bobtemplates setup.py skeleton-tests package_tests

[testenv:black-enforce]
basepython = python3.9
basepython = python3.10
skip_install = True
deps =
-cconstraints.txt
Expand All @@ -188,7 +188,7 @@ commands =
black -v bobtemplates setup.py skeleton-tests package_tests

[testenv:docs]
basepython = python3.9
basepython = python3.10
commands =
sphinx-build -b html -d _build/docs/doctrees docs _build/docs/html -W
# sphinx-build -b doctest docs _build/docs/doctrees
Expand All @@ -199,7 +199,7 @@ deps =

[testenv:release]
skip_install = true
basepython = python3.9
basepython = python3.10

deps =
-cconstraints.txt
Expand Down

0 comments on commit 41dbec9

Please sign in to comment.