From be7090b9e7d68c9efc6d84ea5d7cdb473bf492bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C5=9F=C4=B1k=20Kaplan?= Date: Thu, 14 Nov 2024 06:26:18 +0300 Subject: [PATCH] Move from travis to gh actions --- .github/workflows/publish.yml | 33 +++++++++++++++++++++++++++++++++ .github/workflows/tests.yml | 30 ++++++++++++++++++++++++++++++ .pre-commit-config.yaml | 6 +++--- .travis.yml | 24 ------------------------ README.md | 2 +- iubeo/exceptions.py | 3 +-- pyproject.toml | 7 ++++++- 7 files changed, 74 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..ea6d740 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,33 @@ +name: Publish + +on: + push: + branches: + - master + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.12' + + - name: Install build tools + run: | + python -m pip install --upgrade pip setuptools wheel build + + - name: Build package + run: | + python -m build + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + username: __token__ + password: ${{ secrets.PYPI_TOKEN }} + packages-dir: dist diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..49b87bb --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,30 @@ +name: Tests + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + test: + strategy: + matrix: + python-version: ['3.10', '3.11', '3.12'] + os-version: [ubuntu-22.04] + + runs-on: ${{ matrix.os-version }} + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Run Tests + run: | + pytest discover tests/. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index baa743c..035f885 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,19 +6,19 @@ repos: - id: trailing-whitespace - repo: https://github.com/psf/black - rev: 23.1.0 + rev: 24.10.0 hooks: - id: black args: [--line-length=120] - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort args: [--profile=black, -m=3, -l=120] - repo: https://github.com/hakancelikdev/unimport - rev: 0.14.1 + rev: 1.2.1 hooks: - id: unimport args: [--remove, --include-star-import] diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 01f8275..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: python -os: linux -dist: xenial -python: - - '3.6' - - '3.7' - - '3.8' - - '3.9' -before_install: - - pip install poetry -install: - - poetry install -script: poetry run python -m unittest discover . -before_deploy: - - poetry build -deploy: - skip_cleanup: true - provider: pypi - skip_existing: true - username: isik-kaplan - password: - secure: zj91fERpjvmFcziQMvQCk1yMS1L1jdtoZMtfhuMPwzRyC4lBCYpuzCNFafDu1bB3mmrw+c7f/APRhXYshJ7o8T1efVTsppi6ZhkCD7S3PCSSwtYP363uaYQvVxP0v4viHeu5zbWwSSEgg4WS2qg4xi77zDNnjjWJ4vHdPpByYgzMqIedx+dhuyYD1jFCRQ5YzGdX4JA+3tF64fG4Zp9xQHAvtrYzknMp1ZbkRzwW8y0SW74wqUjG3y9f7ZXiqtMsvnuWi93sOSlWLLu0j1auh1MWFTDaoD8gtVWdtyGQDnjtzid096/tiDM0tFXXcF+QTu/BgBf9mfbN7sMEc/BlKw808OhddrieYPYy6ARnS6/MJJn2EMTV7TevAMOm5e0WRCieQX6BNN4m49j/fB3WSikZk256BJ0XSw/5PnNwbr8GQpWK63KjUOhMf694iIWJaiYDWOU5++pCCPDxZ/bU8CIL8afmhSjvDgUfRzVIhsDCjCyq+0QjEpsY/T0C60rXQzx8qHRmAUHR1b7zG2IUwZ6dDwl55/JdBNjP48ENchykbCkS9Uj1zBSeh/58Anvpn3X/lWgsYF8tbSqTss2MKdYh59qxZq0mxpZwXNfD6ucoaAh7Nz2BBEsc9IZxn0t0L2+gi6Cz+bdPsHZQxxS7KnUeqj2U3295QxwgVbEBvEw= - on: - branch: master diff --git a/README.md b/README.md index 51f767b..d67544d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.com/isik-kaplan/iubeo.svg?branch=master)](https://travis-ci.com/isik-kaplan/iubeo) +[![Build Status](https://github.com/isik-kaplan/iubeo/actions/workflows/tests.yml/badge.svg)](https://github.com/isik-kaplan/iubeo/actions/workflows/tests.yml/badge.svg) [![PyPI - License](https://img.shields.io/pypi/l/iubeo.svg)](https://pypi.org/project/iubeo/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/iubeo.svg)](https://pypi.org/project/iubeo/) diff --git a/iubeo/exceptions.py b/iubeo/exceptions.py index 1fa0988..7ec1339 100644 --- a/iubeo/exceptions.py +++ b/iubeo/exceptions.py @@ -3,5 +3,4 @@ """ -class ConfigError(ValueError): - ... +class ConfigError(ValueError): ... diff --git a/pyproject.toml b/pyproject.toml index 561f883..e57fcc1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "iubeo" -version = "0.2.1" +version = "0.2.2" description = "Friendlier way to write your config." authors = ["isik-kaplan "] @@ -19,6 +19,8 @@ classifiers = [ 'Development Status :: 3 - Alpha', ] +requires-python = ">=3.5" + [tool.poetry.dependencies] python = "^3.6.1" @@ -29,3 +31,6 @@ pre-commit = "^2.9.3" [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" + +[project.urls] +Homepage = "https://github.com/isik-kaplan/django_http_exceptions"