Skip to content

Commit 0bfcb2d

Browse files
authored
Version 7.0.0 (#241)
* Adding #169 default functions with the box_instance and key parameter (thanks to Коптев Роман Викторович) * Adding #170 Be able to initialize with a flattened dict - by using DDBox (thanks to Ash A.) * Adding #192 box_dots treats all keys with periods in them as separate keys (thanks to Rexbard) * Adding #211 support for properties and setters in subclasses (thanks to Serge Lu and David Aronchick) * Adding #226 namespace to track changes to the box (thanks to Jacob Hayes) * Adding #236 iPython detection to prevent adding attribute lookup words (thanks to Nishikant Parmar) * Adding #238 allow ``|`` and ``+`` for frozen boxes (thanks to Peter B) * Adding new DDBox class (Default Dots Box) that is a subclass of SBox * Fixing #235 how ``|`` and ``+`` updates were performed for right operations (thanks to aviveh21) * Fixing #234 typos (thanks to Martin Schorfmann) * Fixing no implicit optionals with type hinting
1 parent f5c326c commit 0bfcb2d

24 files changed

+638
-357
lines changed

.github/workflows/pythonpublish.yml

+40-46
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: Upload Python Package
55

66
on:
77
release:
8-
types: [created]
8+
types: [ created ]
99

1010
jobs:
1111
deploy-generic:
@@ -14,69 +14,63 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v3
17+
1718
- name: Set up Python
1819
uses: actions/setup-python@v4
1920
with:
2021
python-version: '3.10'
21-
- name: Install dependencies
22+
23+
- name: Install Dependencies
2224
run: |
2325
python -m pip install --upgrade pip
24-
pip install setuptools wheel twine --upgrade
25-
- name: Build and publish
26+
pip install poetry --upgrade
27+
poetry config virtualenvs.create false --local
28+
29+
- name: Poetry Install
30+
run: poetry install --with dev
31+
continue-on-error: true
32+
33+
- name: Poetry Install 2
34+
run: poetry install --with dev
35+
36+
- name: Build and Publish
2637
env:
2738
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
2839
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
40+
2941
run: |
30-
python setup.py sdist bdist_wheel
42+
poetry build
3143
twine upload dist/*
3244
3345
deploy-cython:
3446
strategy:
3547
matrix:
36-
os: [macos-latest, windows-latest]
37-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
48+
os: [ ubuntu-latest, macos-12, windows-latest ]
3849
runs-on: ${{ matrix.os }}
3950

4051
steps:
41-
- uses: actions/checkout@v3
42-
- name: Set up Python ${{ matrix.python-version }}
43-
uses: actions/setup-python@v4
44-
with:
45-
python-version: ${{ matrix.python-version }}
46-
- name: Install dependencies
47-
run: |
48-
python -m pip install --upgrade pip
49-
pip install setuptools wheel twine Cython --upgrade
50-
- name: Build and publish
51-
env:
52-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
53-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
54-
run: |
55-
python setup.py bdist_wheel
56-
twine upload dist/*
57-
58-
deploy-cython-manylinux:
59-
runs-on: ubuntu-latest
60-
steps:
61-
- uses: actions/checkout@v3
62-
- name: Set up Python 3.10
63-
uses: actions/setup-python@v4
64-
with:
65-
python-version: "3.10"
52+
- uses: actions/checkout@v3
53+
- name: Set up Python 3.11
54+
uses: actions/setup-python@v4
55+
with:
56+
python-version: "3.11"
6657

67-
- uses: RalfG/[email protected]_x86_64
68-
with:
69-
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311'
70-
build-requirements: 'cython'
58+
- name: Install Dependencies
59+
run: |
60+
python -m pip install --upgrade pip
61+
python -m pip install cibuildwheel twine --upgrade
7162
72-
- name: Install dependencies
73-
run: |
74-
python -m pip install --upgrade pip
75-
pip install twine --upgrade
63+
- name: Build Wheels
64+
env:
65+
CIBW_SKIP: "cp36-* pp* *i686"
66+
CIBW_BUILD_VERBOSITY: 1
67+
CIBW_TEST_REQUIRES: "pytest msgpack ruamel.yaml tomli tomli-w"
68+
CIBW_TEST_COMMAND: "pytest {package}/test"
69+
run: python -m cibuildwheel --output-dir wheels
7670

77-
- name: Publish
78-
env:
79-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
80-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
81-
run: |
82-
twine upload dist/*-manylinux*.whl
71+
- name: Publish Wheels
72+
env:
73+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
74+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
75+
run: |
76+
twine upload wheels/*

.github/workflows/tests.yml

+74-78
Original file line numberDiff line numberDiff line change
@@ -5,126 +5,122 @@ name: Tests
55

66
on:
77
push:
8-
branches: [ master, development, develop, test, tests ]
8+
branches: [ test, tests ]
99
pull_request:
1010
branches: [ master, development, develop, test, tests ]
1111

1212
jobs:
13-
package-checks:
13+
build-checks:
1414
strategy:
1515
matrix:
16-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy-3.8"]
17-
os: [ubuntu-latest, macos-latest, windows-latest]
16+
os: [ubuntu-latest, macos-12, windows-latest]
1817
runs-on: ${{ matrix.os }}
18+
1919
steps:
2020
- uses: actions/checkout@v3
21-
- name: Set up Python ${{ matrix.python-version }}
21+
22+
- name: Set up Python 3.11
2223
uses: actions/setup-python@v4
2324
with:
24-
python-version: ${{ matrix.python-version }}
25-
- uses: actions/cache@v2
26-
with:
27-
path: ~/.cache/pip
28-
key: package-check-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }}
29-
- name: Install dependencies
25+
python-version: "3.11"
26+
27+
- name: Build Wheels
28+
env:
29+
CIBW_SKIP: "cp36-* pp* *i686"
30+
CIBW_BUILD_VERBOSITY: 1
31+
CIBW_TEST_REQUIRES: "pytest msgpack ruamel.yaml tomli tomli-w"
32+
CIBW_TEST_COMMAND: "pytest {package}/test"
3033
run: |
3134
python -m pip install --upgrade pip
32-
pip install -r requirements.txt
33-
pip install -r requirements-test.txt
34-
pip install coveralls flake8 flake8-print mypy setuptools wheel twine Cython
35-
- name: Lint with flake8
36-
run: |
37-
# stop the build if there are Python syntax errors, undefined names or print statements
38-
flake8 box --count --select=E9,F63,F7,F82,T001,T002,T003,T004 --show-source --statistics
39-
# exit-zero treats all errors as warnings.
40-
flake8 . --count --exit-zero --max-complexity=20 --max-line-length=120 --statistics --extend-ignore E203
41-
- name: Run mypy
42-
run: mypy box
43-
- name: Build Wheel and check distrubiton log description
44-
run: |
45-
python setup.py sdist bdist_wheel
46-
twine check dist/*
47-
- name: Test packaged wheel on *nix
48-
if: matrix.os != 'windows-latest'
49-
run: |
50-
pip install dist/*.whl
51-
rm -rf box
52-
python -m pytest
53-
- name: Test packaged wheel on Windows
54-
if: matrix.os == 'windows-latest'
55-
run: |
56-
$wheel = (Get-ChildItem dist\*.whl | Sort lastWriteTime | Select-Object -last 1).Name
57-
pip install dist\${wheel}
58-
Remove-item box -recurse -force
59-
python -m pytest
35+
python -m pip install cibuildwheel --upgrade
36+
python -m cibuildwheel --output-dir wheels
37+
6038
- name: Upload wheel artifact
6139
uses: actions/upload-artifact@v2
6240
with:
6341
name: python_box
64-
path: dist/*.whl
42+
path: wheels/*.whl
6543

66-
package-manylinux-checks:
44+
lint-and-mypy:
6745
runs-on: ubuntu-latest
6846
steps:
69-
- uses: actions/checkout@v3
70-
- name: Set up Python 3.10
71-
uses: actions/setup-python@v4
72-
with:
73-
python-version: "3.10"
47+
- uses: actions/checkout@v3
7448

75-
- uses: actions/cache@v2
76-
with:
77-
path: ~/.cache/pip
78-
key: package-manylinux-check-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }}
79-
- name: Install dependencies
80-
run: |
81-
python -m pip install --upgrade pip
82-
pip install -r requirements.txt
83-
pip install -r requirements-test.txt
84-
pip install coveralls flake8 flake8-print mypy setuptools wheel twine Cython
49+
- name: Set up Python 3.11
50+
uses: actions/setup-python@v4
51+
with:
52+
python-version: "3.11"
8553

86-
- uses: RalfG/[email protected]_x86_64
87-
with:
88-
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311'
89-
build-requirements: 'cython'
54+
- uses: actions/cache@v2
55+
with:
56+
path: ~/.cache/pip
57+
key: lint-and-mypy-${{ hashFiles('pyproject.toml') }}
9058

91-
- name: Test packaged wheel on linux
92-
run: |
93-
pip install dist/*cp310-manylinux*.whl
94-
rm -rf box
95-
python -m pytest
59+
- name: Install Dependencies
60+
run: |
61+
python -m pip install poetry --upgrade
62+
poetry config virtualenvs.create false --local
9663
97-
- name: Upload wheel artifact
98-
uses: actions/upload-artifact@v2
99-
with:
100-
name: python_box
101-
path: dist/*-manylinux*.whl
64+
- name: Poetry Install
65+
run: poetry install --with dev
66+
continue-on-error: true
67+
68+
- name: Poetry Install 2
69+
run: poetry install --with dev
70+
71+
- name: Lint with flake8
72+
run: |
73+
# stop the build if there are Python syntax errors, undefined names or print statements
74+
python -m flake8 box --count --select=E9,F63,F7,F82,T001,T002,T003,T004 --show-source --statistics
75+
# exit-zero treats all errors as warnings.
76+
python -m flake8 . --count --exit-zero --max-complexity=20 --max-line-length=120 --statistics --extend-ignore E203
10277
103-
test:
78+
- name: Run mypy
79+
run: python -m mypy box
80+
81+
- name: Build Wheel and Check Distribution Log Description
82+
run: |
83+
poetry build
84+
python -m twine check dist/*
85+
86+
test-non-cython:
10487
strategy:
10588
matrix:
10689
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
10790
os: [ubuntu-latest, macos-latest, windows-latest]
10891
runs-on: ${{ matrix.os }}
10992
steps:
11093
- uses: actions/checkout@v3
94+
11195
- name: Set up Python ${{ matrix.python-version }}
11296
uses: actions/setup-python@v4
11397
with:
11498
python-version: ${{ matrix.python-version }}
99+
115100
- uses: actions/cache@v2
116101
with:
117102
path: ~/.cache/pip
118-
key: test-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }}
119-
- name: Install dependencies
103+
key: test-${{ hashFiles('pyproject.toml') }}
104+
105+
- name: Install Dependencies
120106
run: |
121107
python -m pip install --upgrade pip
122-
pip install -r requirements.txt
123-
pip install -r requirements-test.txt
124-
pip install setuptools wheel Cython
125-
python setup.py build_ext --inplace
108+
pip install poetry --upgrade
109+
poetry config virtualenvs.create false --local
110+
111+
- name: Poetry Install
112+
run: poetry install --with dev --with test
113+
continue-on-error: true
114+
115+
- name: Poetry Install 2
116+
run: poetry install --with dev --with test
117+
118+
- name: Poetry Build
119+
run: poetry build
120+
continue-on-error: true
121+
126122
- name: Test with pytest
127123
env:
128124
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
129125
run: |
130-
pytest --cov=box test/
126+
python -m pytest --cov=box test/

.pre-commit-config.yaml

+4-4
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.3.0
3+
rev: v4.4.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: 22.10.0
32+
rev: 22.12.0
3333
hooks:
3434
- id: black
3535
args: [--config=.black.toml]
@@ -38,7 +38,7 @@ repos:
3838
hooks:
3939
- id: cythonize-check
4040
name: Cythonize
41-
entry: python setup.py build_ext --inplace
41+
entry: python -m poetry build
4242
language: system
4343
types: [python]
4444
pass_filenames: false
@@ -51,7 +51,7 @@ repos:
5151
always_run: true
5252

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

AUTHORS.rst

+8
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ Code contributions:
2828
- Dominic (Yobmod)
2929
- Ivan Pepelnjak (ipspace)
3030
- Michał Górny (mgorny)
31+
- Serge Lu (Serge45)
32+
3133

3234
Suggestions and bug reporting:
3335

@@ -79,3 +81,9 @@ Suggestions and bug reporting:
7981
- Marcos Dione (mdione-cloudian)
8082
- Varun Madiath (vamega)
8183
- Rexbard
84+
- Martin Schorfmann (schorfma)
85+
- aviveh21
86+
- Nishikant Parmar (nishikantparmariam)
87+
- Peter B (barmettl)
88+
- Ash A. (dragonpaw)
89+
- Коптев Роман Викторович (romikforest)

CHANGES.rst

+17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
Changelog
22
=========
33

4+
Version 7.0.0
5+
-------------
6+
7+
* Adding #169 default functions with the box_instance and key parameter (thanks to Коптев Роман Викторович)
8+
* Adding #170 Be able to initialize with a flattened dict - by using DDBox (thanks to Ash A.)
9+
* Adding #192 box_dots treats all keys with periods in them as separate keys (thanks to Rexbard)
10+
* Adding #211 support for properties and setters in subclasses (thanks to Serge Lu and David Aronchick)
11+
* Adding #226 namespace to track changes to the box (thanks to Jacob Hayes)
12+
* Adding #236 iPython detection to prevent adding attribute lookup words (thanks to Nishikant Parmar)
13+
* Adding #238 allow ``|`` and ``+`` for frozen boxes (thanks to Peter B)
14+
* Adding new DDBox class (Default Dots Box) that is a subclass of SBox
15+
* Adding #242 more Cython builds using cibuildwheel (thanks to Jacob Hayes)
16+
* Fixing #235 how ``|`` and ``+`` updates were performed for right operations (thanks to aviveh21)
17+
* Fixing #234 typos (thanks to Martin Schorfmann)
18+
* Fixing no implicit optionals with type hinting
19+
* Removing Cython builds for mac until we can build universal2 wheels for arm M1 macs
20+
421
Version 6.1.0
522
-------------
623

0 commit comments

Comments
 (0)