Skip to content

Commit 37b9181

Browse files
cdgriffithjbemmel
andauthored
Version 7.3.0 (#283)
* Adding tests and Cython releases for Python 3.13 * Fixing #281 consistent error message about missing YAML parser (thanks to J vanBemmel) * Removing support for Python 3.8 as it is EOL --------- Co-authored-by: J vanBemmel <[email protected]>
1 parent a23451d commit 37b9181

File tree

9 files changed

+57
-45
lines changed

9 files changed

+57
-45
lines changed

.github/workflows/pythonpublish.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Python
1919
uses: actions/setup-python@v5
2020
with:
21-
python-version: '3.12'
21+
python-version: '3.13'
2222

2323
- name: Install Dependencies
2424
run: |
@@ -38,8 +38,8 @@ jobs:
3838
deploy-cython:
3939
strategy:
4040
matrix:
41-
os: [macos-11, windows-latest]
42-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
41+
os: [macos-latest, windows-latest]
42+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
4343
runs-on: ${{ matrix.os }}
4444

4545
steps:
@@ -51,7 +51,7 @@ jobs:
5151
- name: Install dependencies
5252
run: |
5353
python -m pip install --upgrade pip
54-
pip install setuptools wheel twine Cython==3.0.0 --upgrade
54+
pip install setuptools wheel twine Cython>=3.0.11 --upgrade
5555
- name: Build and publish
5656
env:
5757
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
@@ -64,20 +64,21 @@ jobs:
6464
runs-on: ubuntu-latest
6565
steps:
6666
- uses: actions/checkout@v4
67-
- name: Set up Python 3.12
67+
- name: Set up Python 3.13
6868
uses: actions/setup-python@v5
6969
with:
70-
python-version: "3.12"
70+
python-version: "3.13"
7171

7272
- name: Build wheels
7373
run: |
7474
python -m pip install --upgrade pip
7575
pip install cibuildwheel setuptools wheel
7676
python -m cibuildwheel --output-dir dist
7777
env:
78-
CIBW_BUILD: cp38-manylinux_x86_64 cp39-manylinux_x86_64 cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64
79-
CIBW_BEFORE_BUILD: pip install Cython==3.0.0
80-
CIBW_BEFORE_TEST: pip install -r requirements.txt -r requirements-test.txt setuptools wheel twine
78+
CIBW_BUILD: cp39-manylinux_x86_64 cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64 cp313-manylinux_x86_64
79+
CIBW_BEFORE_BUILD: pip install Cython>=3.0.11 setuptools wheel
80+
CIBW_BEFORE_TEST: pip install -r requirements.txt -r requirements-test.txt setuptools wheel twine Cython>=3.0.11
81+
CIBW_BUILD_VERBOSITY: 1
8182
CIBW_TEST_COMMAND: pytest {package}/test -vv
8283

8384
- name: Publish

.github/workflows/tests.yml

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,25 @@ jobs:
1313
package-checks:
1414
strategy:
1515
matrix:
16-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.8"]
17-
os: [ubuntu-latest, macos-11, windows-latest]
16+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy-3.10"]
17+
os: [ubuntu-latest, macos-latest, windows-latest]
1818
runs-on: ${{ matrix.os }}
1919
steps:
2020
- uses: actions/checkout@v4
2121
- name: Set up Python ${{ matrix.python-version }}
2222
uses: actions/setup-python@v5
2323
with:
2424
python-version: ${{ matrix.python-version }}
25-
- uses: actions/cache@v3
26-
with:
27-
path: ~/.cache/pip
28-
key: package-check-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }}
25+
# - uses: actions/cache@v3
26+
# with:
27+
# path: ~/.cache/pip
28+
# key: package-check-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }}
2929
- name: Install dependencies
3030
run: |
3131
python -m pip install --upgrade pip
3232
pip install -r requirements.txt
3333
pip install -r requirements-test.txt
34-
pip install coveralls flake8 flake8-print mypy setuptools wheel twine Cython==3.0.0
34+
pip install coveralls flake8 flake8-print mypy setuptools wheel twine Cython>=3.0.11
3535
- name: Lint with flake8
3636
run: |
3737
# stop the build if there are Python syntax errors, undefined names or print statements
@@ -67,25 +67,26 @@ jobs:
6767
runs-on: ubuntu-latest
6868
steps:
6969
- uses: actions/checkout@v4
70-
- name: Set up Python 3.12
70+
- name: Set up Python 3.13
7171
uses: actions/setup-python@v5
7272
with:
73-
python-version: "3.12"
73+
python-version: "3.13"
7474

