Skip to content

Commit

Permalink
Update xcookie structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Erotemic committed Nov 1, 2022
1 parent 822b445 commit 18fc711
Showing 5 changed files with 88 additions and 53 deletions.
129 changes: 84 additions & 45 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -48,7 +48,6 @@ jobs:
python -m pip install --upgrade pip
python -m pip install -r requirements/tests.txt
python -m pip install -r requirements/runtime.txt
true
- name: Build sdist
shell: bash
run: |-
@@ -63,26 +62,30 @@ jobs:
run: |-
pwd
ls -al
# Run in a sandboxed directory
WORKSPACE_DNAME="testsrcdir_minimal_${CI_PYTHON_VERSION}_${GITHUB_RUN_ID}_${RUNNER_OS}"
mkdir -p $WORKSPACE_DNAME
cd $WORKSPACE_DNAME
# Run the tests
# Get path to installed package
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=xdoctest $MOD_DPATH ./tests
python -m pytest --cov={self.mod_name} $MOD_DPATH ../tests
cd ..
- name: Test full loose sdist
run: |-
pwd
ls -al
python -m pip install -r requirements/optional.txt
true
MOD_DPATH=$(python -c "import xdoctest, os; print(os.path.dirname(xdoctest.__file__))")
echo "MOD_DPATH = $MOD_DPATH"
# Run in a sandboxed directory
WORKSPACE_DNAME="testsrcdir_${CI_PYTHON_VERSION}_${GITHUB_RUN_ID}_${RUNNER_OS}"
WORKSPACE_DNAME="testsrcdir_full_${CI_PYTHON_VERSION}_${GITHUB_RUN_ID}_${RUNNER_OS}"
mkdir -p $WORKSPACE_DNAME
cd $WORKSPACE_DNAME
# Run the tests
# Get path to installed package
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 $MOD_DPATH ../tests
python -m pytest --cov={self.mod_name} $MOD_DPATH ../tests
cd ..
- name: Upload sdist artifact
uses: actions/upload-artifact@v3
@@ -94,69 +97,105 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- windows-latest
- ubuntu-latest
- macOS-latest
python-version:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- pypy-3.7
install-extras:
- tests
- tests,optional
arch:
- auto
include:
- python-version: '3.6'
os: windows-latest
os: ubuntu-latest
install-extras: tests-strict,runtime-strict
- python-version: '3.10'
os: windows-latest
- python-version: '3.6'
os: macOS-latest
install-extras: tests-strict,runtime-strict
- python-version: '3.6'
os: windows-latest
install-extras: tests-strict,runtime-strict
- python-version: '3.11'
os: ubuntu-latest
install-extras: tests-strict,runtime-strict,optional-strict
- python-version: '3.10'
- python-version: '3.11'
os: macOS-latest
install-extras: tests-strict,runtime-strict,optional-strict
- python-version: '3.11'
os: windows-latest
install-extras: tests-strict,runtime-strict,optional-strict
- python-version: '3.11'
os: macOS-latest
install-extras: tests
- python-version: '3.11'
os: windows-latest
install-extras: tests
- python-version: '3.6'
os: ubuntu-latest
install-extras: tests-strict,runtime-strict
- python-version: '3.10'
install-extras: tests,optional
- python-version: '3.7'
os: ubuntu-latest
install-extras: tests-strict,runtime-strict
- python-version: '3.6'
install-extras: tests,optional
- python-version: '3.8'
os: ubuntu-latest
install-extras: tests-strict,runtime-strict,optional-strict
install-extras: tests,optional
- python-version: '3.9'
os: ubuntu-latest
install-extras: tests,optional
- python-version: '3.10'
os: ubuntu-latest
install-extras: tests-strict,runtime-strict,optional-strict
install-extras: tests,optional
- python-version: '3.11'
os: ubuntu-latest
install-extras: tests,optional
- python-version: '3.6'
os: macOS-latest
install-extras: tests-strict,runtime-strict
install-extras: tests,optional
- python-version: '3.7'
os: macOS-latest
install-extras: tests,optional
- python-version: '3.8'
os: macOS-latest
install-extras: tests,optional
- python-version: '3.9'
os: macOS-latest
install-extras: tests,optional
- python-version: '3.10'
os: macOS-latest
install-extras: tests-strict,runtime-strict
- python-version: '3.6'
install-extras: tests,optional
- python-version: '3.11'
os: macOS-latest
install-extras: tests-strict,runtime-strict,optional-strict
install-extras: tests,optional
- python-version: '3.6'
os: windows-latest
install-extras: tests,optional
- python-version: '3.7'
os: windows-latest
install-extras: tests,optional
- python-version: '3.8'
os: windows-latest
install-extras: tests,optional
- python-version: '3.9'
os: windows-latest
install-extras: tests,optional
- python-version: '3.10'
os: windows-latest
install-extras: tests,optional
- python-version: '3.11'
os: windows-latest
install-extras: tests,optional
- python-version: pypy-3.7
os: ubuntu-latest
install-extras: tests,optional
- python-version: pypy-3.7
os: macOS-latest
install-extras: tests-strict,runtime-strict,optional-strict
install-extras: tests,optional
- python-version: pypy-3.7
os: windows-latest
install-extras: tests,optional
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Enable MSVC 64bit
uses: ilammy/msvc-dev-cmd@v1
if: matrix.os == 'windows-latest' && matrix.cibw_build != 'cp3*-win32'
if: matrix.os == 'windows-latest' && matrix.cibw_skip == '*-win32'
- name: Enable MSVC 32bit
uses: ilammy/msvc-dev-cmd@v1
if: matrix.os == 'windows-latest' && matrix.cibw_build == 'cp3*-win32'
if: matrix.os == 'windows-latest' && matrix.cibw_skip == '*-win_amd64'
with:
arch: x86
- name: Set up QEMU
@@ -165,7 +204,7 @@ jobs:
with:
platforms: all
- name: Setup Python
uses: actions/setup-python@v4.2.0
uses: actions/setup-python@v4.3.0
with:
python-version: ${{ matrix.python-version }}
- name: Build pure wheel
@@ -191,17 +230,15 @@ 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"
# https://pytest-cov.readthedocs.io/en/latest/plugins.html
# python2 hack
COV_CORE_SOURCE="$MOD_DPATH" COV_CORE_CONFIG=../pyproject.toml COV_CORE_DATAFILE=.coverage.eager python -m pytest -p pytester -p no:doctest --xdoctest --cov-config ../pyproject.toml --cov-report html --cov-report term --cov-append --cov=xdoctest $MOD_DPATH ../tests || 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=xdoctest $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.2.0
uses: actions/setup-python@v4.3.0
if: runner.os == 'Linux'
with:
python-version: 3.8
@@ -266,6 +303,7 @@ jobs:
$GPG_EXECUTABLE --list-keys || echo "first invocation of gpg creates directories and returns 1"
$GPG_EXECUTABLE --list-keys
VERSION=$(python -c "import setup; print(setup.VERSION)")
pip install twine
pip install urllib3 requests[security] twine
GPG_KEYID=$(cat dev/public_gpg_key)
echo "GPG_KEYID = '$GPG_KEYID'"
@@ -308,6 +346,7 @@ jobs:
$GPG_EXECUTABLE --list-keys || echo "first invocation of gpg creates directories and returns 1"
$GPG_EXECUTABLE --list-keys
VERSION=$(python -c "import setup; print(setup.VERSION)")
pip install twine
pip install urllib3 requests[security] twine
GPG_KEYID=$(cat dev/public_gpg_key)
echo "GPG_KEYID = '$GPG_KEYID'"
@@ -331,4 +370,4 @@ jobs:
# --secret=EROTEMIC_TWINE_USERNAME=$EROTEMIC_TWINE_USERNAME \
# --secret=EROTEMIC_CI_SECRET=$EROTEMIC_CI_SECRET \
# --secret=EROTEMIC_TEST_TWINE_USERNAME=$EROTEMIC_TEST_TWINE_USERNAME \
# --secret=EROTEMIC_TEST_TWINE_PASSWORD=$EROTEMIC_TEST_TWINE_PASSWORD
# --secret=EROTEMIC_TEST_TWINE_PASSWORD=$EROTEMIC_TEST_TWINE_PASSWORD
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -3,5 +3,3 @@
-r requirements/tests-binary.txt
-r requirements/jupyter.txt
-r requirements/colors.txt

#-r requirements/optional.txt
4 changes: 2 additions & 2 deletions run_doctests.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
xdoctest ./src/xdoctest --style=google all "$@"
#!/usr/bin/env bash
xdoctest src/xdoctest --style=google all "$@"
2 changes: 1 addition & 1 deletion run_linter.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
flake8 ./src/xdoctest --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 ./xdoctest --count --select=E9,F63,F7,F82 --show-source --statistics
4 changes: 1 addition & 3 deletions run_tests.py
Original file line number Diff line number Diff line change
@@ -3,11 +3,9 @@
import pytest
import sys
package_name = 'xdoctest'
mod_dpath = './src/' + package_name
mod_dpath = 'src/xdoctest'
test_dpath = 'tests'
pytest_args = [
'-p', 'pytester',
'-p', 'no:doctest',
'--cov-config', 'pyproject.toml',
'--cov-report', 'html',
'--cov-report', 'term',

0 comments on commit 18fc711

Please sign in to comment.