From bc473fece66c88793abe1b3ac2de4b7fb4f7351e Mon Sep 17 00:00:00 2001 From: Hudson Brendon Date: Thu, 26 Dec 2024 00:37:45 -0300 Subject: [PATCH] refactor: fix python package ci --- .github/workflows/python-package.yml | 35 -------------------------- .github/workflows/pythonpackage.yml | 37 ++++++++++++++++++++++++++++ Makefile | 16 ------------ 3 files changed, 37 insertions(+), 51 deletions(-) delete mode 100644 .github/workflows/python-package.yml create mode 100644 .github/workflows/pythonpackage.yml delete mode 100644 Makefile diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml deleted file mode 100644 index f824329..0000000 --- a/.github/workflows/python-package.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Python Musixmatch - -on: - workflow_dispatch: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: 3.9.6 - - - name: Install poetry - uses: snok/install-poetry@v1.2.0 - with: - version: 1.1.8 - virtualenvs-create: false - virtualenvs-in-project: false - - - name: Install dependencies - run: poetry install - - - name: Outdated dependencies - run: poetry show -o - - - name: Run Tests - run: | - make dev diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml new file mode 100644 index 0000000..1259dac --- /dev/null +++ b/.github/workflows/pythonpackage.yml @@ -0,0 +1,37 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python package + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install poetry + python -m poetry install + - name: Lint with ruff + run: | + poetry run ruff check + - name: Test with pytest + run: | + poetry run pytest \ No newline at end of file diff --git a/Makefile b/Makefile deleted file mode 100644 index 9e9f29e..0000000 --- a/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -install: - poetry run python setup.py install - -test: - poetry run pytest tests/tests.py - -black: - poetry run black . - -black-check: - poetry run black . --check - -dev: - make black - make install - make test \ No newline at end of file