diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 66ec35f3..84463af1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: - name: Checkout source uses: actions/checkout@v3 - name: Set up Python 3.8 - uses: actions/setup-python@v4.3.0 + uses: actions/setup-python@v4.5.0 with: python-version: 3.8 - name: Install dependencies @@ -40,7 +40,7 @@ jobs: - name: Checkout source uses: actions/checkout@v3 - name: Set up Python 3.8 - uses: actions/setup-python@v4.3.0 + uses: actions/setup-python@v4.5.0 with: python-version: 3.8 - name: Upgrade pip @@ -97,96 +97,123 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - arch: - - auto include: - python-version: '3.6' - os: ubuntu-latest + os: ubuntu-20.04 install-extras: tests-strict,runtime-strict + arch: auto - python-version: '3.6' os: macOS-latest install-extras: tests-strict,runtime-strict + arch: auto - python-version: '3.6' os: windows-latest install-extras: tests-strict,runtime-strict + arch: auto - python-version: '3.11' os: ubuntu-latest install-extras: tests-strict,runtime-strict,optional-strict + arch: auto - python-version: '3.11' os: macOS-latest install-extras: tests-strict,runtime-strict,optional-strict + arch: auto - python-version: '3.11' os: windows-latest install-extras: tests-strict,runtime-strict,optional-strict + arch: auto - python-version: '3.11' os: macOS-latest install-extras: tests + arch: auto - python-version: '3.11' os: windows-latest install-extras: tests + arch: auto - python-version: '3.6' - os: ubuntu-latest + os: ubuntu-20.04 install-extras: tests,optional + arch: auto - python-version: '3.7' os: ubuntu-latest install-extras: tests,optional + arch: auto - python-version: '3.8' os: ubuntu-latest install-extras: tests,optional + arch: auto - python-version: '3.9' os: ubuntu-latest install-extras: tests,optional + arch: auto - python-version: '3.10' os: ubuntu-latest install-extras: tests,optional + arch: auto - python-version: '3.11' os: ubuntu-latest install-extras: tests,optional + arch: auto - python-version: '3.6' os: macOS-latest install-extras: tests,optional + arch: auto - python-version: '3.7' os: macOS-latest install-extras: tests,optional + arch: auto - python-version: '3.8' os: macOS-latest install-extras: tests,optional + arch: auto - python-version: '3.9' os: macOS-latest install-extras: tests,optional + arch: auto - python-version: '3.10' os: macOS-latest install-extras: tests,optional + arch: auto - python-version: '3.11' os: macOS-latest install-extras: tests,optional + arch: auto - python-version: '3.6' os: windows-latest install-extras: tests,optional + arch: auto - python-version: '3.7' os: windows-latest install-extras: tests,optional + arch: auto - python-version: '3.8' os: windows-latest install-extras: tests,optional + arch: auto - python-version: '3.9' os: windows-latest install-extras: tests,optional + arch: auto - python-version: '3.10' os: windows-latest install-extras: tests,optional + arch: auto - python-version: '3.11' os: windows-latest install-extras: tests,optional + arch: auto - python-version: pypy-3.7 os: ubuntu-latest install-extras: tests,optional + arch: auto - python-version: pypy-3.7 os: macOS-latest install-extras: tests,optional + arch: auto - python-version: pypy-3.7 os: windows-latest install-extras: tests,optional + arch: auto steps: - name: Checkout source uses: actions/checkout@v3 @@ -204,7 +231,7 @@ jobs: with: platforms: all - name: Setup Python - uses: actions/setup-python@v4.3.0 + uses: actions/setup-python@v4.5.0 with: python-version: ${{ matrix.python-version }} - name: Build pure wheel @@ -220,9 +247,17 @@ jobs: CI_PYTHON_VERSION: py${{ matrix.python-version }} run: |- # Find the path to the wheel - WHEEL_FPATH=$(ls wheelhouse/xdoctest*.whl) - # Install the wheel - python -m pip install ${WHEEL_FPATH}[${INSTALL_EXTRAS}] + ls wheelhouse + pip install tomli pkginfo + MOD_NAME=xdoctest + echo "MOD_NAME=$MOD_NAME" + WHEEL_FPATH=$(python -c "import pathlib; print(str(sorted(pathlib.Path('wheelhouse').glob('$MOD_NAME*.whl'))[-1]).replace(chr(92), chr(47)))") + echo "WHEEL_FPATH=$WHEEL_FPATH" + MOD_VERSION=$(python -c "from pkginfo import Wheel; print(Wheel('$WHEEL_FPATH').version)") + echo "MOD_VERSION=$MOD_VERSION" + # Install the wheel (ensure we are using the version we just built) + # NOTE: THE VERSION MUST BE NEWER THAN AN EXISTING PYPI VERSION OR THIS MAY FAIL + pip install "$MOD_NAME[$INSTALL_EXTRAS]==$MOD_VERSION" -f wheelhouse # Create a sandboxed directory WORKSPACE_DNAME="testdir_${CI_PYTHON_VERSION}_${GITHUB_RUN_ID}_${RUNNER_OS}" mkdir -p $WORKSPACE_DNAME @@ -230,7 +265,7 @@ jobs: # Get the path to the installed package and run the tests MOD_DPATH=$(python -c "import xdoctest, os; print(os.path.dirname(xdoctest.__file__))") echo "MOD_DPATH = $MOD_DPATH" - python -m pytest -p pytester -p no:doctest --xdoctest --cov-config ../pyproject.toml --cov-report term --cov=xdoctest $MOD_DPATH ../tests + python -m pytest -p pytester -p no:doctest --xdoctest --cov-config ../pyproject.toml --cov-report term --cov="$MOD_NAME" "$MOD_DPATH" ../tests # Move coverage file to a new name mv .coverage "../.coverage.$WORKSPACE_DNAME" cd .. @@ -238,7 +273,7 @@ jobs: shell: bash run: ls -la wheelhouse - name: Set up Python 3.8 to combine coverage Linux - uses: actions/setup-python@v4.3.0 + uses: actions/setup-python@v4.5.0 if: runner.os == 'Linux' with: python-version: 3.8 diff --git a/.readthedocs.yml b/.readthedocs.yml index 8a1cff88..01bd0b26 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,33 +1,18 @@ # .readthedocs.yml # Read the Docs configuration file # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details -# +# # See Also: # https://readthedocs.org/dashboard/xdoctest/advanced/ # Required version: 2 - -# Build documentation in the docs/ directory with Sphinx sphinx: configuration: docs/source/conf.py - -# Build documentation with MkDocs -#mkdocs: -# configuration: mkdocs.yml - -# Optionally build your docs in additional formats such as PDF and ePub formats: all - -# Optionally set the version of Python and requirements required to build your docs python: version: 3.7 install: - - requirements: requirements/docs.txt - - method: pip - path: . - #extra_requirements: - # - docs - -#conda: -# environment: environment.yml + - requirements: requirements/docs.txt + - method: pip + path: . diff --git a/dev/setup_secrets.sh b/dev/setup_secrets.sh index 7cfdc0da..1ead971d 100644 --- a/dev/setup_secrets.sh +++ b/dev/setup_secrets.sh @@ -393,6 +393,15 @@ export_encrypted_code_signing_keys(){ MAIN_GPG_KEYID=$(gpg --list-keys --keyid-format LONG "$GPG_IDENTIFIER" | head -n 2 | tail -n 1 | awk '{print $1}') GPG_SIGN_SUBKEY=$(gpg --list-keys --with-subkey-fingerprints "$GPG_IDENTIFIER" | grep "\[S\]" -A 1 | tail -n 1 | awk '{print $1}') + # Careful, if you don't have a subkey, requesting it will export more than you want. + # Export the main key instead (its better to have subkeys, but this is a lesser evil) + if [[ "$GPG_SIGN_SUBKEY" == "" ]]; then + # NOTE: if you get here this probably means your subkeys expired (and + # wont even be visible), so we probably should check for that here and + # thrown an error instead of using this hack, which likely wont work + # anyway. + GPG_SIGN_SUBKEY=$(gpg --list-keys --with-subkey-fingerprints "$GPG_IDENTIFIER" | grep "\[C\]" -A 1 | tail -n 1 | awk '{print $1}') + fi echo "MAIN_GPG_KEYID = $MAIN_GPG_KEYID" echo "GPG_SIGN_SUBKEY = $GPG_SIGN_SUBKEY" diff --git a/requirements.txt b/requirements.txt index 58c4e6d0..bc18a503 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,3 @@ -r requirements/runtime.txt -r requirements/tests.txt --r requirements/tests-binary.txt --r requirements/jupyter.txt --r requirements/colors.txt +-r requirements/optional.txt