From 503066dfb7e82c795ea4a7886d811e20a1d659b5 Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 9 May 2023 05:19:38 +0000 Subject: [PATCH 1/3] Update workflows * Drop Python 3.7 * Use latest actions --- .github/workflows/django.yaml | 17 ++++------------- .github/workflows/tests.yaml | 21 ++++++--------------- metadata.cfg | 1 - 3 files changed, 10 insertions(+), 29 deletions(-) diff --git a/.github/workflows/django.yaml b/.github/workflows/django.yaml index 4e18374a..33e7cbf9 100644 --- a/.github/workflows/django.yaml +++ b/.github/workflows/django.yaml @@ -5,7 +5,7 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Start MySQL run: | @@ -13,29 +13,20 @@ jobs: mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -uroot -proot mysql mysql -uroot -proot -e "CREATE USER 'scott'@'%' IDENTIFIED BY 'tiger'; GRANT ALL ON *.* TO scott;" - - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-django-pip-1 - restore-keys: | - ${{ runner.os }}-pip- + - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: # https://www.mail-archive.com/django-updates@googlegroups.com/msg209056.html python-version: "3.8" - - uses: actions/checkout@v2 - with: - fetch-depth: 2 - - name: Install mysqlclient env: PIP_NO_PYTHON_VERSION_WARNING: 1 PIP_DISABLE_PIP_VERSION_CHECK: 1 run: | - pip install -U pytest pytest-cov tblib + pip install -r requiremnts.txt pip install . # pip install mysqlclient # Use stable version diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 0b34ecb4..7c2f8ba1 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -6,29 +6,20 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - name: Start MySQL run: | sudo systemctl start mysql.service mysql -uroot -proot -e "CREATE DATABASE mysqldb_test" - - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-1 - restore-keys: | - ${{ runner.os }}-pip- - - - uses: actions/checkout@v2 - with: - fetch-depth: 2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -37,7 +28,7 @@ jobs: PIP_NO_PYTHON_VERSION_WARNING: 1 PIP_DISABLE_PIP_VERSION_CHECK: 1 run: | - pip install -U coverage pytest pytest-cov + pip install -r requiremnts.txt python setup.py develop - name: Run tests @@ -46,4 +37,4 @@ jobs: run: | pytest --cov=MySQLdb tests - - uses: codecov/codecov-action@v1 + - uses: codecov/codecov-action@v3 diff --git a/metadata.cfg b/metadata.cfg index 87ebc6c5..38deff56 100644 --- a/metadata.cfg +++ b/metadata.cfg @@ -21,7 +21,6 @@ classifiers: Programming Language :: C Programming Language :: Python Programming Language :: Python :: 3 - Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 From c42387acc425f110af389b07c9dd8547582a211a Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 9 May 2023 05:22:30 +0000 Subject: [PATCH 2/3] Add requirements.txt --- requirements.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..e2546870 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +# This file is for GitHub Action +coverage +pytest +pytest-cov +tblib From ce6961d5e3809deb0b14ac385e054d2451ff111a Mon Sep 17 00:00:00 2001 From: Inada Naoki Date: Tue, 9 May 2023 05:28:11 +0000 Subject: [PATCH 3/3] fix typo --- .github/workflows/django.yaml | 2 +- .github/workflows/tests.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/django.yaml b/.github/workflows/django.yaml index 33e7cbf9..55497767 100644 --- a/.github/workflows/django.yaml +++ b/.github/workflows/django.yaml @@ -26,7 +26,7 @@ jobs: PIP_NO_PYTHON_VERSION_WARNING: 1 PIP_DISABLE_PIP_VERSION_CHECK: 1 run: | - pip install -r requiremnts.txt + pip install -r requirements.txt pip install . # pip install mysqlclient # Use stable version diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 7c2f8ba1..73681427 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -28,7 +28,7 @@ jobs: PIP_NO_PYTHON_VERSION_WARNING: 1 PIP_DISABLE_PIP_VERSION_CHECK: 1 run: | - pip install -r requiremnts.txt + pip install -r requirements.txt python setup.py develop - name: Run tests