Start testing in Github Actions

This commit is contained in:
Ashley Whetter 2021-04-04 18:50:39 -07:00
parent 826bb2badd
commit 66f3734afa
9 changed files with 47 additions and 92 deletions

34
.github/workflows/main.yml vendored Normal file
View File

@ -0,0 +1,34 @@
name: tests
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
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 --upgrade pip setuptools wheel
python -m pip install tox
- name: Run tests
run: tox -e py
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install tox
- name: Lint
run: tox -e formatting,lint

View File

@ -1,26 +0,0 @@
os: linux
dist: xenial
language: python
install:
- pip install tox-travis
script:
- tox
python:
- 3.6
- 3.7
- 3.8
- 3.9
jobs:
include:
- python: 3.9
env: TOXENV=docs
- python: 3.9
env: TOXENV=lint
- python: 3.9
env: TOXENV=formatting
notifications:
slack:
rooms:
- readthedocs:y3hjODOi7EIz1JAbD1Zb41sz#random
on_success: change
on_failure: always

View File

@ -10,7 +10,6 @@ Features
^^^^^^^^ ^^^^^^^^
* Expandable value for multi-line string attributes. * Expandable value for multi-line string attributes.
* Added support for Sphinx 3.5.
* `#265 <https://github.com/readthedocs/sphinx-autoapi/issues/265>` * `#265 <https://github.com/readthedocs/sphinx-autoapi/issues/265>`
Can resolve the qualified paths of parameters to generics. Can resolve the qualified paths of parameters to generics.

View File

@ -5,13 +5,9 @@ Sphinx AutoAPI
:target: https://sphinx-autoapi.readthedocs.org :target: https://sphinx-autoapi.readthedocs.org
:alt: Documentation :alt: Documentation
.. image:: https://travis-ci.org/readthedocs/sphinx-autoapi.svg?branch=master .. image:: https://github.com/readthedocs/sphinx-autoapi/actions/workflows/main.yml/badge.svg?branch=master
:target: https://travis-ci.org/readthedocs/sphinx-autoapi :target: https://github.com/readthedocs/sphinx-autoapi/actions/workflows/main.yml?query=branch%3Amaster
:alt: Travis Build Status :alt: Github Build Status
.. image:: https://ci.appveyor.com/api/projects/status/5nd33gp2eq7411t1?svg=true
:target: https://ci.appveyor.com/project/ericholscher/sphinx-autoapi
:alt: Appveyor Build Status
.. image:: https://img.shields.io/pypi/v/sphinx-autoapi.svg .. image:: https://img.shields.io/pypi/v/sphinx-autoapi.svg
:target: https://pypi.org/project/sphinx-autoapi/ :target: https://pypi.org/project/sphinx-autoapi/

View File

@ -1,13 +0,0 @@
build: false
environment:
matrix:
- PYTHON: "C:/Python37"
install:
- ps: "[Net.ServicePointManager]::SecurityProtocol = 'Ssl3, Tls, Tls11, Tls12'"
- ps: "Start-FileDownload 'https://bootstrap.pypa.io/get-pip.py' -FileName 'C:/get-pip.py'"
- "%PYTHON%/python.exe C:/get-pip.py"
- "%PYTHON%/Scripts/pip.exe --version"
- "%PYTHON%/Scripts/pip.exe install tox"
test_script:
- "git clone https://github.com/aspnet/Identity %APPVEYOR_BUILD_FOLDER%/tests/dotnetexample/example/Identity"
- "%PYTHON%/Scripts/tox.exe -e py37"

View File

@ -405,12 +405,13 @@ def _resolve_annotation(annotation):
resolved = resolve_qualname(annotation, annotation.as_string()) resolved = resolve_qualname(annotation, annotation.as_string())
elif isinstance(annotation, astroid.Subscript): elif isinstance(annotation, astroid.Subscript):
value = _resolve_annotation(annotation.value) value = _resolve_annotation(annotation.value)
if isinstance(annotation.slice, astroid.Tuple): slice_node = annotation.slice
slice_ = ", ".join( if isinstance(slice_node, astroid.Index):
_resolve_annotation(elt) for elt in annotation.slice.elts slice_node = slice_node.value
) if isinstance(slice_node, astroid.Tuple):
slice_ = ", ".join(_resolve_annotation(elt) for elt in slice_node.elts)
else: else:
slice_ = _resolve_annotation(annotation.slice) slice_ = _resolve_annotation(slice_node)
resolved = f"{value}[{slice_}]" resolved = f"{value}[{slice_}]"
elif isinstance(annotation, astroid.Tuple): elif isinstance(annotation, astroid.Tuple):
resolved = ( resolved = (

View File

@ -1,24 +0,0 @@
strictness: low
test-warnings: false
doc-warnings: true
ignore-paths:
- docs
- tests
pep8:
run: false
pylint:
max-line-length: 100
disable:
- interface-not-implemented
# We still support Python 2 so we have to inherit from object
- useless-object-inheritance
mccabe:
run: false
pep257:
run: false

2
setup.py Normal file
View File

@ -0,0 +1,2 @@
from setuptools import setup
setup()

18
tox.ini
View File

@ -1,32 +1,18 @@
[tox] [tox]
isolated_build = true isolated_build = true
envlist = envlist =
py{36,37,38,39}-sphinx{30,31,32,33,34,35} # Keep this in sync with .github/workflows/main.yml
py{36,37,38,39}
formatting formatting
lint lint
docs docs
[travis]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
[testenv] [testenv]
setenv =
LANG=C
extras = extras =
dotnet dotnet
go go
deps = deps =
pytest pytest
sphinx30: Sphinx<3.1
sphinx31: Sphinx<3.2
sphinx32: Sphinx<3.3
sphinx33: Sphinx<3.4
sphinx34: Sphinx<3.5
sphinx35: Sphinx<3.6
commands = commands =
pytest {posargs} pytest {posargs}