From 29dfe7b71b081964a679c4d30346b0f9a16dc518 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= Date: Sun, 29 Sep 2024 15:49:39 +0100 Subject: [PATCH] chore: better automation --- .github/workflows/deploy.yml | 24 ++++++++++++++++ .github/workflows/main.yml | 55 ++++++++++++++++++++++++++++++++++++ .travis.yml | 34 ---------------------- CHANGELOG.md | 20 +++++++++++++ README.md | 44 ++++++++++++++--------------- 5 files changed, 121 insertions(+), 56 deletions(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..dc8ddae --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,24 @@ +name: Deploy Workflow +on: + push: + tags: + - "*" +jobs: + build: + name: Build + strategy: + matrix: + python-version: [2.7] + runs-on: ubuntu-latest + container: python:${{ matrix.python-version }} + steps: + - uses: actions/checkout@v4 + - run: python --version + - run: pip install -r requirements.txt + - run: python setup.py test + - run: pip install twine wheel + - run: python setup.py sdist bdist_wheel + - run: python -m twine upload -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD} dist/* + env: + PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} + PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..bd53800 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,55 @@ +name: Main Workflow +on: [push] +jobs: + build: + name: Build + strategy: + matrix: + python-version: [ + 2.7, + 3.5, + 3.6, + 3.7, + 3.8, + 3.9, + "3.10", + "3.11", + "3.12", + latest, + rc + ] + runs-on: ubuntu-latest + container: python:${{ matrix.python-version }} + steps: + - uses: actions/checkout@v4 + - run: python --version + - run: pip install -r requirements.txt + - run: | + pip install black + black . --check + if: matrix.python-version == '3.12' + - run: | + pip install pytest + pytest + - run: python setup.py test + if: matrix.python-version != '3.12' && matrix.python-version != 'latest' + build-pypy: + name: Build PyPy + strategy: + matrix: + python-version: [2.7, 3.6, 3.9, "3.10"] + runs-on: ubuntu-latest + container: pypy:${{ matrix.python-version }} + steps: + - uses: actions/checkout@v4 + - run: pypy --version + - run: pip install -r requirements.txt + - run: | + pip install black + black . --check + if: matrix.python-version == '3.12' + - run: | + pip install pytest + pytest + - run: pypy setup.py test + if: matrix.python-version != '3.12' && matrix.python-version != 'latest' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9fb0574..0000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -dist: trusty -language: python -python: - - "2.7" - - "3.4" - - "3.5" - - "3.6" - - "pypy3" -matrix: - include: - - python: 3.8 - dist: xenial - - python: 3.9 - dist: xenial - - python: pypy - dist: xenial - - python: pypy3 - dist: xenial -before_install: - - pip install --upgrade pip setuptools -install: - - pip install -r requirements.txt - - if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then pip install coveralls; fi -script: if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then coverage run --source=slack setup.py test; else python setup.py test; fi -after_success: if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then coveralls; fi -deploy: - provider: pypi - user: joamag - password: - secure: jk2xD3tclhGxmoPcHY1ukLidAYw6MlVL5NmztDQjrv9S+ILJ7q0b9iu9+8kYSpzPlbV/OHg7NGthbFTaxJcfAlz+K/CEQ6wX5V5J+RmT02AH2FlHuSKsK/CXmzR6SnXNlppbcCDB1sCSLertmlYZd29ZBEV3E3d/1+uG2/NtHRKGvWopriEmuUMo8XL1WRYhBxRmP470hrptLGMka7zRE5t3m7V5XQEgxp81rm7D/NOavbxR+YKBV2j7vRyH4gSzToqrn+fJmT587MVm3G9tePI1KeZGj/9Yy/pvGaAIiVZwsoSPFeIclTsRBtazv74rplifUWFq2aw7sbLG9p8WADxS8uMAfMwz8TUEHrHM8IdZ+b1lSxUXtRlM9b2pmetqKtH5oZZnigUqPGysNJemhJt43cSgVFIw+9Bri9RzSy+qvfMcPbC1JA6Af2ifcPYNEHBZR4f7OQgRBFEQ6wb7S9gl9GYFESPjzdp62s5mJE+GIV6PapHHXuwkvSnydYL+FhqbqEkF3vQqm8xALowhpWEXAMpCz6tdIGo7Yt8LWw3iG7UDgXSAXT0zCoJ1s9IjxQTLa/mq6qPqN7agjEyfh5VdRkgNWOcDuMX65YFngGolKpLpcgNUTSpvz7qP1oxt/U0ocFibxdlTDd+Ize+t+emp5mmdihoYH4zeIQaA53w= - distributions: sdist bdist_wheel - on: - tags: true - python: "2.7" diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..422a07e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,20 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +### Added + +* + +### Changed + +* Better code structure aligned with black + +### Fixed + +* diff --git a/README.md b/README.md index 056faf5..82ddee9 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,22 @@ -# [Slack API](http://slack-api.hive.pt) - -Implementation of the Slack OAuth based API. - -## Configuration - -| Name | Type | Description | -| ----- | ----- | ----- | -| **SLACK_ID** | `str` | The Slack identifier to make API requests (defaults to `None`). | -| **SLACK_SECRET** | `str` | The secret key to be used to authenticate API requests (defaults to `None`). | -| **SLACK_REDIRECT_URL** | `str` | The URL to be used for the OAuth redirection process (defaults to `None`). | - -## License - -Slack API is currently licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/). - -## Build Automation - -[![Build Status](https://app.travis-ci.com/hivesolutions/slack-api.svg?branch=master)](https://travis-ci.com/github/hivesolutions/slack-api) -[![Coverage Status](https://coveralls.io/repos/hivesolutions/slack-api/badge.svg?branch=master)](https://coveralls.io/r/hivesolutions/slack-api?branch=master) -[![PyPi Status](https://img.shields.io/pypi/v/slack-api.svg)](https://pypi.python.org/pypi/slack-api) -[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://www.apache.org/licenses/) +# [Slack API](http://slack-api.hive.pt) + +Implementation of the Slack OAuth based API. + +## Configuration + +| Name | Type | Description | +| ---------------------- | ----- | ---------------------------------------------------------------------------- | +| **SLACK_ID** | `str` | The Slack identifier to make API requests (defaults to `None`). | +| **SLACK_SECRET** | `str` | The secret key to be used to authenticate API requests (defaults to `None`). | +| **SLACK_REDIRECT_URL** | `str` | The URL to be used for the OAuth redirection process (defaults to `None`). | + +## License + +Slack API is currently licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/). + +## Build Automation + +[![Build Status](https://github.com/hivesolutions/slack-api/workflows/Main%20Workflow/badge.svg)](https://github.com/hivesolutions/slack-api/actions) +[![Coverage Status](https://coveralls.io/repos/hivesolutions/slack-api/badge.svg?branch=master)](https://coveralls.io/r/hivesolutions/slack-api?branch=master) +[![PyPi Status](https://img.shields.io/pypi/v/slack-api.svg)](https://pypi.python.org/pypi/slack-api) +[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://www.apache.org/licenses/)