diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..4e99d769 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: Release +on: + push: + tags: + - "*" +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Checkout code + uses: actions/checkout@v2 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install ".[dev]" wheel + - name: Fetch web assets + run: inv assets + - name: Publish + env: + TWINE_USERNAME: "__token__" + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..b142cb80 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,65 @@ +name: Tests +on: + - push + - pull_request +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [2.7, 3.5, 3.6, 3.7, 3.8, pypy2, pypy3] + steps: + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Checkout code + uses: actions/checkout@v2 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install ".[dev]" + - name: Test with inv + run: inv cover qa + - name: Coveralls + run: | + pip install coveralls + coveralls --rcfile=coverage.rc + env: + COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} + bench: + needs: test + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Checkout ${{ github.base_ref }} + uses: actions/checkout@v2 + with: + ref: ${{ github.base_ref}} + path: base + - name: Checkout ${{ github.ref }} + uses: actions/checkout@v2 + with: + ref: ${{ github.ref}} + path: ref + - name: Install dev dependencies + run: | + python -m pip install --upgrade pip + pip install -e "base[dev]" + - name: Install ci dependencies for ${{ github.base_ref }} + run: pip install -e "base[ci]" + - name: Benchmarks for ${{ github.base_ref }} + run: | + cd base + inv benchmark --max-time 4 --save + mv .benchmarks ../ref/ + - name: Install ci dependencies for ${{ github.ref }} + run: pip install -e "ref[ci]" + - name: Benchmarks for ${{ github.ref }} + run: | + cd ref + inv benchmark --max-time 4 --compare diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f659c7b7..00000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -language: python -python: - - '2.7' - - '3.4' - - '3.5' - - '3.6' - - '3.7' - - '3.8' - - pypy - - pypy3 -jobs: - allow_failures: - - python: pypy3 - - python: '3.8' -install: - - pip install .[dev] -script: - - inv cover qa -after_success: - - pip install coveralls - - coveralls --rcfile=coverage.rc - - "./travis-bench-after-success.sh" -before_deploy: - - inv assets -deploy: - provider: pypi - user: "__token__" - password: - secure: Bhk0mw7iFn+kan/rBdegQe2gbvtTd12hCxZzHwZCCgyu6xCK4UT/6eW6KucT1BP5sOzCteYzRcdg5PBLLwXaKXuSVtGmdZwmQcVRgWuXCA9/9YdPJSCSO3dHoVYpiXP9Tc72qPVi/Wwj9t2U7V8IcGoH4NDJn8XM2dFSYHm/ZhXQCSBcXLjLx7EI1M7yXo4h3tLfEka9+VZ8jdEsP6NATaJIeBqo4X4hZj2n2ux6Q0CyxqQWsTx0iQUsKrML7a5lE9vz7Mk21NkZLb8LAg3lRrYEyC2rIdhXOxDED410MGpwMQDZ8MUF85vB1ri/EFLfcRvbFs8+W0vrqltmABlwoymvmtw4B/lbRyjmArjYKk8CCeK5z5KVx+QICrxXMEG/4CeS5vQCz/0uB+Fzu0Xv44kslOSaFewwow/arke80WzdzecBzAi+HANb1L7hufRb63tkmf0Uz3JX5HplI31FbT/pQoL1pZtFoHC9u3/iqYY39z/3Jv8+gop5ZX1WaIgxBxfCIVqx//p3pq9LYkI8zdFv54tD8UiKKJiwAzMIrYQJLkB5RtKBYxoyBXOdYb0H9vVWISXcwQVuKJiQWO/GDjE1KX3TApHSz73DqMemuG5BYDCf9qIbm49rYY57NyFNvgLJVZCwgrY5J9Otmk+e5sjGo3wkOWOriAO6QH7RqEI= - on: - tags: true - skip_existing: true - skip_cleanup: true diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 79488f87..b5e621d1 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -110,7 +110,7 @@ Release process --------------- The new releases are pushed on `Pypi.org `_ automatically -from `travis-ci `_ when we add a new tag (unless the +from `GitHub Actions `_ when we add a new tag (unless the tests are failing). Updating Copyright diff --git a/README.rst b/README.rst index 4a63534c..7fab925e 100644 --- a/README.rst +++ b/README.rst @@ -2,9 +2,9 @@ Flask RESTX =========== -.. image:: https://secure.travis-ci.org/python-restx/flask-restx.svg?branch=master - :target: https://travis-ci.org/python-restx/flask-restx?branch=master - :alt: Build status +.. image:: https://github.com/python-restx/flask-restx/workflows/Tests/badge.svg?branch=master&event=push + :target: https://github.com/python-restx/flask-restx/actions?query=workflow%3ATests + :alt: Tests status .. image:: https://coveralls.io/repos/github/python-restx/flask-restx/badge.svg?branch=master :target: https://coveralls.io/github/python-restx/flask-restx?branch=master :alt: Code coverage diff --git a/setup.py b/setup.py index 92d41864..33ab6234 100644 --- a/setup.py +++ b/setup.py @@ -97,10 +97,10 @@ def pip(filename): 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Software Development :: Libraries :: Python Modules', 'License :: OSI Approved :: BSD License', diff --git a/travis-bench-after-success.sh b/travis-bench-after-success.sh deleted file mode 100755 index 70020a17..00000000 --- a/travis-bench-after-success.sh +++ /dev/null @@ -1,63 +0,0 @@ -#!/usr/bin/env bash -# -# Perform benchmark and compare with base branch results. -# Only here for information purpose -# Adapted from: -# - http://sunjay.ca/2017/04/27/rust-benchmark-comparison-travis -# - https://beachape.com/blog/2016/11/02/rust-performance-testing-on-travis-ci/ - -set -e -set -x - -# The Travis environment variables behave like so: -# TRAVIS_BRANCH -# - if PR build, this is the pr base branch -# - if push build, this is the branch that was pushed -# TRAVIS_PULL_REQUEST_BRANCH -# - if PR build, this is the "target" of the pr, i.e. not the base branch -# - if push build, this is blank -# -# Example: -# You open a PR with base `master`, and PR branch `foo` -# During a PR build: -# TRAVIS_BRANCH=master -# TRAVIS_PULL_REQUEST_BRANCH=foo -# During a push build: -# TRAVIS_BRANCH=foo -# TRAVIS_PULL_REQUEST_BRANCH= - -# Only run on branches -if [ "${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" != "master" ]; then - REMOTE_URL="$(git config --get remote.origin.url)" - - # Clone the repository fresh..for some reason checking out master fails - # from a normal PR build's provided directory - cd ${TRAVIS_BUILD_DIR}/.. - git clone ${REMOTE_URL} "${TRAVIS_REPO_SLUG}-bench" - cd "${TRAVIS_REPO_SLUG}-bench" - - # Bench the pull request base or master - if [ -n "$TRAVIS_PULL_REQUEST_BRANCH" ]; then - git checkout -f "$TRAVIS_BRANCH" - else # this is a push build - # This could be replaced with something better like asking git which - # branch is the base of $TRAVIS_BRANCH - git checkout -f master - fi - - # Install dependencies in case of change between commits - pip install -e .[ci] - - # Perform benchmark and save result for comparison - inv benchmark --max-time 4 --save - - # Bench the current commit that was pushed - git checkout -f "${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}" - - # Install dependencies in case of change between commits - pip install -e .[ci] - - # Perform benchmark and compare with previous result - inv benchmark --max-time 4 --compare - -fi