Skip to content

Commit

Permalink
Merge pull request #14 from palfrey/github-ci
Browse files Browse the repository at this point in the history
Add Github Actions CI
  • Loading branch information
DavisRayM authored Jan 8, 2023
2 parents 94153f8 + ec17f1a commit 77aa1cd
Show file tree
Hide file tree
Showing 10 changed files with 205 additions and 713 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
ci:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Upgrade pip
run: pip install --upgrade pip

- name: Install requirements (3.7+)
run: |
pip install -r requirements.txt

- name: Black
run: black --check django_filters-stubs/

- name: isort
run: isort --check django_filters-stubs

- name: flake8
run: flake8

- name: pytest
run: pytest -vvv
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

16 changes: 0 additions & 16 deletions Pipfile

This file was deleted.

658 changes: 0 additions & 658 deletions Pipfile.lock

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PEP-484 Stubs for django-filter ::: Beta

[![Build Status](https://travis-ci.org/DavisRayM/django-filter-stubs.svg?branch=master)](https://travis-ci.org/DavisRayM/django-filter-stubs)
[![CI](https://github.com/DavisRayM/django-filter-stubs/actions/workflows/ci.yml/badge.svg)](https://github.com/DavisRayM/django-filter-stubs/actions/workflows/ci.yml)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)

This package contains type subs to provide more precise static types for Django Filters.
Expand Down
6 changes: 3 additions & 3 deletions django_filters-stubs/widgets.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Any, Dict, Optional, Tuple

from django import forms
from django.forms.renderers import EngineMixin
from django.forms.renderers import BaseRenderer
from django.utils.safestring import SafeText

_OptAttrs = Dict[str, Any]
Expand All @@ -11,13 +11,13 @@ class LinkWidget(forms.Widget):
def __init__(self, attrs: Optional[Any] = ..., choices: Any = ...) -> None: ...
data: Any = ...
def value_from_datadict(self, data: Any, files: Any, name: Any): ...
def render(
def render( # type: ignore[override]
self,
name: str,
value: Any,
attrs: Optional[_OptAttrs] = ...,
choices: Tuple = ...,
renderer: Optional[EngineMixin] = ...,
renderer: Optional[BaseRenderer] = ...,
) -> SafeText: ...
def render_options(self, choices: Any, selected_choices: Any, name: Any): ...
def render_option(
Expand Down
7 changes: 7 additions & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-e .

black
flake8
isort
pytest-mypy-plugins
pip-tools
146 changes: 146 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
#
# This file is autogenerated by pip-compile with Python 3.7
# by the following command:
#
# pip-compile
#
-e .
# via -r requirements.in
asgiref==3.6.0
# via django
attrs==22.2.0
# via pytest
black==22.12.0
# via -r requirements.in
build==0.9.0
# via pip-tools
certifi==2022.12.7
# via requests
charset-normalizer==2.1.1
# via requests
chevron==0.14.0
# via pytest-mypy-plugins
click==8.1.3
# via
# black
# pip-tools
decorator==5.1.1
# via pytest-mypy-plugins
django==3.2.16
# via
# django-stubs
# django-stubs-ext
django-stubs==1.13.1
# via
# django-filter-stubs
# djangorestframework-stubs
django-stubs-ext==0.7.0
# via django-stubs
djangorestframework-stubs==1.8.0
# via django-filter-stubs
exceptiongroup==1.1.0
# via pytest
flake8==5.0.4
# via -r requirements.in
idna==3.4
# via requests
importlib-metadata==4.2.0
# via
# build
# click
# flake8
# pep517
# pluggy
# pytest
iniconfig==1.1.1
# via pytest
isort==5.11.4
# via -r requirements.in
mccabe==0.7.0
# via flake8
mypy==0.991
# via
# django-filter-stubs
# django-stubs
# djangorestframework-stubs
# pytest-mypy-plugins
mypy-extensions==0.4.3
# via
# black
# mypy
packaging==22.0
# via
# build
# pytest
pathspec==0.10.3
# via black
pep517==0.13.0
# via build
pip-tools==6.12.1
# via -r requirements.in
platformdirs==2.6.2
# via black
pluggy==1.0.0
# via pytest
pycodestyle==2.9.1
# via flake8
pyflakes==2.5.0
# via flake8
pytest==7.2.0
# via pytest-mypy-plugins
pytest-mypy-plugins==1.10.1
# via -r requirements.in
pytz==2022.7
# via django
pyyaml==6.0
# via pytest-mypy-plugins
regex==2022.10.31
# via pytest-mypy-plugins
requests==2.28.1
# via djangorestframework-stubs
sqlparse==0.4.3
# via django
tomli==2.0.1
# via
# black
# build
# django-stubs
# mypy
# pep517
# pytest
typed-ast==1.5.4
# via
# black
# mypy
types-pytz==2022.7.0.0
# via django-stubs
types-pyyaml==6.0.12.2
# via
# django-stubs
# djangorestframework-stubs
types-requests==2.28.11.7
# via djangorestframework-stubs
types-urllib3==1.26.25.4
# via types-requests
typing-extensions==4.4.0
# via
# black
# django-filter-stubs
# django-stubs
# django-stubs-ext
# djangorestframework-stubs
# importlib-metadata
# mypy
# platformdirs
urllib3==1.26.13
# via requests
wheel==0.38.4
# via pip-tools
zipp==3.11.0
# via
# importlib-metadata
# pep517

# The following packages are considered to be unsafe in a requirements file:
# pip
# setuptools
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from pathlib import Path

from setuptools import setup
from pathlib import Path

name = "django-filter-stubs"

Expand All @@ -17,6 +17,7 @@ def find_stub_files(name):
result.append(f)
return result


long_description = (Path(__file__).parent / "README.md").read_text()


Expand All @@ -41,7 +42,6 @@ def find_stub_files(name):
classifiers=[
"Development Status :: 1 - Planning",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
],
)
4 changes: 1 addition & 3 deletions tests/test_imports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@
import django_filters.widgets
import django_filters.rest_framework.backends
import django_filters.rest_framework.filters
import django_filters.rest_framework.filterset
out: |
../../home/travis/build/DavisRayM/django-filter-stubs/django_filters-stubs/widgetsi:14: error: Signature of "render" incompatible with supertype "Widget"
import django_filters.rest_framework.filterset

0 comments on commit 77aa1cd

Please sign in to comment.