From 5d7d158983045fa5f387543df535516d96b1408b Mon Sep 17 00:00:00 2001 From: Daniel Hollas Date: Wed, 12 Jul 2023 14:31:57 +0100 Subject: [PATCH] Fix GHA config (#35) * Bump Python and Postgres versions for Ubuntu image * Bump minimum python version to 3.7 --- .github/workflows/ci.yml | 69 +++++++++++++-------------- .github/workflows/publish-on-pypi.yml | 8 ++-- pgsu/cli.py | 2 +- setup.cfg | 5 +- 4 files changed, 40 insertions(+), 44 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 304f537..5994dfe 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: | @@ -33,14 +33,15 @@ jobs: timeout-minutes: 5 strategy: + fail-fast: false matrix: - python-version: [3.6, 3.9] + python-version: [3.8, 3.11] 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 +65,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 }} @@ -91,9 +92,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-10 - sudo cat /etc/postgresql/10/main/pg_hba.conf - sudo pg_ctlcluster 10 main start + sudo apt install postgresql + sudo cat /etc/postgresql/??/main/pg_hba.conf + sudo pg_ctlcluster 12 main start - name: Install pgsu run: | @@ -107,7 +108,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 +117,7 @@ jobs: ubuntu-postgres-action: # ubuntu using postgres docker container (custom action) - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 timeout-minutes: 5 strategy: @@ -125,7 +126,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 +136,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 +152,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 @@ -160,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: @@ -181,9 +182,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 +201,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 +219,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 +254,13 @@ jobs: strategy: matrix: python-version: [3.8] - os: ['macos-12', 'windows-2019'] + os: ['macos-12', 'windows-2022'] 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 +275,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 +285,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) diff --git a/setup.cfg b/setup.cfg index 6c8c004..74bbe6f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,10 +17,11 @@ 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 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 Programming Language :: Python :: Implementation :: CPython [options] @@ -28,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 =