Skip to content

Commit

Permalink
fix: support pytest 7 (#594)
Browse files Browse the repository at this point in the history
  • Loading branch information
Noah authored Feb 16, 2022
1 parent ec4cbac commit 17f0660
Show file tree
Hide file tree
Showing 15 changed files with 1,467 additions and 458 deletions.
19 changes: 19 additions & 0 deletions .github/actions/python/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: python
description: Setup python environment
inputs:
python-version:
description: Version of python
required: true
runs:
using: "composite"
steps:
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ inputs.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1.3.0
with:
version: 1.2.0a2
virtualenvs-create: true
virtualenvs-in-project: true
57 changes: 0 additions & 57 deletions .github/workflows/auto-update.yml

This file was deleted.

88 changes: 43 additions & 45 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,15 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/detect-env
- name: Setup Python
uses: actions/setup-python@v2
- name: Setup Environment
uses: ./.github/actions/python
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install project dependencies
run: . script/bootstrap
- name: Lint
run: |
. $VENV/bin/activate
invoke lint
poetry run invoke lint
tests:
name: Tests
runs-on: ${{ matrix.os }}
Expand All @@ -40,40 +39,43 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Setup Environment
uses: ./.github/actions/python
with:
python-version: ${{ matrix.python-version }}
- name: Install project dependencies and run tests
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
python -m pip install -U 'pip<21.3' --no-cache-dir
python -m pip install -e . -r dev_requirements.txt
invoke test --coverage
version_checks:
name: Dependency Version Constraint Checks
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
env:
SKIP_DEPS: 1
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/detect-env
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install project dependencies
run: |
. script/bootstrap
python -m pip install -e .[test] -r min_requirements.constraints
- name: Test
run: . script/bootstrap
shell: bash
- name: Run tests
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
shell: bash
run: |
. $VENV/bin/activate
invoke test --coverage
poetry run invoke test --coverage
# # TODO: How to do this with poetry?
# version_checks:
# name: Dependency Version Constraint Checks
# runs-on: ubuntu-latest
# if: "!contains(github.event.head_commit.message, '[skip ci]')"
# env:
# SKIP_DEPS: 1
# steps:
# - uses: actions/checkout@v2
# - uses: ./.github/actions/detect-env
# - name: Setup Environment
# uses: ./.github/actions/python
# with:
# python-version: 3.7 # it's min, so we'll use an older version of python
# - name: Install project dependencies
# run: |
# . script/bootstrap
# poetry install --with=test
# - name: Test
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# run: |
# . $VENV/bin/activate
# poetry run invoke test --coverage
dry_run:
name: Build
runs-on: ubuntu-latest
Expand All @@ -84,8 +86,8 @@ jobs:
with:
fetch-depth: 0
- uses: ./.github/actions/detect-env
- name: Setup Python
uses: actions/setup-python@v2
- name: Setup Environment
uses: ./.github/actions/python
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install project dependencies
Expand All @@ -95,27 +97,25 @@ jobs:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_PUBLISH_TOKEN }}
run: |
. $VENV/bin/activate
invoke release --dry-run
poetry run invoke release --dry-run
- name: Benchmark
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
. $VENV/bin/activate
invoke benchmark --report
poetry run invoke benchmark --report
release:
name: Release
runs-on: ubuntu-latest
needs: [analysis, tests, version_checks]
needs: [analysis, tests] # [version_checks]
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && !contains(github.event.head_commit.message, '[skip ci]')
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- uses: ./.github/actions/detect-env
- name: Setup Python
uses: actions/setup-python@v2
- name: Setup Environment
uses: ./.github/actions/python
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: cycjimmy/semantic-release-action@v2
Expand All @@ -134,11 +134,9 @@ jobs:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PUBLISH_TOKEN }}
run: |
. $VENV/bin/activate
invoke release --no-dry-run
poetry run invoke release --no-dry-run
- name: Benchmark
env:
GH_TOKEN: ${{ secrets.TOPHAT_BOT_GH_TOKEN }}
run: |
. $VENV/bin/activate
invoke benchmark --report
poetry run invoke benchmark --report
25 changes: 0 additions & 25 deletions .github/workflows/next.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .releaserc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
"# Changelog\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).\n\nFrom v1.0.0 onwards, this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). Pre-v1, breaking changes are indicated via a minor release, while all other changes fall under patches. At any time, you can see what's in progress for a version by filtering GitHub issues by milestone.",
},
],
["@semantic-release/git", { assets: ["CHANGELOG.md"] }],
["@semantic-release/git", { assets: ["CHANGELOG.md", "pyproject.toml"] }],
"@semantic-release/github",
],
};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors) [![Maturity badge - level 4](https://img.shields.io/badge/Maturity-Level%204%20--%20Critical-brightgreen.svg)](https://github.com/tophat/getting-started/blob/master/scorecard.md) [![Stage](https://img.shields.io/pypi/status/syrupy)](https://pypi.org/project/syrupy/) [![Discord](https://img.shields.io/discord/809577721751142410?label=community%20chat)](https://discord.gg/YhK3GFcZrk)

![Pytest>=5.1.0,<7.0.0](https://img.shields.io/badge/pytest-%3E%3D5.1.0,%20%3C7.0.0-green) [![Pypi](https://img.shields.io/pypi/v/syrupy)](https://pypi.org/project/syrupy/) [![Wheel](https://img.shields.io/pypi/wheel/syrupy)](https://pypi.org/project/syrupy/) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/syrupy) [![PyPI - Downloads](https://img.shields.io/pypi/dm/syrupy)](https://pypi.org/project/syrupy/) [![PyPI - License](https://img.shields.io/pypi/l/syrupy)](./LICENSE)
![Pytest>=5.1.0,<8.0.0](https://img.shields.io/badge/pytest-%3E%3D5.1.0,%20%3C8.0.0-green) [![Pypi](https://img.shields.io/pypi/v/syrupy)](https://pypi.org/project/syrupy/) [![Wheel](https://img.shields.io/pypi/wheel/syrupy)](https://pypi.org/project/syrupy/) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/syrupy) [![PyPI - Downloads](https://img.shields.io/pypi/dm/syrupy)](https://pypi.org/project/syrupy/) [![PyPI - License](https://img.shields.io/pypi/l/syrupy)](./LICENSE)

![Build Status](https://github.com/tophat/syrupy/workflows/Syrupy%20CICD/badge.svg) [![codecov](https://codecov.io/gh/tophat/syrupy/branch/master/graph/badge.svg)](https://codecov.io/gh/tophat/syrupy)

Expand Down
Loading

0 comments on commit 17f0660

Please sign in to comment.