75-
- uses: actions/cache@v3
76-
with:
77-
path: ~/.cache/pip
78-
key: package-manylinux-check-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }}
75+
# - uses: actions/cache@v3
76+
# with:
77+
# path: ~/.cache/pip
78+
# key: package-manylinux-check-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }}
7979

8080
- name: Build wheels
8181
run: |
8282
python -m pip install --upgrade pip
8383
pip install cibuildwheel
8484
python -m cibuildwheel --output-dir dist
8585
env:
86-
CIBW_BUILD: cp38-manylinux_x86_64 cp39-manylinux_x86_64 cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64
87-
CIBW_BEFORE_BUILD: pip install Cython==3.0.0
88-
CIBW_BEFORE_TEST: pip install -r requirements.txt -r requirements-test.txt setuptools wheel twine
86+
CIBW_BUILD: cp39-manylinux_x86_64 cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64 cp313-manylinux_x86_64
87+
CIBW_BEFORE_BUILD: pip install Cython>=3.0.11 setuptools wheel
88+
CIBW_BEFORE_TEST: pip install -r requirements.txt -r requirements-test.txt setuptools wheel twine Cython>=3.0.11
89+
CIBW_BUILD_VERBOSITY: 1
8990
CIBW_TEST_COMMAND: pytest {package}/test -vv
9091

9192
- name: Upload wheel artifact
@@ -97,25 +98,25 @@ jobs:
9798
test:
9899
strategy:
99100
matrix:
100-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
101-
os: [ubuntu-latest, macos-11, windows-latest]
101+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
102+
os: [ubuntu-latest, macos-latest, windows-latest]
102103
runs-on: ${{ matrix.os }}
103104
steps:
104105
- uses: actions/checkout@v4
105106
- name: Set up Python ${{ matrix.python-version }}
106107
uses: actions/setup-python@v5
107108
with:
108109
python-version: ${{ matrix.python-version }}
109-
- uses: actions/cache@v3
110-
with:
111-
path: ~/.cache/pip
112-
key: test-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }}
110+
# - uses: actions/cache@v3
111+
# with:
112+
# path: ~/.cache/pip
113+
# key: test-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }}
113114
- name: Install dependencies
114115
run: |
115116
python -m pip install --upgrade pip
116117
pip install -r requirements.txt
117118
pip install -r requirements-test.txt
118-
pip install setuptools wheel Cython==3.0.0
119+
pip install setuptools wheel Cython>=3.0.11
119120
python setup.py build_ext --inplace
120121
- name: Test with pytest
121122
env:

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.6.0
3+
rev: v5.0.0
44
hooks:
55
# Identify invalid files
66
- id: check-ast
@@ -29,7 +29,7 @@ repos:
2929
exclude: ^test/data/.+
3030

3131
- repo: https://github.com/ambv/black
32-
rev: 24.4.2
32+
rev: 24.10.0
3333
hooks:
3434
- id: black
3535
args: [--config=.black.toml]
@@ -51,7 +51,7 @@ repos:
5151
always_run: true
5252

5353
- repo: https://github.com/pre-commit/mirrors-mypy
54-
rev: 'v1.10.0'
54+
rev: 'v1.13.0'
5555
hooks:
5656
- id: mypy
5757
types: [python]

CHANGES.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
Changelog
22
=========
33

4+
Version 7.3.0
5+
-------------
6+
7+
* Adding tests and Cython releases for Python 3.13
8+
* Fixing #281 consistent error message about missing YAML parser (thanks to J vanBemmel)
9+
* Removing support for Python 3.8 as it is EOL
10+
411
Version 7.2.0
512
-------------
613

