diff --git a/.editorconfig b/.editorconfig index f511094..e97f894 100644 --- a/.editorconfig +++ b/.editorconfig @@ -32,8 +32,8 @@ indent_size = 4 [*.{css,html,js,json,yml}] indent_size = 2 -# Matches the exact files either package.json or .travis.yml -[{package.json,.travis.yml}] +# Matches the exact files either package.json or .github/workflows/*.yml +[{package.json, .github/workflows/*.yml}] indent_size = 2 # Dockerfile diff --git a/.github/workflows/pypi-release.yml b/.github/workflows/pypi-release.yml new file mode 100644 index 0000000..7acfdc8 --- /dev/null +++ b/.github/workflows/pypi-release.yml @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +# +# This file is part of Invenio. +# Copyright (C) 2020 CERN. +# +# Invenio is free software; you can redistribute it and/or modify it +# under the terms of the MIT License; see LICENSE file for more details + +name: Publish + +on: + push: + tags: + - v* + +jobs: + Publish: + runs-on: ubuntu-20.04 + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.7 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel + + - name: Build package + run: python setup.py sdist bdist_wheel + + - name: Publish on PyPI + uses: pypa/gh-action-pypi-publish@v1.3.1 + with: + user: __token__ + # The token is provided by the inveniosoftware organization + password: ${{ secrets.pypi_token }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..e9bbe2d --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# +# This file is part of Invenio. +# Copyright (C) 2020 CERN. +# +# Invenio is free software; you can redistribute it and/or modify it +# under the terms of the MIT License; see LICENSE file for more details. + +name: CI + +on: + push: + branches: master + pull_request: + branches: master + schedule: + # * is a special character in YAML so you have to quote this string + - cron: '0 3 * * 6' + workflow_dispatch: + inputs: + reason: + description: 'Reason' + required: false + default: 'Manual trigger' + +jobs: + Tests: + runs-on: ubuntu-20.04 + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + + - name: Install dependencies + run: | + pip install .[all] + pip freeze + + - name: Run tests + run: | + ./run-tests.sh diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index aadba28..0000000 --- a/.travis.yml +++ /dev/null @@ -1,43 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of COUNTER-Robots. -# Copyright (C) 2018 CERN. -# -# COUNTER-Robots is free software; you can redistribute it and/or modify it -# under the terms of the MIT License; see LICENSE file for more details. - -notifications: - email: false - -sudo: false - -language: python - -python: - - "2.7" - - "3.5" - - "3.6" - -before_install: - - "travis_retry pip install --upgrade pip setuptools py" - - "travis_retry pip install twine wheel coveralls" - -install: - - "travis_retry pip install .[all]" - -script: - - "./run-tests.sh" - -after_success: - - coveralls - -deploy: - provider: pypi - user: inveniosoftware - password: - secure: "Hi762HhOSKBvjlFedZuryQsWyS2iTuFalpNzb9iQ42UaAch7roCc9gLChOBzzvLiBr14ETc17f9MLmYqvtBvnSw0N9FPtbvZsTfvjzVu4J34AFE7sK+rwIqYtaVjyCXmKlcnIwW5knjXIzx6kk8dgYa1tmb48mCzWmGoicec2wJpdmdty+vCSMVAZi10Cnu+zSDOrZjdkx8xUEBGuicnTyLM4G3PCynLTvoGa+dhrGmS/28UnB03YQJ6BnV1FhtNro+Bpgf0x9wIH6ZiQz5489TDsjalt+KglxTaqRocCiI7q3bZ2hKZFIGucQGGC+tuKc2paG6CEzz7lAaTxlaUzgJXz9al7VNS3cwujXnJqxfuXFghIfGyLYDxRQq9b1i1IcrtyQyvVy22x3CdBu1SW/4LZp8vNV8iHvlmBGs3/Cj6TsiKqEYLTmRp4JX+32skRXimkhoDCXTJqxNVvQEIXerv64PbPCwwDM81cy/XelmEE/xom6677FyoOE+dfCKUxlBFi79Lei+V7Cz+904WhDUX8ohZyRx78SfUlCnlqaU8YNEKgsR3zR8rHAMhEkkPfYrlht6pBIqygA/mTuxeUJReYAcKuCEvEipCrVcPxmKkZnRdcwsnp5swj8elVUvPadft73WJFE+UcG7x5yFiNiXzI+hv/qveR9f5fRCfhw0=" - distributions: "sdist bdist_wheel" - on: - tags: true - python: "3.6" - repo: inveniosoftware/counter-robots diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 33460b2..75bc1b1 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -113,6 +113,6 @@ Before you submit a pull request, check that it meets these guidelines: 1. The pull request should include tests and must not decrease test coverage. 2. If the pull request adds functionality, the docs should be updated. Put your new functionality into a function with a docstring. -3. The pull request should work for Python 2.7, 3.5 and 3.6. Check - https://travis-ci.org/inveniosoftware/counter-robots/pull_requests +3. The pull request should work for 3.8. Check + https://github.com/inveniosoftware/counter-robots/actions?query=event%3Apull_request and make sure that the tests pass for all supported Python versions. diff --git a/MANIFEST.in b/MANIFEST.in index be88749..6f8deb5 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -14,6 +14,7 @@ include *.sh include LICENSE include pytest.ini prune docs/_build +recursive-include .github/workflows *.yml recursive-include counter_robots *.po *.pot *.mo recursive-include counter_robots *.txt recursive-include docs *.bat diff --git a/README.rst b/README.rst index 8c99fba..6ceb16f 100644 --- a/README.rst +++ b/README.rst @@ -12,8 +12,8 @@ .. image:: https://img.shields.io/github/license/inveniosoftware/counter-robots.svg :target: https://github.com/inveniosoftware/counter-robots/blob/master/LICENSE -.. image:: https://img.shields.io/travis/inveniosoftware/counter-robots.svg - :target: https://travis-ci.org/inveniosoftware/counter-robots +.. image:: https://github.com/inveniosoftware/counter-robots/workflows/CI/badge.svg + :target: https://github.com/inveniosoftware/counter-robots/actions .. image:: https://img.shields.io/coveralls/inveniosoftware/counter-robots.svg :target: https://coveralls.io/r/inveniosoftware/counter-robots diff --git a/pytest.ini b/pytest.ini index ad36fb5..2f0f0bc 100644 --- a/pytest.ini +++ b/pytest.ini @@ -8,5 +8,5 @@ [pytest] pep8ignore = docs/conf.py ALL -addopts = --pep8 --doctest-glob="*.rst" --doctest-modules --cov=counter_robots --cov-report=term-missing -testpaths = docs tests counter_robots +addopts = --isort --pydocstyle --pycodestyle --doctest-glob="*.rst" --doctest-modules --cov=counter_robots --cov-report=term-missing +testpaths = tests counter_robots diff --git a/run-tests.sh b/run-tests.sh index 1822047..f6d21da 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -7,8 +7,14 @@ # COUNTER-Robots is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. -pydocstyle counter_robots tests docs && \ -isort -rc -c -df && \ -check-manifest --ignore ".travis-*" && \ -sphinx-build -qnNW docs docs/_build/html && \ +# Quit on errors +set -o errexit + +# Quit on unbound symbols +set -o nounset + +pydocstyle counter_robots tests docs +isort counter_robots tests --check-only --diff +check-manifest --ignore ".*-requirements.txt" +sphinx-build -qnNW docs docs/_build/html python setup.py test diff --git a/setup.py b/setup.py index 1aa7ff8..e5830c5 100644 --- a/setup.py +++ b/setup.py @@ -16,13 +16,7 @@ history = open('CHANGES.rst').read() tests_require = [ - 'check-manifest>=0.25', - 'coverage>=4.0', - 'isort>=4.3.3', - 'pydocstyle>=1.0.0', - 'pytest-cov>=1.8.0', - 'pytest-pep8>=1.0.6', - 'pytest>=2.8.0', + 'pytest-invenio>=1.4.0', ] extras_require = {