diff options
Diffstat (limited to '.github')
-rw-r--r-- | .github/ISSUE_TEMPLATE/bug_report.md | 14 | ||||
-rw-r--r-- | .github/ISSUE_TEMPLATE/feature_request.md | 2 | ||||
-rw-r--r-- | .github/PULL_REQUEST_TEMPLATE.md | 14 | ||||
-rw-r--r-- | .github/workflows/builddocs.yml | 53 | ||||
-rw-r--r-- | .github/workflows/dockerfiles/Dockerfile_debian | 19 | ||||
-rw-r--r-- | .github/workflows/dockerfiles/Dockerfile_fedora | 10 | ||||
-rw-r--r-- | .github/workflows/dockerfiles/Dockerfile_redhat (renamed from .github/workflows/dockerfiles/Dockerfile_centos) | 22 | ||||
-rw-r--r-- | .github/workflows/dockerfiles/Dockerfile_ubuntu | 19 | ||||
-rw-r--r-- | .github/workflows/dockertests.yml | 6 | ||||
-rw-r--r-- | .github/workflows/release-deploy.yml | 34 | ||||
-rwxr-xr-x | .github/workflows/run_pytest.sh | 8 | ||||
-rw-r--r-- | .github/workflows/testsuite.yml (renamed from .github/workflows/pythonpackage.yml) | 90 |
12 files changed, 138 insertions, 153 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 84ac229..37d93ca 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -8,17 +8,19 @@ assignees: '' --- **Describe the bug** -A clear and concise description of what the bug is. -Please provide a stack trace if available. +Describe the observed behavior, and what you expect to happen instead. +In case of a crash, please provide the complete stack trace. **How To Reproduce** -Please provide a unit test or a minimal code snippet that reproduces the -problem. +Please provide a unit test or a minimal reproducible example that shows +the problem. **Your environment** -Please run the following and paste the output. +Please run the following in the environment where the problem happened and +paste the output. ```bash python -c "import platform; print(platform.platform())" python -c "import sys; print('Python', sys.version)" -python -c "from pyfakefs.fake_filesystem import __version__; print('pyfakefs', __version__)" +python -c "from pyfakefs import __version__; print('pyfakefs', __version__)" +python -c "import pytest; print('pytest', pytest.__version__)" ``` diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 75dac2d..e12f065 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,7 +2,7 @@ name: Feature request about: Suggest an idea for this project title: '' -labels: '' +labels: 'enhancement' assignees: '' --- diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..76469e1 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,14 @@ +<!-- +Please prefix your PR title with [WIP] for PRs that are still in progress. +--> + +#### Describe the changes +The related issue or a description of the bug or feature that this PR addresses. + +#### Tasks +- [ ] Unit tests added that reproduce the issue or prove feature is working +- [ ] Fix or feature added +- [ ] Entry to release notes added +- [ ] Pre-commit CI shows no errors +- [ ] Unit tests passing +- [ ] For documentation changes: The Read the Docs preview builds and looks as expected 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 |