From 26adcc468a013e5105a9509eb0c7d9e6cf34f2ba Mon Sep 17 00:00:00 2001 From: Alessio Bogon Date: Fri, 16 Apr 2021 09:27:31 +0200 Subject: [PATCH] Switch to GitHub actions (#417) * Add github workflow for testing * Add .editorconfig * setup.py -> setup.cfg * Remove .travis.yml * Test on the python python 3.10 (alpha) --- .editorconfig | 18 +++++++++++++ .github/workflows/main.yml | 30 +++++++++++++++++++++ .travis.yml | 18 ------------- setup.cfg | 46 ++++++++++++++++++++++++++++++++ setup.py | 54 +------------------------------------- tox.ini | 10 ++++++- 6 files changed, 104 insertions(+), 72 deletions(-) create mode 100644 .editorconfig create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d0aaa1e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 + +[*.py] +indent_style = space +indent_size = 4 + +[*.yml] +indent_style = space +indent_size = 2 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..ed8fd48 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,30 @@ +name: Main testing workflow + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.6", "3.7", "3.8", "3.9", 3.10.0-alpha.6] + + 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 + pip install -U setuptools + pip install tox tox-gh-actions codecov + - name: Test with tox + run: | + tox + codecov diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index db0a38b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -dist: bionic -language: python -python: -- '3.6' -- '3.7' -- '3.8' -- '3.9' -install: pip install tox tox-travis coverage codecov -script: tox --recreate -branches: - except: - - "/^\\d/" -after_success: -- codecov -notifications: - email: - - bubenkoff@gmail.com - - oleg.pidsadnyi@gmail.com diff --git a/setup.cfg b/setup.cfg index 2a9acf1..6553a08 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,48 @@ +[metadata] +name = pytest-bdd +description = BDD for pytest +long_description = file: README.rst, AUTHORS.rst, CHANGES.rst +long_description_content_type = text/x-rst +author = Oleg Pidsadnyi, Anatoly Bubenkov and others +license = MIT license +author_email = oleg.pidsadnyi@gmail.com +url = https://github.com/pytest-dev/pytest-bdd +version = attr: pytest_bdd.__version__ +classifiers = + Development Status :: 6 - Mature + Intended Audience :: Developers + License :: OSI Approved :: MIT License + Operating System :: POSIX + Operating System :: Microsoft :: Windows + Operating System :: MacOS :: MacOS X + Topic :: Software Development :: Testing + Topic :: Software Development :: Libraries + Topic :: Utilities + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + +[options] +python_requires = >=3.6 +install_requires = + glob2 + Mako + parse + parse_type + py + pytest>=4.3 + +tests_require = tox +packages = pytest_bdd +include_package_data = True + +[options.entry_points] +pytest11 = + pytest-bdd = pytest_bdd.plugin +console_scripts = + pytest-bdd = pytest_bdd.scripts:main + [bdist_wheel] universal = 1 diff --git a/setup.py b/setup.py index f5f4949..6068493 100755 --- a/setup.py +++ b/setup.py @@ -1,55 +1,3 @@ -#!/usr/bin/env python -"""pytest-bdd package config.""" - -import codecs -import os -import re - from setuptools import setup -dirname = os.path.dirname(__file__) - -long_description = ( - codecs.open(os.path.join(dirname, "README.rst"), encoding="utf-8").read() - + "\n" - + codecs.open(os.path.join(dirname, "AUTHORS.rst"), encoding="utf-8").read() -) - -with codecs.open(os.path.join(dirname, "pytest_bdd", "__init__.py"), encoding="utf-8") as fd: - VERSION = re.compile(r".*__version__ = ['\"](.*?)['\"]", re.S).match(fd.read()).group(1) - -setup( - name="pytest-bdd", - description="BDD for pytest", - long_description=long_description, - long_description_content_type="text/x-rst", - author="Oleg Pidsadnyi, Anatoly Bubenkov and others", - license="MIT license", - author_email="oleg.pidsadnyi@gmail.com", - url="https://github.com/pytest-dev/pytest-bdd", - version=VERSION, - classifiers=[ - "Development Status :: 6 - Mature", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: POSIX", - "Operating System :: Microsoft :: Windows", - "Operating System :: MacOS :: MacOS X", - "Topic :: Software Development :: Testing", - "Topic :: Software Development :: Libraries", - "Topic :: Utilities", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 3", - ] - + [("Programming Language :: Python :: %s" % x) for x in "3.6 3.7 3.8 3.9".split()], - python_requires=">=3.6", - install_requires=["glob2", "Mako", "parse", "parse_type", "py", "pytest>=4.3"], - # the following makes a plugin available to pytest - entry_points={ - "pytest11": ["pytest-bdd = pytest_bdd.plugin"], - "console_scripts": ["pytest-bdd = pytest_bdd.scripts:main"], - }, - tests_require=["tox"], - packages=["pytest_bdd"], - include_package_data=True, -) +setup() diff --git a/tox.ini b/tox.ini index 52138d9..219b1cb 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ distshare = {homedir}/.tox/distshare envlist = py38-pytestlatest-linters, py39-pytest{43,44,45,46,50,51,52,53,54,60,61,62, latest}-coverage, - py{36,37,38}-pytestlatest-coverage, + py{36,37,38,310}-pytestlatest-coverage, py39-pytestlatest-xdist-coverage skip_missing_interpreters = true @@ -34,3 +34,11 @@ commands = {env:_PYTEST_CMD:pytest} {env:_PYTEST_MORE_ARGS:} {posargs:-vvl} [testenv:py38-pytestlatest-linters] deps = black commands = black --check --verbose setup.py docs pytest_bdd tests + +[gh-actions] +python = + 3.6: py36 + 3.7: py37 + 3.8: py38 + 3.9: py39 + 3.10: py310