From 67f4529283cb2e3e15c54b273a884f7bed6782bc Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 11 Jul 2023 19:24:27 +0100 Subject: [PATCH 1/8] Fix GHA config --- .github/workflows/ci.yml | 60 ++++++++++++--------------- .github/workflows/publish-on-pypi.yml | 8 ++-- pgsu/cli.py | 2 +- 3 files changed, 32 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 304f537..592e2cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,12 +10,12 @@ jobs: timeout-minutes: 5 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - name: Set up Python 3.8 - uses: actions/setup-python@v1 + - name: Set up Python 3.9 + uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.9 - name: Install python dependencies run: | @@ -29,7 +29,7 @@ jobs: ubuntu-apt: # ubuntu using postgresql installed via apt (+ pgtest) - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest timeout-minutes: 5 strategy: @@ -37,10 +37,10 @@ jobs: python-version: [3.6, 3.9] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -64,26 +64,26 @@ jobs: - name: Upload coverage report if: github.repository == 'aiidateam/pgsu' - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 with: name: ubuntu-apt file: ./coverage.xml fail_ci_if_error: true - ubuntu-apt-1804: + ubuntu-apt-2004: # ubuntu using postgresql installed via apt (+ pgtest) - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 timeout-minutes: 5 strategy: matrix: - python-version: [3.6] + python-version: [3.7] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -107,7 +107,7 @@ jobs: - name: Upload coverage report if: github.repository == 'aiidateam/pgsu' - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 with: name: ubuntu-apt file: ./coverage.xml @@ -116,7 +116,7 @@ jobs: ubuntu-postgres-action: # ubuntu using postgres docker container (custom action) - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest timeout-minutes: 5 strategy: @@ -125,7 +125,7 @@ jobs: postgres-pw: ["testpw"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: CasperWA/postgresql-action@v1.2 with: postgresql version: '10' @@ -135,7 +135,7 @@ jobs: #postgresql auth: trust - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -151,7 +151,7 @@ jobs: - name: Upload coverage report if: github.repository == 'aiidateam/pgsu' - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 with: name: ubuntu-apt file: ./coverage.xml @@ -181,9 +181,9 @@ jobs: options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -200,7 +200,7 @@ jobs: - name: Upload coverage report if: github.repository == 'aiidateam/pgsu' - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 with: name: ubuntu-postgres-service file: ./coverage.xml @@ -218,10 +218,10 @@ jobs: # python-version: [3.8] # # steps: - # - uses: actions/checkout@v2 + # - uses: actions/checkout@v3 # # - name: Set up Python ${{ matrix.python-version }} - # uses: actions/setup-python@v1 + # uses: actions/setup-python@v4 # with: # python-version: ${{ matrix.python-version }} # @@ -253,13 +253,13 @@ jobs: strategy: matrix: python-version: [3.8] - os: ['macos-12', 'windows-2019'] + os: ['macos-latest', 'windows-latest'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} @@ -274,12 +274,6 @@ jobs: initdb -D test_db pg_ctl -D test_db -o "-d 5" start # start with debugging - # - name: Create postgres superuser on Windows - # if: matrix.os == 'windows-2019' - # shell: bash -l {0} - # run: | - # createuser -U runneradmin -s postgres - - name: Install pgsu run: | pip install -e .[testing] @@ -290,7 +284,7 @@ jobs: - name: Upload coverage report if: github.repository == 'aiidateam/pgsu' - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@v3 with: name: "${{ matrix.os }}-conda" file: ./coverage.xml diff --git a/.github/workflows/publish-on-pypi.yml b/.github/workflows/publish-on-pypi.yml index 6674cef..efa367a 100644 --- a/.github/workflows/publish-on-pypi.yml +++ b/.github/workflows/publish-on-pypi.yml @@ -13,12 +13,12 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Set up Python 3.8 - uses: actions/setup-python@v1 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: 3.10 - name: Upgrade setuptools and install package run: | diff --git a/pgsu/cli.py b/pgsu/cli.py index 62200e7..0defba7 100644 --- a/pgsu/cli.py +++ b/pgsu/cli.py @@ -12,7 +12,7 @@ @click.command() @click.argument('query', type=str, default=GET_DBS_COMMAND) def run(query): - """Execute SQL command as PostrgreSQL superuser.""" + """Execute SQL command as PostgreSQL superuser.""" pgsu = PGSU(interactive=True, quiet=False) click.echo(f'Executing query: {query}') dbs = pgsu.execute(query) From baa81035131a5934d084c25b53c1d6fd71769a66 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 11 Jul 2023 19:29:33 +0100 Subject: [PATCH 2/8] Bump Python and Postgres versions for Ubuntu image --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 592e2cc..21f504c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: strategy: matrix: - python-version: [3.6, 3.9] + python-version: [3.7, 3.11] steps: - uses: actions/checkout@v3 @@ -91,7 +91,7 @@ jobs: run: | sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list sudo apt update - sudo apt install postgresql-10 + sudo apt install postgresql-12 sudo cat /etc/postgresql/10/main/pg_hba.conf sudo pg_ctlcluster 10 main start From 8a91398eb4ba2ae1d649395634dac724d26f8ee4 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 11 Jul 2023 19:33:37 +0100 Subject: [PATCH 3/8] More updates --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21f504c..9036e39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,8 +91,8 @@ jobs: run: | sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list sudo apt update - sudo apt install postgresql-12 - sudo cat /etc/postgresql/10/main/pg_hba.conf + sudo apt install postgresql + sudo cat /etc/postgresql/??/main/pg_hba.conf sudo pg_ctlcluster 10 main start - name: Install pgsu From 7cf6724677ba461aac43ae012c52b3a4fed42cc2 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 11 Jul 2023 19:40:09 +0100 Subject: [PATCH 4/8] Ugh --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9036e39..e5fcdad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,9 +48,9 @@ jobs: run: | sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list sudo apt update - sudo apt install postgresql-12 - sudo cat /etc/postgresql/12/main/pg_hba.conf - sudo pg_ctlcluster 12 main start + sudo apt install postgresql + sudo cat /etc/postgresql/*/main/pg_hba.conf + sudo pg_ctlcluster 14 main start - name: Install pgsu run: | @@ -93,7 +93,7 @@ jobs: sudo apt update sudo apt install postgresql sudo cat /etc/postgresql/??/main/pg_hba.conf - sudo pg_ctlcluster 10 main start + sudo pg_ctlcluster 12 main start - name: Install pgsu run: | From af2fc37b130f9fc7373665d1bee669a7e0b4a64e Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 11 Jul 2023 19:45:48 +0100 Subject: [PATCH 5/8] Use Ubuntu-20.04 --- .github/workflows/ci.yml | 10 +++++----- setup.cfg | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5fcdad..51729c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,12 +29,12 @@ jobs: ubuntu-apt: # ubuntu using postgresql installed via apt (+ pgtest) - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 timeout-minutes: 5 strategy: matrix: - python-version: [3.7, 3.11] + python-version: [3.8, 3.11] steps: - uses: actions/checkout@v3 @@ -48,9 +48,9 @@ jobs: run: | sudo rm -f /etc/apt/sources.list.d/dotnetdev.list /etc/apt/sources.list.d/microsoft-prod.list sudo apt update - sudo apt install postgresql - sudo cat /etc/postgresql/*/main/pg_hba.conf - sudo pg_ctlcluster 14 main start + sudo apt install postgresql-12 + sudo cat /etc/postgresql/12/main/pg_hba.conf + sudo pg_ctlcluster 12 main start - name: Install pgsu run: | diff --git a/setup.cfg b/setup.cfg index 6c8c004..5f4719b 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,6 +21,8 @@ classifiers = Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 Programming Language :: Python :: Implementation :: CPython [options] From 37e10d6fc299bceb8c73b88825b557ec3f16594e Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Tue, 11 Jul 2023 19:47:32 +0100 Subject: [PATCH 6/8] Do not fail fast --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51729c5..f726d37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,7 @@ jobs: timeout-minutes: 5 strategy: + fail-fast: false matrix: python-version: [3.8, 3.11] From d8e0103be787711f59146f9162559e80eb16e368 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Wed, 12 Jul 2023 00:13:43 +0100 Subject: [PATCH 7/8] Bump minimum python version to 3.7 --- setup.cfg | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index 5f4719b..74bbe6f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,7 +17,6 @@ classifiers = Programming Language :: Python Programming Language :: Python :: 3 Programming Language :: Python :: 3 :: Only - Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 @@ -30,7 +29,7 @@ packages = find: install_requires = click psycopg2-binary>=2.8.3 -python_requires = ~=3.6 +python_requires = ~=3.7 [options.packages.find] exclude = From 268d1e9636a0d0b65b3a250098468f83b699d8f2 Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Wed, 12 Jul 2023 00:13:55 +0100 Subject: [PATCH 8/8] Pin runner os version --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f726d37..5994dfe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,7 +117,7 @@ jobs: ubuntu-postgres-action: # ubuntu using postgres docker container (custom action) - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 timeout-minutes: 5 strategy: @@ -161,7 +161,7 @@ jobs: ubuntu-postgres-service: # ubuntu using postgres docker container (service provided by github actions) - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 timeout-minutes: 5 strategy: @@ -254,7 +254,7 @@ jobs: strategy: matrix: python-version: [3.8] - os: ['macos-latest', 'windows-latest'] + os: ['macos-12', 'windows-2022'] steps: - uses: actions/checkout@v3