From 18f3ae8c0943008754c09ac46a9ddbbc26300675 Mon Sep 17 00:00:00 2001 From: Benjamin Pritchard Date: Fri, 10 Nov 2023 13:12:46 -0500 Subject: [PATCH 1/4] Python 3.12 compatibility --- .github/workflows/tests.yml | 2 +- versioneer.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fdf18243e..8d3adec35 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 diff --git a/versioneer.py b/versioneer.py index a9dba1224..bee63662c 100644 --- a/versioneer.py +++ b/versioneer.py @@ -339,9 +339,9 @@ def get_config_from_root(root): # configparser.NoOptionError (if it lacks "VCS="). See the docstring at # the top of versioneer.py for instructions on writing your setup.cfg . setup_cfg = os.path.join(root, "setup.cfg") - parser = configparser.SafeConfigParser() + parser = configparser.ConfigParser() with open(setup_cfg, "r") as f: - parser.readfp(f) + parser.read_file(f) VCS = parser.get("versioneer", "VCS") # mandatory def get(parser, name): From 6d8ca0d2e3d87af4dba9cca969031e95fd16ac0c Mon Sep 17 00:00:00 2001 From: Benjamin Pritchard Date: Fri, 10 Nov 2023 16:27:34 -0500 Subject: [PATCH 2/4] Replace deprecated utcnow() call --- basis_set_exchange/bundle.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basis_set_exchange/bundle.py b/basis_set_exchange/bundle.py index 4a5e15c44..243b3b91b 100644 --- a/basis_set_exchange/bundle.py +++ b/basis_set_exchange/bundle.py @@ -77,8 +77,8 @@ def _create_readme(fmt, reffmt): Returns a str representing the readme file ''' - now = datetime.datetime.utcnow() - timestamp = now.strftime('%Y-%m-%d %H:%M:%S UTC') + now = datetime.datetime.now() + timestamp = now.strftime('%Y-%m-%d %H:%M:%S %Z') # yapf: disable outstr = _readme_str.format(timestamp=timestamp, From 0a59c5dd5b4177b5ad19948001c8175e4c1b1537 Mon Sep 17 00:00:00 2001 From: Benjamin Pritchard Date: Fri, 10 Nov 2023 16:35:42 -0500 Subject: [PATCH 3/4] Fix deprecated tarfile call --- basis_set_exchange/tests/test_bundle.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/basis_set_exchange/tests/test_bundle.py b/basis_set_exchange/tests/test_bundle.py index 7ee1c296a..cb0361d94 100644 --- a/basis_set_exchange/tests/test_bundle.py +++ b/basis_set_exchange/tests/test_bundle.py @@ -33,6 +33,7 @@ """ import os +import sys import zipfile import tarfile import pytest @@ -50,7 +51,10 @@ def _extract_all(filepath, extract_dir): zf.extractall(extract_dir) elif filepath.endswith('.tar.bz2'): with tarfile.open(filepath, 'r:bz2') as tf: - tf.extractall(extract_dir) + if sys.version_info >= (3, 11): + tf.extractall(extract_dir, filter='fully_trusted') + else: + tf.extractall(extract_dir) else: raise RuntimeError("Unexpected file extension") From c82c79d3dcd16b73dd4e2bb578f0e17ee474acd1 Mon Sep 17 00:00:00 2001 From: Benjamin Pritchard Date: Fri, 10 Nov 2023 19:26:58 -0500 Subject: [PATCH 4/4] Update setup-python and checkout actions --- .github/workflows/build_docs.yml | 4 ++-- .github/workflows/codeql.yml | 2 +- .github/workflows/tests.yml | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index e891faaec..4d8ccd8d2 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -10,11 +10,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 # needed for tag/version - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v4 with: python-version: "3.10" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 13af0c441..6e29253ff 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -24,7 +24,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8d3adec35..e27db6884 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -24,12 +24,12 @@ jobs: python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] steps: - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Clone the repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install package run: | @@ -39,7 +39,7 @@ jobs: # (testing installed BSE, not the source tree) - name: Clone QCSchema HEAD - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: repository: molssi/QCSchema path: deps/QCSchema