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

Update python matrix (add 3.10, 3.11, 3.12 - drop 3.7) #231

Merged
merged 6 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]
python-version: [3.8, 3.9, '3.10', 3.11, 3.12]

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
rev: v3.15.0
hooks:
- id: pyupgrade
args: ["--py37-plus"]
args: ["--py38-plus"]
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
Expand Down
19 changes: 19 additions & 0 deletions news/python-update
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* Added formal support for Python 3.10, 3.11, and 3.12
Callek marked this conversation as resolved.
Show resolved Hide resolved

### Bug fixes

* <news item>

### Deprecations

* Removed formal support for Python 3.7
Callek marked this conversation as resolved.
Show resolved Hide resolved

### Docs

* <news item>

### Other

* <news item>
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
entry_points={"console_scripts": ["cph=conda_package_handling.cli:main"]},
keywords="conda-package-handling",
classifiers=["Programming Language :: Python :: 3"],
python_requires=">=3.7",
python_requires=">=3.8",
install_requires=["conda-package-streaming >= 0.9.0"],
extras_require={
"docs": ["furo", "sphinx", "sphinx-argparse", "myst-parser", "mdit-py-plugins>=0.3.0"],
Expand Down
1 change: 1 addition & 0 deletions tests/memory_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Simple test for evaluating zstandard binding memory usage.
"""

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This must have been added by black 24.x since I ran that here.

import io
import sys

Expand Down
22 changes: 15 additions & 7 deletions tests/test_degraded.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import importlib
import subprocess
import sys
import warnings


def test_degraded():
Expand All @@ -17,21 +18,28 @@ def test_degraded():
# this is only testing conda_package_handling's code, and does not test
# that conda_package_streaming works without zstandard.

import conda_package_handling.api
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always") # Ensure warnings are sent
import conda_package_handling.api

importlib.reload(conda_package_handling.api)
importlib.reload(conda_package_handling.api)

assert conda_package_handling.api.libarchive_enabled is False
assert len(w) == 1
assert issubclass(w[-1].category, UserWarning)
assert "zstandard" in str(w[-1].message)
assert conda_package_handling.api.libarchive_enabled is False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, testing the warning too.


finally:
sys.modules.pop("zstandard", None)
sys.modules.pop("conda_package_handling.conda_fmt", None)
sys.modules.pop("conda_package_streaming.transmute", None)
import conda_package_handling.api
with warnings.catch_warnings(record=True) as w:
warnings.simplefilter("always") # Ensure warnings are sent
import conda_package_handling.api

importlib.reload(conda_package_handling.api)

assert conda_package_handling.api.libarchive_enabled is True
importlib.reload(conda_package_handling.api)
assert len(w) == 0
assert conda_package_handling.api.libarchive_enabled is True


def test_degraded_subprocess():
Expand Down