Skip to content

Commit

Permalink
Bump to 7.2.0
Browse files Browse the repository at this point in the history
Add tests for Cython
  • Loading branch information
cdgriffith committed Jun 12, 2024
1 parent f31f53c commit db5a024
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 35 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'

- name: Install Dependencies
run: |
Expand All @@ -39,13 +39,13 @@ jobs:
strategy:
matrix:
os: [macos-11, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -63,19 +63,19 @@ jobs:
deploy-cython-manylinux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- name: Build wheels
run: |
python -m pip install --upgrade pip
pip install cibuildwheel setuptools wheel
python -m cibuildwheel --output-dir dist
env:
CIBW_BUILD: cp38-manylinux_x86_64 cp39-manylinux_x86_64 cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp311-macosx_x86_64
CIBW_BUILD: cp38-manylinux_x86_64 cp39-manylinux_x86_64 cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64
CIBW_BEFORE_BUILD: pip install Cython==3.0.0
CIBW_BEFORE_TEST: pip install -r requirements.txt -r requirements-test.txt setuptools wheel twine
CIBW_TEST_COMMAND: pytest {package}/test -vv
Expand All @@ -87,4 +87,3 @@ jobs:
run: |
pip install twine
twine upload dist/*-manylinux*.whl
twine upload dist/*-macosx*.whl
26 changes: 13 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ jobs:
package-checks:
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12-dev", "pypy-3.8"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13-dev", "pypy-3.8"]
os: [ubuntu-latest, macos-11, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
Expand Down Expand Up @@ -58,19 +58,19 @@ jobs:
Remove-item box -recurse -force
python -m pytest -vv
- name: Upload wheel artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python_box
path: dist/*.whl

package-manylinux-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"

- uses: actions/cache@v3
with:
Expand All @@ -83,27 +83,27 @@ jobs:
pip install cibuildwheel
python -m cibuildwheel --output-dir dist
env:
CIBW_BUILD: cp38-manylinux_x86_64 cp39-manylinux_x86_64 cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp311-macosx_x86_64
CIBW_BUILD: cp38-manylinux_x86_64 cp39-manylinux_x86_64 cp310-manylinux_x86_64 cp311-manylinux_x86_64 cp312-manylinux_x86_64
CIBW_BEFORE_BUILD: pip install Cython==3.0.0
CIBW_BEFORE_TEST: pip install -r requirements.txt -r requirements-test.txt setuptools wheel twine
CIBW_TEST_COMMAND: pytest {package}/test -vv

- name: Upload wheel artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python_box
path: dist/*-manylinux*.whl

test:
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-11, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
# Identify invalid files
- id: check-ast
Expand All @@ -20,16 +20,16 @@ repos:
- id: fix-encoding-pragma
- id: fix-byte-order-marker
# General quality checks
- id: mixed-line-ending
args: [--fix=lf]
# - id: mixed-line-ending
# args: [--fix=lf]
- id: trailing-whitespace
args: [--markdown-linebreak-ext=md]
- id: check-executables-have-shebangs
- id: end-of-file-fixer
exclude: ^test/data/.+

- repo: https://github.com/ambv/black
rev: 23.7.0
rev: 24.4.2
hooks:
- id: black
args: [--config=.black.toml]
Expand All @@ -51,7 +51,7 @@ repos:
always_run: true

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.4.1'
rev: 'v1.10.0'
hooks:
- id: mypy
types: [python]
Expand Down
4 changes: 3 additions & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ Code contributions:
- Serge Lu (Serge45)
- Eric Prestat (ericpre)
- Gabriel Mitelman Tkacz (gtkacz)

- Muspi Merol (CNSeniorious000)
- YISH (mokeyish)
- Bit0r


Suggestions and bug reporting:
Expand Down
8 changes: 6 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
Changelog
=========

Version 7.1.2
Version 7.2.0
-------------

* Fixing #261 altering all `__repr__` methods so that subclassing will output the correct class name
* Adding #266 support for accessing nested items in BoxList using numpy-style tuple indexing (thanks to Bit0r)
* Adding tests and Cython releases for Python 3.12
* Fixing #251 support for circular references in lists (thanks to Muspi Merol)
* Fixing #261 altering all `__repr__` methods so that subclassing will output the correct class name (thanks to Gabriel Tkacz)
* Fixing #267 Fix type 'int' not iterable (thanks to YISH)

Version 7.1.1
-------------
Expand Down
2 changes: 1 addition & 1 deletion box/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-

__author__ = "Chris Griffith"
__version__ = "7.1.1"
__version__ = "7.2.0"

from box.box import Box
from box.box_list import BoxList
Expand Down
6 changes: 5 additions & 1 deletion box/box_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ def _convert(self, p_object):
elif isinstance(p_object, box.Box):
p_object._box_config.update(self.box_options)
if isinstance(p_object, list) and not self._is_intact_type(p_object):
p_object = self if p_object is self or p_object is self.box_org_ref else self.__class__(p_object, **self.box_options)
p_object = (
self
if p_object is self or p_object is self.box_org_ref
else self.__class__(p_object, **self.box_options)
)
elif isinstance(p_object, BoxList):
p_object.box_options.update(self.box_options)
return p_object
Expand Down

0 comments on commit db5a024

Please sign in to comment.