box/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# -*- coding: utf-8 -*-
33

44
__author__ = "Chris Griffith"
5-
__version__ = "7.2.0"
5+
__version__ = "7.3.0"
66

77
from box.box import Box
88
from box.box_list import BoxList

box/converters.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
except ImportError:
3030
pyyaml_available = False
3131

32+
MISSING_PARSER_ERROR = "No YAML Parser available, please install ruamel.yaml>=0.17 or PyYAML"
33+
3234
toml_read_library: Optional[Any] = None
3335
toml_write_library: Optional[Any] = None
3436
toml_decode_error: Optional[Callable] = None
@@ -196,7 +198,7 @@ def _to_yaml(
196198
elif pyyaml_available:
197199
return yaml.dump(obj, stream=f, default_flow_style=default_flow_style, **yaml_kwargs)
198200
else:
199-
raise BoxError("No YAML Parser available, please install ruamel.yaml>0.17 or PyYAML")
201+
raise BoxError(MISSING_PARSER_ERROR)
200202

201203
else:
202204
if ruamel_available:
@@ -210,7 +212,7 @@ def _to_yaml(
210212
elif pyyaml_available:
211213
return yaml.dump(obj, default_flow_style=default_flow_style, **yaml_kwargs)
212214
else:
213-
raise BoxError("No YAML Parser available, please install ruamel.yaml>0.17 or PyYAML")
215+
raise BoxError(MISSING_PARSER_ERROR)
214216

215217

216218
def _from_yaml(
@@ -237,7 +239,7 @@ def _from_yaml(
237239
kwargs["Loader"] = yaml.SafeLoader
238240
data = yaml.load(f, **kwargs)
239241
else:
240-
raise BoxError("No YAML Parser available, please install ruamel.yaml>0.15 or PyYAML")
242+
raise BoxError(MISSING_PARSER_ERROR)
241243
elif yaml_string:
242244
if ruamel_available:
243245
yaml_loader = YAML(typ=ruamel_typ)
@@ -249,7 +251,7 @@ def _from_yaml(
249251
kwargs["Loader"] = yaml.SafeLoader
250252
data = yaml.load(yaml_string, **kwargs)
251253
else:
252-
raise BoxError("No YAML Parser available, please install ruamel.yaml>0.17 or PyYAML")
254+
raise BoxError(MISSING_PARSER_ERROR)
253255
else:
254256
raise BoxError("from_yaml requires a string or filename")
255257
return data

requirements-dev.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Files needed for pre-commit hooks
22
black>=23.1.0
3-
Cython==3.0.0
3+
Cython>=3.0.11
44
mypy>=1.0.1
55
pre-commit>=2.21.0
6+
setuptools>=75.6.0

requirements-test.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
coverage>=5.0.4
1+
coverage>=7.6.9
22
msgpack>=1.0
33
pytest>=7.1.3
4-
pytest-cov>=2.8.1
4+
pytest-cov<6.0.0
55
ruamel.yaml>=0.17
66
tomli>=1.2.3; python_version < '3.11'
77
tomli-w>=1.0.0

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@
4545
py_modules=["box"],
4646
packages=["box"],
4747
ext_modules=extra,
48-
python_requires=">=3.8",
48+
python_requires=">=3.9",
4949
include_package_data=True,
5050
platforms="any",
5151
classifiers=[
5252
"Programming Language :: Python",
5353
"Programming Language :: Python :: 3",
54-
"Programming Language :: Python :: 3.8",
5554
"Programming Language :: Python :: 3.9",
5655
"Programming Language :: Python :: 3.10",
5756
"Programming Language :: Python :: 3.11",
5857
"Programming Language :: Python :: 3.12",
58+
"Programming Language :: Python :: 3.13",
5959
"Programming Language :: Python :: Implementation :: CPython",
6060
"Development Status :: 5 - Production/Stable",
6161
"Natural Language :: English",

0 commit comments

Comments
 (0)