Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: main

on:
push:
branches:
- 'master'
tags:
- "*"
pull_request:
branches:
- 'master'

env:
PYTEST_ADDOPTS: "--color=yes"

jobs:
tests:
name: Unit Tests (Python ${{ matrix.python-version }})
runs-on: ubuntu-20.04

strategy:
matrix:
python-version:
- 3.6
- 3.7
- 3.8
- 3.9
- 3.10-dev

steps:
- uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade tox tox-py

- name: Run tox targets for ${{ matrix.python-version }}
run: tox --py current

- name: Upload code coverage
if: matrix.python-version == '3.6'
uses: codecov/codecov-action@v2
with:
files: ./coverage.xml
flags: unittests

integration-tests:
name: Integration Tests (Python 3.6 ${{ matrix.os }})
runs-on: ${{ matrix.os }}

strategy:
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
- windows-latest
- macos-latest

steps:
- uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.6

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade tox

- name: Run tox
run: tox -e integration
39 changes: 19 additions & 20 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
name: Publish
name: publish

on: workflow_dispatch
on:
release:
types:
- published
workflow_dispatch:

jobs:
publish:
name: Publish distributions to PyPI
environment:
name: PyPI
url: https://pypi.org/project/pytest-motor/
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python 3.6
uses: actions/setup-python@v2
with:
python-version: 3.6

- name: Cache pip packages
uses: actions/cache@v2
env:
cache-name: pip-packages-cache
with:
path: ~/.cache/pip
key: ${{ env.cache-name }}-publish-${{ hashFiles('requirements/frozen/frozen_test_requirements.txt') }}
restore-keys: |
${{ env.cache-name }}-publish-
${{ env.cache-name }}-

- name: Build a Python source distrubution and wheel
- name: Install dependencies
run: |
./scripts/build.sh
python -m pip install --upgrade pip
pip install --upgrade wheel setuptools

- name: Publish the distributions
run: |
./scripts/publish.sh
- name: Build package
run: python setup.py sdist bdist_wheel

- name: Publish package
uses: pypa/gh-action-pypi-publish@v1.4.2
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
181 changes: 0 additions & 181 deletions .github/workflows/python.yaml

This file was deleted.

9 changes: 5 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
*.pyc
/venvs/*
!/venvs/.gitkeep
/dist/*
!/dist/.gitkeep
/.venv/*
!/.venv/.gitkeep
/*coverage*
/.mypy_cache
/.mongod
/.mongo_databases
/pytest_motor.egg-info
/.tox
34 changes: 34 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/pycqa/isort
rev: 5.9.3
hooks:
- id: isort
- repo: https://github.com/google/yapf
rev: v0.31.0
hooks:
- id: yapf
additional_dependencies: [toml]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910
hooks:
- id: mypy
name: mypy-plugin
files: pytest_motor/
- id: mypy
name: mypy-unit-tests
files: tests/unit/
- id: mypy
name: mypy-integration-tests
files: tests/integration/
- repo: https://github.com/pycqa/pylint
rev: v2.10.2
hooks:
- id: pylint
args: ["--output-format=colorized", "pytest_motor", "tests", "setup.py", "--disable=E0401"]
File renamed without changes.
2 changes: 0 additions & 2 deletions .yapfignore

This file was deleted.

Loading