diff --git a/config/README.rst b/config/README.rst index 436f2b7..b3e4723 100644 --- a/config/README.rst +++ b/config/README.rst @@ -157,9 +157,6 @@ The following options are only needed one time as their values are stored in Define the configuration type (see `Types`_ section above) to be used for the repository. ---with-appveyor - Enable running the tests on AppVeyor, too. - --with-macos Enable running the tests on macOS on GitHub Actions. @@ -204,7 +201,6 @@ updated. Example: commit-id = "< commit-hash >" [python] - with-appveyor = false with-pypy = false with-docs = true with-sphinx-doctests = false @@ -328,36 +324,6 @@ updated. Example: "tox -f ${{ matrix.config[1] }}", ] - [appveyor] - global-env-vars = [ - "ZOPE_INTERFACE_STRICT_IRO: 1", - ] - additional-matrix = [ - "- { PYTHON: 38, PURE_PYTHON: 1 }", - "- { PYTHON: 38-x64, PURE_PYTHON: 1 }", - ] - install-steps = [ - "- pip install zc.buildout", - "- buildout", - ] - build-script = [ - "- python -W ignore setup.py -q bdist_wheel", - ] - test-steps = [ - "- zope-testrunner --test-path=src", - "- jasmine", - ] - additional-lines = [ - "artifacts:", - " - path: 'dist\*.whl'", - " name: wheel", - ] - replacement = [ - "environment:", - " matrix:", - " ...", - ] - [c-code] manylinux-install-setup = [ "export CFLAGS=\"-pipe\"", @@ -402,9 +368,6 @@ commit-id Python options `````````````` -with-appveyor - Run the tests also on AppVeyor: true/false - with-macos Run the tests also on macOS on GitHub Actions: true/false, default: false @@ -636,46 +599,6 @@ test-commands This option has to be a list of strings. -AppVeyor options -```````````````` - -The corresponding section is named: ``[appveyor]``. - -global-env-vars - Environment variables to specify globally. This option has to be a list of - strings. - -additional-matrix - Additional environment matrix rows. This option has to be a list of strings, - each starting with a ``-`` (unless you know what you're doing). - -install-steps - Steps to install the package under test on AppVeyor. This option has to be a - list of strings. It defaults to ``["- pip install -U -e .[test]"]``. - -build-script - Steps to to build the project. If this option is not given because no - additional build steps are necessary ``build: false`` is rendered to the - AppVeyor configuration. But if the config type is ``c-code`` it defaults to - ``['- python -W ignore setup.py -q bdist_wheel']``. This option has to be a - list of strings, each one starting with a ``-``. - -test-steps - Steps to run the tests on AppVeyor. This option has to be a list of strings - , each one starting with a ``-``. It defaults to - ``["- zope-testrunner --test-path=src"]``. - -additional-lines - This option allows to add arbitrary additional lines to the end of the - configuration file. It has to be a list of strings. - -replacement - Replace the whole template of the AppVeyor configuration with the contents of - this option. Use this option as last resort if your needed changes are too - big to configure AppVeyor in another way. This option has to be a list of - strings. - - C-code options `````````````` diff --git a/config/buildout-recipe/packages.txt b/config/buildout-recipe/packages.txt index 18a73f4..a327657 100644 --- a/config/buildout-recipe/packages.txt +++ b/config/buildout-recipe/packages.txt @@ -9,7 +9,6 @@ z3c.recipe.i18n zc.recipe.cmmi zdaemon zc.recipe.filestorage -five.customerize z3c.recipe.compattest zc.relation zc.zodbrecipes diff --git a/config/c-code/appveyor-publish.j2 b/config/c-code/appveyor-publish.j2 deleted file mode 100644 index b5b2113..0000000 --- a/config/c-code/appveyor-publish.j2 +++ /dev/null @@ -1,8 +0,0 @@ -artifacts: - - path: 'dist\*.whl' - name: wheel - -deploy_script: - - ps: if ($env:APPVEYOR_REPO_TAG -eq $TRUE) { pip install twine; twine upload --skip-existing dist\*.whl } - -deploy: on diff --git a/config/c-code/tests-cache.j2 b/config/c-code/tests-cache.j2 index bbb0410..f19b1d2 100644 --- a/config/c-code/tests-cache.j2 +++ b/config/c-code/tests-cache.j2 @@ -10,15 +10,32 @@ # to save the cache. So it must come before the thing we want to use # the cache. ### - - name: Get pip cache dir - id: pip-cache + - name: Get pip cache dir (default) + id: pip-cache-default + if: ${{ !startsWith(runner.os, 'Windows') }} run: | echo "dir=$(pip cache dir)" >>$GITHUB_OUTPUT - - name: pip cache + - name: Get pip cache dir (Windows) + id: pip-cache-windows + if: ${{ startsWith(runner.os, 'Windows') }} + run: | + echo "dir=$(pip cache dir)" >> $Env:GITHUB_OUTPUT + + - name: pip cache (default) + uses: actions/cache@v4 + if: ${{ !startsWith(runner.os, 'Windows') }} + with: + path: ${{ steps.pip-cache-default.outputs.dir }} + key: %(cache_key)s + restore-keys: | + ${{ runner.os }}-pip- + + - name: pip cache (Windows) uses: actions/cache@v4 + if: ${{ startsWith(runner.os, 'Windows') }} with: - path: ${{ steps.pip-cache.outputs.dir }} + path: ${{ steps.pip-cache-windows.outputs.dir }} key: %(cache_key)s restore-keys: | ${{ runner.os }}-pip- diff --git a/config/c-code/tests-strategy.j2 b/config/c-code/tests-strategy.j2 index 8885aed..2a15505 100644 --- a/config/c-code/tests-strategy.j2 +++ b/config/c-code/tests-strategy.j2 @@ -14,7 +14,11 @@ {% if with_future_python %} - "%(future_python_version)s" {% endif %} +{% if with_windows %} + os: [ubuntu-20.04, macos-11, windows-latest] +{% else %} os: [ubuntu-20.04, macos-11] +{% endif %} {% if with_pypy or gha_additional_exclude %} exclude: {% endif %} diff --git a/config/c-code/tests.yml.j2 b/config/c-code/tests.yml.j2 index 2ada6bc..6d69525 100644 --- a/config/c-code/tests.yml.j2 +++ b/config/c-code/tests.yml.j2 @@ -97,8 +97,10 @@ jobs: {% include 'tests-cache.j2' %} {% if with_future_python %} - - name: Install Build Dependencies (%(future_python_version)s) - if: matrix.python-version == '%(future_python_version)s' + - name: Install Build Dependencies (%(future_python_version)s) - no Windows + if: > + matrix.python-version == '%(future_python_version)s' + && !startsWith(runner.os, 'Windows') run: | pip install -U pip pip install -U setuptools wheel twine @@ -106,6 +108,18 @@ jobs: # or even RC release, see https://github.com/python-cffi/cffi/issues/23 echo "cffi @ git+https://github.com/python-cffi/cffi.git@954cab4f889fb019a7f90df153ee1be501495f58" > cffi_constraint.txt PIP_CONSTRAINT=$PWD/cffi_constraint.txt pip install cffi + - name: Install Build Dependencies (%(future_python_version)s) - on Windows + if: > + matrix.python-version == '%(future_python_version)s' + && startsWith(runner.os, 'Windows') + run: | + # cffi will probably have no public release until a Python 3.13 beta + # or even RC release, see https://github.com/python-cffi/cffi/issues/23 + echo "cffi @ git+https://github.com/python-cffi/cffi.git@954cab4f889fb019a7f90df153ee1be501495f58" > cffi_constraint.txt + set PIP_CONSTRAINT=%cd%\cffi_constraint.txt + pip install cffi + pip install -U pip + pip install -U setuptools wheel twine {% endif %} - name: Install Build Dependencies {% if with_future_python %} @@ -162,8 +176,10 @@ jobs: {% endfor %} {% if with_future_python %} - - name: Install %(package_name)s and dependencies (%(future_python_version)s) - if: matrix.python-version == '%(future_python_version)s' + - name: Install %(package_name)s and dependencies (%(future_python_version)s) - no Windows + if: > + matrix.python-version == '%(future_python_version)s' + && !startsWith(runner.os, 'Windows') run: | # Install to collect dependencies into the (pip) cache. # cffi will probably have no public release until a Python 3.13 beta @@ -172,6 +188,19 @@ jobs: # Use "--pre" here because dependencies with support for this future # Python release may only be available as pre-releases PIP_CONSTRAINT=$PWD/cffi_constraint.txt pip install --pre .[test] + - name: Install %(package_name)s and dependencies (%(future_python_version)s) - on Windows + if: > + matrix.python-version == '%(future_python_version)s' + && startsWith(runner.os, 'Windows') + run: | + # Install to collect dependencies into the (pip) cache. + # cffi will probably have no public release until a Python 3.13 beta + # or even RC release, see https://github.com/python-cffi/cffi/issues/23 + echo "cffi @ git+https://github.com/python-cffi/cffi.git@954cab4f889fb019a7f90df153ee1be501495f58" > cffi_constraint.txt + # Use "--pre" here because dependencies with support for this future + # Python release may only be available as pre-releases + set PIP_CONSTRAINT=%cd%\cffi_constraint.txt + pip install --pre .[test] {% endif %} - name: Install %(package_name)s and dependencies {% if with_future_python %} @@ -254,8 +283,10 @@ jobs: {% endfor %} {% else %} {% if with_future_python %} - - name: Install %(package_name)s %(future_python_version)s - if: ${{ startsWith(matrix.python-version, '%(future_python_version)s') }} + - name: Install %(package_name)s %(future_python_version)s ${{ matrix.python-version }}- no Windows + if: > + matrix.python-version == '%(future_python_version)s' + && !startsWith(runner.os, 'Windows') run: | pip install -U wheel setuptools # cffi will probably have no public release until a beta or even RC @@ -271,6 +302,26 @@ jobs: # Use "--pre" here because dependencies with support for this future # Python release may only be available as pre-releases PIP_CONSTRAINT=$PWD/cffi_constraint.txt pip install --pre -U -e .[test] + - name: Install %(package_name)s %(future_python_version)s - on Windows + if: > + matrix.python-version == '%(future_python_version)s' + && startsWith(runner.os, 'Windows') + run: | + pip install -U wheel setuptools + # cffi will probably have no public release until a beta or even RC + # version of Python 3.13, see https://github.com/python-cffi/cffi/issues/23 + echo 'cffi @ git+https://github.com/python-cffi/cffi.git@954cab4f889fb019a7f90df153ee1be501495f58 ; platform_python_implementation == "CPython"' > cffi_constraint.txt + # coverage has a wheel on PyPI for a future python version which is + # not ABI compatible with the current one, so build it from sdist: + pip install -U --no-binary :all: coverage + # Unzip into src/ so that testrunner can find the .so files + # when we ask it to load tests from that directory. This + # might also save some build time? + unzip -n dist/%(package_name)s-*whl -d src + # Use "--pre" here because dependencies with support for this future + # Python release may only be available as pre-releases + set PIP_CONSTRAINT=%cd%\cffi_constraint.txt + pip install --pre -U -e .[test] {% endif %} - name: Install %(package_name)s {% if with_future_python %} @@ -299,12 +350,14 @@ jobs: run: {% if gha_test_commands %} {% for line in gha_test_commands %} - PURE_PYTHON=1 %(line)s + %(line)s {% endfor %} {% else %} # coverage makes PyPy run about 3x slower! - PURE_PYTHON=1 python -m coverage run -p -m zope.testrunner --test-path=src --auto-color --auto-progress + python -m coverage run -p -m zope.testrunner --test-path=src --auto-color --auto-progress {% endif %} + env: + PURE_PYTHON: 1 - name: Report Coverage run: | coverage combine @@ -423,7 +476,7 @@ jobs: path: wheelhouse/*whl name: manylinux_${{ matrix.image }}_wheels.zip - name: Restore pip cache permissions - run: sudo chown -R $(whoami) ${{ steps.pip-cache.outputs.dir }} + run: sudo chown -R $(whoami) ${{ steps.pip-cache-default.outputs.dir }} - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 if: > diff --git a/config/config-package.py b/config/config-package.py index e28ebaa..3251e97 100755 --- a/config/config-package.py +++ b/config/config-package.py @@ -68,13 +68,6 @@ def handle_command_line_arguments(): action='store_false', default=True, help='Do not include flake8 and isort in the linting configuration.') - parser.add_argument( - '--with-appveyor', - dest='with_appveyor', - action='store_true', - default=False, - help='Activate running tests on AppVeyor, too, ' - 'if not already configured in .meta.toml.') parser.add_argument( '--with-macos', dest='with_macos', @@ -185,10 +178,6 @@ def _read_meta_configuration(self): if self.args.with_docs is None: self.args.with_docs = (self.path / "docs" / "conf.py").exists() print(f"Autodetecting --with-docs: {self.args.with_docs}") - if self.args.with_appveyor is None: - value = (self.path / "appveyor.yml").exists() - self.args.with_appveyor = value - print(f"Autodetecting --with-appveyor: {value}") return meta_cfg @cached_property @@ -220,10 +209,6 @@ def jinja_env(self): lstrip_blocks=True, ) - @cached_property - def with_appveyor(self): - return self._set_python_config_value('appveyor') - @cached_property def with_macos(self): return self._set_python_config_value('macos') @@ -530,38 +515,7 @@ def manifest_in(self): self.copy_with_meta( 'MANIFEST.in.j2', self.path / 'MANIFEST.in', self.config_type, additional_rules=additional_manifest_rules, - with_docs=self.with_docs, with_appveyor=self.with_appveyor) - - def appveyor(self): - appveyor_global_env_vars = self.meta_cfg['appveyor'].get( - 'global-env-vars', []) - appveyor_additional_matrix = self.meta_cfg['appveyor'].get( - 'additional-matrix', []) - appveyor_install_steps = self.meta_cfg['appveyor'].get( - 'install-steps', ['- pip install -U -e .[test]']) - appveyor_build_script = self.meta_cfg['appveyor'].get( - 'build-script', []) - if self.config_type == 'c-code' and not appveyor_build_script: - appveyor_build_script = [ - '- python -W ignore setup.py -q bdist_wheel'] - appveyor_test_steps = self.meta_cfg['appveyor'].get( - 'test-steps', ['- zope-testrunner --test-path=src']) - appveyor_additional_lines = self.meta_cfg['appveyor'].get( - 'additional-lines', []) - appveyor_replacement = self.meta_cfg['appveyor'].get('replacement', []) - self.copy_with_meta( - 'appveyor.yml.j2', - self.path / 'appveyor.yml', - self.config_type, - with_future_python=self.with_future_python, - global_env_vars=appveyor_global_env_vars, - additional_matrix=appveyor_additional_matrix, - install_steps=appveyor_install_steps, - test_steps=appveyor_test_steps, - build_script=appveyor_build_script, - additional_lines=appveyor_additional_lines, - replacement=appveyor_replacement, - ) + with_docs=self.with_docs) def copy_with_meta( self, template_name, destination, config_type, @@ -613,9 +567,6 @@ def configure(self): self.tests_yml() self.manifest_in() - if self.with_appveyor: - self.appveyor() - with change_dir(self.path) as cwd: if pathlib.Path('bootstrap.py').exists(): call('git', 'rm', 'bootstrap.py') @@ -625,8 +576,8 @@ def configure(self): call('git', 'rm', '.coveragerc') if self.add_coveragerc and self.args.commit: call('git', 'add', '.coveragerc') - if self.with_appveyor and self.args.commit: - call('git', 'add', 'appveyor.yml') + if pathlib.Path('appveyor.yml').exists(): + call('git', 'rm', 'appveyor.yml') if self.with_docs and self.args.commit: call('git', 'add', '.readthedocs.yaml') if self.add_manylinux and self.args.commit: diff --git a/config/default/MANIFEST.in.j2 b/config/default/MANIFEST.in.j2 index 130577d..69c679a 100644 --- a/config/default/MANIFEST.in.j2 +++ b/config/default/MANIFEST.in.j2 @@ -3,9 +3,6 @@ include *.rst include *.txt include buildout.cfg include tox.ini -{% if with_appveyor %} -include appveyor.yml -{% endif %} {% if config_type in ('buildout-recipe', 'c-code') %} include .coveragerc {% endif %} diff --git a/config/default/appveyor.yml.j2 b/config/default/appveyor.yml.j2 deleted file mode 100644 index f6db6a6..0000000 --- a/config/default/appveyor.yml.j2 +++ /dev/null @@ -1,64 +0,0 @@ -{% if replacement %} -{% for line in replacement %} -%(line)s -{% endfor %} -{% else %} -environment: -{% for line in global_env_vars %} - %(line)s -{% endfor %} - - matrix: - - python: 37-x64 - - python: 38-x64 - - python: 39-x64 - - python: 310-x64 - - python: 311-x64 - - python: 312-x64 -{% if with_future_python %} - # `multibuild` cannot install non-final versions as they are not on - # ftp.python.org, so we skip Python 3.13 until its final release: - # - python: 313-x64 -{% endif %} -{% for line in additional_matrix %} - %(line)s -{% endfor %} - -install: - - "SET PYTHONVERSION=%PYTHON%" - - "SET PATH=C:\\Python%PYTHON%;c:\\Python%PYTHON%\\scripts;%PATH%" - - ps: | - $env:PYTHON = "C:\\Python${env:PYTHON}" - if (-not (Test-Path $env:PYTHON)) { - curl -o install_python.ps1 https://raw.githubusercontent.com/matthew-brett/multibuild/11a389d78892cf90addac8f69433d5e22bfa422a/install_python.ps1 - .\install_python.ps1 - } - - ps: if (-not (Test-Path $env:PYTHON)) { throw "No $env:PYTHON" } - - echo "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 > "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\vcvars64.bat" - - python -m pip install -U pip - - pip install -U setuptools wheel -{% for line in install_steps %} - %(line)s -{% endfor %} - -matrix: - fast_finish: true - -{% if build_script %} -build_script: - {% for line in build_script %} - %(line)s - {% endfor %} -{% else %} -build: false -{% endif %} - -test_script: -{% for line in test_steps %} - %(line)s -{% endfor %} -{% include 'appveyor-publish.j2' %} -{% for line in additional_lines %} -%(line)s -{% endfor %} -{% endif %}