From 71fa65d0d9110216e1eccfc26ef3a4c5203c2390 Mon Sep 17 00:00:00 2001 From: David Glick Date: Wed, 5 Mar 2025 21:32:44 -0800 Subject: [PATCH] Try to fix uncommitted docs check --- .github/workflows/tests.yml | 70 +++++++++------------------------ MANIFEST.in | 2 + Makefile | 8 ++-- requirements.txt | 2 +- test-no-uncommitted-doc-changes | 6 +-- 5 files changed, 28 insertions(+), 60 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bd31daf00a..66455836b9 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,68 +1,38 @@ name: Tests -on: [push, pull_request] +on: + push: + branches: + - master + - main + pull_request: + branches: + - master + - main + workflow_dispatch: + jobs: build: - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: include: - - python-version: "3.8" - plone-version: "5.2" - - python-version: "3.9" - plone-version: "6.0" - - python-version: "3.10" - plone-version: "6.0" - - python-version: "3.11" - plone-version: "6.0" - - python-version: "3.12" - plone-version: "6.0" - - python-version: "3.10" - plone-version: "6.1" - - python-version: "3.11" - plone-version: "6.1" - - python-version: "3.12" - plone-version: "6.1" + - python-version: "3.13" + plone-version: "6.2" steps: # git checkout - uses: actions/checkout@v4 - # python setup + # Python setup - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} cache: "pip" - # buildout eggs cache - - uses: actions/cache@v3 - with: - path: eggs - key: ${{ runner.os }}-py${{ matrix.python-version }}-plone${{ matrix.plone-version }}-${{ hashFiles('*.cfg') }} - restore-keys: | - ${{ runner.os }}-py${{ matrix.python-version }}-plone${{ matrix.plone-version }}- - ${{ runner.os }}-py${{ matrix.python-version }}- - - # python install - - run: pip install virtualenv - - run: pip install wheel - - name: pip install - run: pip install -r requirements-${{ matrix.plone-version }}.txt - - # buildout - - name: buildout - run: if [ "${{ matrix.plone-version }}" == "6.0" ] && [ ${{ matrix.python-version }} == '3.8' ]; then buildout -t 10 -c plone-6.0.x-python3.8.cfg; else buildout -t 10 -c plone-${{ matrix.plone-version }}.x.cfg; fi; - env: - CI: true - - # build sphinx - - name: sphinx - run: if [ "${{ matrix.plone-version }}" == "6.0" ] && [ ${{ matrix.python-version }} == '3.12' ]; then make docs-html; fi - - # test - - name: test - run: bin/test + # Run tests + - name: Install dependencies + run: make test # test no uncommitted changes - name: test no uncommitted changes @@ -70,7 +40,3 @@ jobs: env: PYTHON_VERSION: ${{ matrix.python-version }} PLONE_VERSION: ${{ matrix.plone-version }} - - # test for broken links - - name: linkcheck - run: if [ "${{ matrix.plone-version }}" == "6.0" ] && [ ${{ matrix.python-version }} == '3.12' ]; then make docs-linkcheckbroken; fi diff --git a/MANIFEST.in b/MANIFEST.in index fdc4f8fb96..084aca6521 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -15,6 +15,8 @@ exclude Makefile exclude CODEOWNERS exclude docs/make.bat exclude .python-version +exclude constraints-mxdev.txt +exclude requirements-mxdev.txt recursive-exclude docs/doctrees * recursive-exclude docs/html * recursive-exclude performance * diff --git a/Makefile b/Makefile index 78f06ad35b..9080e139cb 100644 --- a/Makefile +++ b/Makefile @@ -97,8 +97,8 @@ instance/etc/zope.ini: $(BIN_FOLDER)/pipx ## Create instance configuration @echo "$(GREEN)==> Create instance configuration$(RESET)" $(BIN_FOLDER)/pipx run cookiecutter -f --no-input --config-file instance.yaml gh:plone/cookiecutter-zope-instance -$(BIN_FOLDER)/runwsgi: ## Install Plone - @echo "$(CREEN)==> Install Plone$(RESET)" +$(BIN_FOLDER)/runwsgi $(BIN_FOLDER)/zope-testrunner: ## Install Plone + @echo "$(GREEN)==> Install Plone$(RESET)" $(BIN_FOLDER)/mxdev -c mx.ini $(BIN_FOLDER)/pip install -r requirements-mxdev.txt @@ -114,8 +114,8 @@ check: $(BIN_FOLDER)/tox ## Check and fix code base according to Plone standards $(BIN_FOLDER)/tox -e lint .PHONY: test -test: $(BIN_FOLDER)/tox ## Run tests - $(BIN_FOLDER)/tox -e test +test: $(BIN_FOLDER)/zope-testrunner ## Run tests + $(BIN_FOLDER)/zope-testrunner --all --test-path=src -s plone.restapi ## Performance tests (need to be updated) diff --git a/requirements.txt b/requirements.txt index 328cba9480..b97d3bafb5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -c constraints.txt -Plone +plone.restapi[test] diff --git a/test-no-uncommitted-doc-changes b/test-no-uncommitted-doc-changes index b9dfab019a..60ed9f1a17 100755 --- a/test-no-uncommitted-doc-changes +++ b/test-no-uncommitted-doc-changes @@ -13,12 +13,12 @@ function red { echo "$RED $1 $RESET" } -if [ "$PLONE_VERSION" == "6.0" ] && [ "$PYTHON_VERSION" == '3.12' ]; then - echo "Running check for undocumented changes for Plone 6.0.x on Python 3.12" +if [ "$PLONE_VERSION" == "6.2" ] && [ "$PYTHON_VERSION" == '3.13' ]; then + echo "Running check for undocumented changes for Plone 6.2.x on Python 3.13" else # request/response dumps have known differences for different Python/Plone combinations # => skip, we can't have the Plone 5 build fail because of those - echo "Skipping checks for undocumented changes for everything except Plone 6.0.x on Python 3.12" + echo "Skipping checks for undocumented changes for everything except Plone 6.2.x on Python 3.13" echo "PLONE_VERSION=$PLONE_VERSION" echo "PYTHON_VERSION=$PYTHON_VERSION" exit 0