Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Jan 13, 2023
1 parent f212145 commit ede9d41
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 34 deletions.
59 changes: 47 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -220,25 +247,33 @@ 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
cd $WORKSPACE_DNAME
# 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 ..
- name: Show built files
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
Expand Down
23 changes: 4 additions & 19 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -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: .
9 changes: 9 additions & 0 deletions dev/setup_secrets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
4 changes: 1 addition & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit ede9d41

Please sign in to comment.