From 31cb8c0a9629942034e68c947475ddf68dbc40a8 Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Wed, 24 May 2023 16:28:53 +0100 Subject: [PATCH] define 'noextra' tox env, fold 'nolxml' into that one and keep all pinned test dependencies inside a single requirements.txt, previously lxml was defined only inside tox.ini --- .github/workflows/test.yml | 8 ++++---- .github/workflows/wheels.yml | 11 ++++++----- requirements.txt | 1 + tox.ini | 10 ++-------- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3755c9414..3b26889ac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,8 +51,8 @@ jobs: run: pip install tox coverage - name: Run Tox run: tox $TOX_OPTIONS -e py-cov - - name: Run Tox without lxml - run: tox $TOX_OPTIONS -e py-cov-nolxml + - name: Run Tox without extra dependencies + run: tox $TOX_OPTIONS -e py-cov-noextra - name: Produce coverage files run: | coverage combine @@ -80,7 +80,7 @@ jobs: - name: Install packages run: pip install tox - name: Run Tox - run: tox $TOX_OPTIONS -e py-cy-nolxml + run: tox $TOX_OPTIONS -e py-cy test-pypy3: runs-on: ubuntu-latest @@ -94,4 +94,4 @@ jobs: - name: Install packages run: pip install tox - name: Run Tox - run: tox $TOX_OPTIONS -e pypy3-nolxml + run: tox $TOX_OPTIONS -e pypy3 diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index d5f8b9bfa..b142ac224 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -11,7 +11,6 @@ on: workflow_dispatch: env: - PROJECT_NAME: fonttools # skip binary wheels for pypy (preferable to use pure-python) and 32-bit Linux CIBW_SKIP: pp* cp*linux_i686 CIBW_ENVIRONMENT: FONTTOOLS_WITH_CYTHON=1 @@ -31,7 +30,7 @@ jobs: os: [macos-latest, windows-latest] arch: [auto64] build: ["*"] - test_command: ["tox -e py-cy-nolxml -c {package}/tox.ini --installpkg {wheel}"] + tox_env: ["py-cy"] include: # # the manylinux1 docker images contain up to python 3.9 # - os: ubuntu-latest @@ -66,8 +65,8 @@ jobs: - os: windows-latest arch: auto32 build: "*" - # skip running test on 32-bit windows - test_command: "python -c \"import fontTools; print(fontTools.__file__, fontTools.__version__)\"" + # scipy doesn't have wheels for win32 hence run tox with 'noextra' + tox_env: py-cy-noextra steps: - uses: actions/checkout@v2 with: @@ -77,6 +76,7 @@ jobs: with: python-version: "3.x" - name: Install dependencies + # using fork of cibuildwheel until this is fixed: https://github.com/pypa/cibuildwheel/issues/1504 run: pip install git+https://github.com/anthrotype/cibuildwheel.git@test_command_wheel#egg=cibuildwheel - name: Build Wheels @@ -86,7 +86,7 @@ jobs: CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.CIBW_MANYLINUX_I686_IMAGE }} CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.CIBW_MANYLINUX_X86_64_IMAGE }} CIBW_ARCHS: ${{ matrix.arch }} - CIBW_TEST_COMMAND: ${{ matrix.test_command }} + CIBW_TEST_COMMAND: "tox -e ${{ matrix.tox_env }} --installpkg {wheel}" - uses: actions/upload-artifact@v2 with: path: wheelhouse/*.whl @@ -107,6 +107,7 @@ jobs: with: platforms: all - name: Install dependencies + # using fork of cibuildwheel until this is fixed: https://github.com/pypa/cibuildwheel/issues/1504 run: pip install git+https://github.com/anthrotype/cibuildwheel.git@test_command_wheel#egg=cibuildwheel - name: Build Wheels run: python -m cibuildwheel --output-dir wheelhouse . diff --git a/requirements.txt b/requirements.txt index 690837eb2..d3ff48f02 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,3 +15,4 @@ pyobjc==9.0; sys_platform == "darwin" freetype-py==2.3.0 uharfbuzz==0.32.0 glyphsLib==6.2.1 # this is only required to run Tests/varLib/interpolatable_test.py +lxml==4.9.0 diff --git a/tox.ini b/tox.ini index eaf9b3ca8..cf0afea08 100644 --- a/tox.ini +++ b/tox.ini @@ -18,14 +18,8 @@ deps = cov: coverage>=4.3 pytest pytest-randomly - -rrequirements.txt - !nolxml: lxml==4.9.0 -extras = - ufo - woff - unicode - interpolatable - !nolxml: lxml + # add -noextra to tox -e to skip installing extras and only test the core fonttools + !noextra: -rrequirements.txt commands = cy: python -c "from fontTools.cu2qu.cu2qu import COMPILED; assert COMPILED" !cy: python -c "from fontTools.cu2qu.cu2qu import COMPILED; assert not COMPILED"