Skip to content

Commit

Permalink
Merge pull request #288 from MolSSI-BSE/py312
Browse files Browse the repository at this point in the history
Python 3.12 compatibility
  • Loading branch information
bennybp authored Nov 11, 2023
2 parents c8175f9 + c82c79d commit c6c7493
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ 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
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: |
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions basis_set_exchange/bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 5 additions & 1 deletion basis_set_exchange/tests/test_bundle.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"""

import os
import sys
import zipfile
import tarfile
import pytest
Expand All @@ -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")

Expand Down
4 changes: 2 additions & 2 deletions versioneer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit c6c7493

Please sign in to comment.