Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python 3.12 and limit MacOS/Window's tests. #957

Merged
merged 25 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
11f0785
ci: Add Python 3.12 and limit MacOS/Window's tests.
b-butler Nov 14, 2023
2c5252f
doc: Update changelog
b-butler Nov 14, 2023
4147c15
misc: Add Python 3.12 to pyproject tags
b-butler Nov 14, 2023
12f040b
ci: Apply fixes
b-butler Nov 14, 2023
6ac49db
ci: Further fixes.
b-butler Nov 14, 2023
63d9550
fix: Remove Deprecation errors in Python 3.12
b-butler Nov 14, 2023
88c3881
fix: Correctly check minor not bugfix version
b-butler Nov 14, 2023
dede4d6
ci: Add manual naming for run-pytest
b-butler Nov 14, 2023
a667eb4
test: Update pandas newest test requirements.
b-butler Nov 14, 2023
37bcbf7
ci: Attempt to add ubuntu-latest, 3.12, newest
b-butler Nov 14, 2023
4aaccfe
Try default key.
joaander Nov 15, 2023
03be4c7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 15, 2023
d5a0c82
Try a different key name.
joaander Nov 15, 2023
5f16d68
Fix actions syntax.
joaander Nov 15, 2023
14d8ade
Add missing os key.
joaander Nov 15, 2023
9d51a36
refactor: Check both major and minor version.
b-butler Nov 15, 2023
8e5a4d3
fix: Ignore unrelated testing error to filterwarnings
b-butler Nov 30, 2023
9046094
fix: Another warning filter attempt
b-butler Dec 1, 2023
c2709fd
fix: Let's see if it works?
b-butler Dec 1, 2023
c48f4de
fix (WIP): Check to ensure that error is from fitlerwarnings
b-butler Dec 1, 2023
8baa62b
ci: Attempt to reintroduce errors in warnings
b-butler Dec 4, 2023
75e3e88
Merge branch 'main' into ci/python-3.12
b-butler Dec 4, 2023
a84701b
ci: Attempt to specify which warnings to ignore.
b-butler Dec 4, 2023
61f9652
ci: Try again
b-butler Dec 4, 2023
26a8519
ci: One more time this time with feeling
b-butler Dec 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 43 additions & 11 deletions .github/workflows/run-pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,71 @@ concurrency:
cancel-in-progress: true
jobs:
test:
name: test (${{ matrix.os }}, ${{ matrix.python }}, ${{ matrix.dependencies }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
config: [ {python: '3.9', dependencies: 'newest'},
{python: '3.10', dependencies: 'newest'},
{python: '3.11', dependencies: 'newest'},
{python: '3.11', dependencies: 'minimal'},
{python: '3.8', dependencies: 'oldest'} ]
os: [ubuntu-latest]
python: ['3.8', '3.9', '3.10', '3.11', '3.12']
# Unused key to force creation of new entries in the matrix
default: ['true']
include:
# Defaults to newest dependencies
- dependencies: 'newest'
# Oldest dependency tests
- python: '3.8'
dependencies: 'oldest'
- os: 'macos-latest'
python: '3.8'
dependencies: 'oldest'
- os: 'windows-latest'
python: '3.8'
dependencies: 'oldest'
# Newest version tests for non-Linux OS
- os: 'ubuntu-latest'
python: '3.12'
dependencies: 'newest'
- os: 'macos-latest'
python: '3.12'
dependencies: 'newest'
- os: 'windows-latest'
python: '3.12'
dependencies: 'newest'
# Minimal dependencies tests
- default: 'false'
os: 'ubuntu-latest'
python: '3.12'
dependencies: 'minimal'
- os: 'macos-latest'
python: '3.12'
dependencies: 'minimal'
- os: 'windows-latest'
python: '3.12'
dependencies: 'minimal'
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.config.python }}
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.config.python }}
python-version: ${{ matrix.python }}
- name: Install newest dependencies
run: |
pip install -r requirements/requirements-test.txt
pip install -r requirements/requirements-test-optional.txt
if: ${{ matrix.config.dependencies == 'newest' }}
if: ${{ matrix.dependencies == 'newest' }}
- name: Install minimal dependencies
run: |
pip install -r requirements/requirements-test.txt
if: ${{ matrix.config.dependencies == 'minimal' }}
if: ${{ matrix.dependencies == 'minimal' }}
- name: Install oldest supported dependencies
# To prevent Dependabot from updating the pinnings in this "oldest"
# dependency list, we have to avoid the word "requirements" in the
# filename. That's why it is in the .github/ directory and named "reqs"
# instead of "requirements."
run: |
pip install -r .github/workflows/ci-oldest-reqs.txt
if: ${{ matrix.config.dependencies == 'oldest' }}
if: ${{ matrix.dependencies == 'oldest' }}
- name: Install the package
run: |
pip install -e .
Expand Down
6 changes: 6 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ Version 2
[2.2.0] -- 2023-xx-xx
---------------------

Added
+++++

- Official support for Python 3.12 (#957).

Changed
+++++++

- Restrict allowable tar file features in Python 3.12 (#957).
- linked views now can contain spaces and other characters except directory separators (#926).
- linked views now can be created on Windows, if 'Developer mode' is enabled (#430).

Expand Down
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
Expand Down Expand Up @@ -100,7 +101,10 @@ follow_imports = 'skip'

[tool.pytest.ini_options]
xfail_strict = true
filterwarnings = "error"
filterwarnings = [
"error",
"ignore::DeprecationWarning:dateutil.*",
]

[tool.coverage.run]
branch = true
Expand Down
8 changes: 7 additions & 1 deletion signac/import_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import os
import re
import shutil
import sys
import tarfile
import zipfile
from collections import Counter
Expand Down Expand Up @@ -1144,7 +1145,12 @@ def read_statepoint_file(path):
"The jobs identified with the given schema function are not unique!"
)

tarfile.extractall(path=tmpdir)
if sys.version_info[:2] >= (3, 12):
# the data filter should support all needed operations for users using signac's import
# feature. Other filters assume Unix specific features.
tarfile.extractall(path=tmpdir, filter="data")
else:
tarfile.extractall(path=tmpdir)
for path, job in mappings.items():
if not os.path.isdir(tmpdir):
raise RuntimeError(f"The provided tmpdir {tmpdir} is not a directory.")
Expand Down