aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/builddocs.yml53
-rw-r--r--.github/workflows/dockerfiles/Dockerfile_debian19
-rw-r--r--.github/workflows/dockerfiles/Dockerfile_fedora10
-rw-r--r--.github/workflows/dockerfiles/Dockerfile_redhat (renamed from .github/workflows/dockerfiles/Dockerfile_centos)22
-rw-r--r--.github/workflows/dockerfiles/Dockerfile_ubuntu19
-rw-r--r--.github/workflows/dockertests.yml6
-rw-r--r--.github/workflows/release-deploy.yml34
-rwxr-xr-x.github/workflows/run_pytest.sh8
-rw-r--r--.github/workflows/testsuite.yml (renamed from .github/workflows/pythonpackage.yml)90
9 files changed, 115 insertions, 146 deletions
diff --git a/.github/workflows/builddocs.yml b/.github/workflows/builddocs.yml
deleted file mode 100644
index 9092b1a..0000000
--- a/.github/workflows/builddocs.yml
+++ /dev/null
@@ -1,53 +0,0 @@
-name: DocBuild
-
-on:
- push:
- branches: master
-
-defaults:
- run:
- shell: bash
-
-jobs:
- build_docs:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [ubuntu-latest]
- python-version: [3.8]
- steps:
- - name: Checkout master
- uses: actions/checkout@v2
- with:
- path: main
- - name: Get last commit message
- run: |
- cd main
- echo "LAST_COMMIT=$(echo `git log -1 --pretty=%B`)" >> $GITHUB_ENV
- cd ..
- - name: Install needed packages
- run: |
- pip3 install wheel
- pip3 install pytest
- sudo apt update
- sudo apt-get install python3-sphinx
- cd main/docs
- make html
- - name: Checkout gh-pages
- uses: actions/checkout@v2
- with:
- ref: gh-pages
- path: doc
- - name: Copy and commit changes
- run: |
- cp -r main/gh-pages/* doc/master
- cd doc
- git config user.name "CI Build"
- git config user.email "pyfakefs@gmail.com"
- git add master/*
- if [ `git status -s | wc -l` = 0 ]; then
- echo "No changes in built documentation, skipping"
- exit 0
- fi
- git commit -a -m "$LAST_COMMIT"
- git push
diff --git a/.github/workflows/dockerfiles/Dockerfile_debian b/.github/workflows/dockerfiles/Dockerfile_debian
index 0012e77..7d34f4f 100644
--- a/.github/workflows/dockerfiles/Dockerfile_debian
+++ b/.github/workflows/dockerfiles/Dockerfile_debian
@@ -20,27 +20,30 @@ RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
-ARG github_repo=jmcgeheeiv/pyfakefs
-ARG github_branch=master
+ARG github_repo=pytest-dev/pyfakefs
+ARG github_branch=main
RUN apt-get update && apt-get install -y \
python3-pip \
unzip \
- wget
+ wget \
+ python3-venv
+
RUN apt-get clean
RUN useradd -u 1000 pyfakefs
RUN mkdir -p work \
- && wget https://github.com/$github_repo/archive/$github_branch.zip \
- && unzip $github_branch.zip -d work
+ && wget https://github.com/$github_repo/archive/$github_branch.zip -O archive.zip \
+ && unzip archive.zip -d work
RUN WORK_DIR=`ls -d work/*`; mv $WORK_DIR work/pyfakefs
RUN chown -R pyfakefs:pyfakefs work/pyfakefs
WORKDIR work/pyfakefs
-RUN pip3 install -r requirements.txt
-RUN pip3 install -r extra_requirements.txt
+RUN python3 -m venv ../venv
+RUN ../venv/bin/pip install -r requirements.txt
+RUN ../venv/bin/pip install -r extra_requirements.txt
USER pyfakefs
ENV PYTHONPATH work/pyfakefs
ENV TEST_REAL_FS=1
-CMD ["python3", "-m", "pyfakefs.tests.all_tests"]
+CMD ["../venv/bin/python", "-m", "pyfakefs.tests.all_tests"]
diff --git a/.github/workflows/dockerfiles/Dockerfile_fedora b/.github/workflows/dockerfiles/Dockerfile_fedora
index 5cb9dee..9b6b5bd 100644
--- a/.github/workflows/dockerfiles/Dockerfile_fedora
+++ b/.github/workflows/dockerfiles/Dockerfile_fedora
@@ -12,22 +12,22 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM fedora:32
+FROM fedora:latest
MAINTAINER jmcgeheeiv@users.noreply.github.com
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
-ARG github_repo=jmcgeheeiv/pyfakefs
-ARG github_branch=master
+ARG github_repo=pytest-dev/pyfakefs
+ARG github_branch=main
RUN dnf install -y python3-pip unzip wget
RUN useradd -u 1000 pyfakefs
RUN mkdir -p work \
- && wget https://github.com/$github_repo/archive/$github_branch.zip \
- && unzip $github_branch.zip -d work
+ && wget https://github.com/$github_repo/archive/$github_branch.zip -O archive.zip \
+ && unzip archive.zip -d work
RUN WORK_DIR=`ls -d work/*`; mv $WORK_DIR work/pyfakefs
RUN chown -R pyfakefs:pyfakefs work/pyfakefs
WORKDIR work/pyfakefs
diff --git a/.github/workflows/dockerfiles/Dockerfile_centos b/.github/workflows/dockerfiles/Dockerfile_redhat
index f22fb63..00bb825 100644
--- a/.github/workflows/dockerfiles/Dockerfile_centos
+++ b/.github/workflows/dockerfiles/Dockerfile_redhat
@@ -12,23 +12,25 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-FROM centos:7
-MAINTAINER jmcgeheeiv@users.noreply.github.com
+FROM registry.access.redhat.com/ubi9/ubi
+LABEL maintainer="John McGehee"
-ENV LANG en_US.UTF-8
-ENV LANGUAGE en_US:en
-ENV LC_ALL en_US.UTF-8
-
-ARG github_repo=jmcgeheeiv/pyfakefs
-ARG github_branch=master
+ARG github_repo=pytest-dev/pyfakefs
+ARG github_branch=main
+RUN yum update --disablerepo=* --enablerepo=ubi-9-appstream-rpms --enablerepo=ubi-9-baseos-rpms -y
RUN yum install -y python3-pip unzip wget
+RUN python3 --version
+
+ENV LANG en_US.UTF-8
+ENV LANGUAGE en_US:en
+ENV LC_COLLATE C.UTF-8
RUN useradd -u 1000 pyfakefs
RUN mkdir -p work \
- && wget https://github.com/$github_repo/archive/$github_branch.zip \
- && unzip $github_branch.zip -d work
+ && wget https://github.com/$github_repo/archive/$github_branch.zip -O archive.zip \
+ && unzip archive.zip -d work
RUN WORK_DIR=`ls -d work/*`; mv $WORK_DIR work/pyfakefs
RUN chown -R pyfakefs:pyfakefs work/pyfakefs
WORKDIR work/pyfakefs
diff --git a/.github/workflows/dockerfiles/Dockerfile_ubuntu b/.github/workflows/dockerfiles/Dockerfile_ubuntu
index 2e235cd..f76fa31 100644
--- a/.github/workflows/dockerfiles/Dockerfile_ubuntu
+++ b/.github/workflows/dockerfiles/Dockerfile_ubuntu
@@ -20,27 +20,30 @@ RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
-ARG github_repo=jmcgeheeiv/pyfakefs
-ARG github_branch=master
+ARG github_repo=pytest-dev/pyfakefs
+ARG github_branch=main
RUN apt-get update && apt-get install -y \
python3-pip \
unzip \
- wget
+ wget \
+ python3-venv
+
RUN apt-get clean
RUN useradd -u 1000 pyfakefs
RUN mkdir -p work \
- && wget https://github.com/$github_repo/archive/$github_branch.zip \
- && unzip $github_branch.zip -d work
+ && wget https://github.com/$github_repo/archive/$github_branch.zip -O archive.zip \
+ && unzip archive.zip -d work
RUN WORK_DIR=`ls -d work/*`; mv $WORK_DIR work/pyfakefs
RUN chown -R pyfakefs:pyfakefs work/pyfakefs
WORKDIR work/pyfakefs
-RUN pip3 install -r requirements.txt
-RUN pip3 install -r extra_requirements.txt
+RUN python3 -m venv ../venv
+RUN ../venv/bin/pip install -r requirements.txt
+RUN ../venv/bin/pip install -r extra_requirements.txt
USER pyfakefs
ENV PYTHONPATH work/pyfakefs
ENV TEST_REAL_FS=1
-CMD ["python3", "-m", "pyfakefs.tests.all_tests"]
+CMD ["../venv/bin/python", "-m", "pyfakefs.tests.all_tests"]
diff --git a/.github/workflows/dockertests.yml b/.github/workflows/dockertests.yml
index af77346..9daa2ad 100644
--- a/.github/workflows/dockertests.yml
+++ b/.github/workflows/dockertests.yml
@@ -9,11 +9,11 @@ jobs:
strategy:
fail-fast: false
matrix:
- docker-image: [centos, debian, fedora, ubuntu]
+ docker-image: [debian, fedora, ubuntu, redhat]
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Setup docker container
run: |
- docker build -t pyfakefs -f $GITHUB_WORKSPACE/.github/workflows/dockerfiles/Dockerfile_${{ matrix.docker-image }} . --build-arg github_repo=$GITHUB_REPOSITORY --build-arg github_branch=$(basename $GITHUB_REF)
+ docker build -t pyfakefs -f $GITHUB_WORKSPACE/.github/workflows/dockerfiles/Dockerfile_${{ matrix.docker-image }} . --build-arg github_repo=$GITHUB_REPOSITORY --build-arg github_branch=$GITHUB_REF_NAME
- name: Run tests
run: docker run -t pyfakefs
diff --git a/.github/workflows/release-deploy.yml b/.github/workflows/release-deploy.yml
new file mode 100644
index 0000000..41f4369
--- /dev/null
+++ b/.github/workflows/release-deploy.yml
@@ -0,0 +1,34 @@
+name: release-deploy
+
+on:
+ release:
+ types: [ published ]
+
+jobs:
+
+ deploy:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: true
+ matrix:
+ python-version: [ '3.10' ]
+
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Set up Python ${{ matrix.python-version }}
+ uses: actions/setup-python@v4
+ with:
+ python-version: ${{ matrix.python-version }}
+
+ - name: Build package
+ run: |
+ python -m pip install --upgrade pip
+ python -m pip install build
+ python -m build
+
+ - name: Publish package to PyPI
+ uses: pypa/gh-action-pypi-publish@release/v1
+ with:
+ user: __token__
+ password: ${{ secrets.PYPI_TOKEN }}
diff --git a/.github/workflows/run_pytest.sh b/.github/workflows/run_pytest.sh
deleted file mode 100755
index 725deb9..0000000
--- a/.github/workflows/run_pytest.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-
-python -m pytest pyfakefs/pytest_tests/pytest_plugin_test.py
-if [[ $PY_VERSION == '3.6' ]] || [[ $PY_VERSION == '3.7' ]] || [[ $PY_VERSION == '3.8' ]] || [[ $PY_VERSION == '3.9' ]] ; then
- python -m pytest pyfakefs/pytest_tests/pytest_fixture_test.py
-fi
-python -m pytest pyfakefs/pytest_tests/pytest_plugin_failing_helper.py > ./testresult.txt
-python -m pytest pyfakefs/pytest_tests/pytest_check_failed_plugin_test.py
diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/testsuite.yml
index 25f0527..51b59b2 100644
--- a/.github/workflows/pythonpackage.yml
+++ b/.github/workflows/testsuite.yml
@@ -4,43 +4,20 @@ on:
[push, pull_request]
jobs:
- linter:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [ubuntu-latest]
- python-version: [3.8]
+ pytype:
+ runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
- - name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v2
+ - name: Check out repository
+ uses: actions/checkout@v3
+ - name: Set up Python
+ uses: actions/setup-python@v4
with:
- python-version: ${{ matrix.python-version }}
- - name: Install linter
+ python-version: "3.10"
+ - name: install pytype
+ run: pip install setuptools pytype pytest scandir pathlib2 pandas xlrd django
+ - name: Run pytype
run: |
- uname -a
- python -m pip install flake8 mypy
- - name: Check syntax and style
- run: flake8 . --exclude get-pip.py --max-complexity=13 --statistics
-
- mypy:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os: [ubuntu-latest]
- python-version: [3.8]
- steps:
- - uses: actions/checkout@v2
- - name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v2
- with:
- python-version: ${{ matrix.python-version }}
- - name: Install dependencies
- run: |
- python -m pip install -r requirements.txt -r extra_requirements.txt
- python -m pip install mypy==0.812
- - name: Run typing checks
- run: python -m mypy .
+ pytype pyfakefs --keep-going --exclude pyfakefs/tests/* --exclude pyfakefs/pytest_tests/*
tests:
runs-on: ${{ matrix.os }}
@@ -48,15 +25,19 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
- python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
+ python-version: ["3.8", "3.9", "3.10", "3.11", "3.12-dev"]
include:
- - python-version: pypy3
+ - python-version: "pypy-3.7"
+ os: ubuntu-latest
+ - python-version: "pypy-3.9"
+ os: ubuntu-latest
+ - python-version: "pypy-3.10"
os: ubuntu-latest
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v2
+ uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
@@ -68,7 +49,7 @@ jobs:
- name: Cache dependencies
id: cache-dep
- uses: actions/cache@v2
+ uses: actions/cache@v3
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ matrix.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/extra_requirements.txt') }}
@@ -77,9 +58,8 @@ jobs:
- name: Install dependencies
run: |
- pip install wheel
+ pip install setuptools wheel
pip install -r requirements.txt
- pip install .
- name: Run unit tests without extra packages as non-root user
run: |
export TEST_REAL_FS=1
@@ -97,10 +77,12 @@ jobs:
fi
shell: bash
- name: Install extra dependencies
+ if: ${{ matrix.python-version != '3.12-dev' }}
run: |
pip install -r extra_requirements.txt
shell: bash
- name: Run unit tests with extra packages as non-root user
+ if: ${{ matrix.python-version != '3.12-dev' }}
run: |
python -m pyfakefs.tests.all_tests
shell: bash
@@ -117,27 +99,33 @@ jobs:
strategy:
fail-fast: false
matrix:
- os: [ubuntu-latest, windows-latest]
- python-version: [3.9]
- pytest-version: [3.0.0, 3.5.1, 4.0.2, 4.5.0, 5.0.1, 5.4.3, 6.0.2, 6.2.5, 7.0.1, 7.1.0]
+ os: [ubuntu-latest, macOS-latest, windows-latest]
+ python-version: ["3.9"]
+ pytest-version: [3.0.0, 3.5.1, 4.0.2, 4.5.0, 5.0.1, 5.4.3, 6.0.2, 6.2.5, 7.0.1, 7.1.3, 7.2.0, 7.3.1, 7.4.0]
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v2
+ uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -U pytest==${{ matrix.pytest-version }}
+ pip install opentimelineio
+ pip install -e .
if [[ '${{ matrix.pytest-version }}' == '4.0.2' ]]; then
pip install -U attrs==19.1.0
fi
shell: bash
- name: Run pytest tests
run: |
- export PY_VERSION=${{ matrix.python-version }}
- $GITHUB_WORKSPACE/.github/workflows/run_pytest.sh
+ echo "$(python -m pytest pyfakefs/pytest_tests/pytest_plugin_failing_helper.py)" > ./testresult.txt
+ python -m pytest pyfakefs/pytest_tests
+ if [[ '${{ matrix.pytest-version }}' > '3.0.0' ]]; then
+ cd pyfakefs/pytest_tests/ns_package
+ python -m pytest --log-cli-level=INFO test
+ fi
shell: bash
dependency-check:
@@ -145,11 +133,11 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
- python-version: [3.9]
+ python-version: ["3.10"]
steps:
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
- uses: actions/setup-python@v2
+ uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies