Skip to content

Commit

Permalink
Version 7.0.0 (#241)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
cdgriffith committed Feb 4, 2023
1 parent f5c326c commit 0bfcb2d
Show file tree
Hide file tree
Showing 24 changed files with 638 additions and 357 deletions.
86 changes: 40 additions & 46 deletions .github/workflows/pythonpublish.yml
Expand Up @@ -5,7 +5,7 @@ name: Upload Python Package

on:
release:
types: [created]
types: [ created ]

jobs:
deploy-generic:
Expand All @@ -14,69 +14,63 @@ jobs:

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine --upgrade
- name: Build and publish
pip install poetry --upgrade
poetry config virtualenvs.create false --local
- name: Poetry Install
run: poetry install --with dev
continue-on-error: true

- name: Poetry Install 2
run: poetry install --with dev

- name: Build and Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

run: |
python setup.py sdist bdist_wheel
poetry build
twine upload dist/*
deploy-cython:
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [ ubuntu-latest, macos-12, windows-latest ]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine Cython --upgrade
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py bdist_wheel
twine upload dist/*
deploy-cython-manylinux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"

- uses: RalfG/python-wheels-manylinux-build@v0.4.2-manylinux2014_x86_64
with:
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311'
build-requirements: 'cython'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
python -m pip install cibuildwheel twine --upgrade
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine --upgrade
- name: Build Wheels
env:
CIBW_SKIP: "cp36-* pp* *i686"
CIBW_BUILD_VERBOSITY: 1
CIBW_TEST_REQUIRES: "pytest msgpack ruamel.yaml tomli tomli-w"
CIBW_TEST_COMMAND: "pytest {package}/test"
run: python -m cibuildwheel --output-dir wheels

- name: Publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*-manylinux*.whl
- name: Publish Wheels
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload wheels/*
152 changes: 74 additions & 78 deletions .github/workflows/tests.yml
Expand Up @@ -5,126 +5,122 @@ name: Tests

on:
push:
branches: [ master, development, develop, test, tests ]
branches: [ test, tests ]
pull_request:
branches: [ master, development, develop, test, tests ]

jobs:
package-checks:
build-checks:
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "pypy-3.8"]
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-12, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: package-check-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }}
- name: Install dependencies
python-version: "3.11"

- name: Build Wheels
env:
CIBW_SKIP: "cp36-* pp* *i686"
CIBW_BUILD_VERBOSITY: 1
CIBW_TEST_REQUIRES: "pytest msgpack ruamel.yaml tomli tomli-w"
CIBW_TEST_COMMAND: "pytest {package}/test"
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-test.txt
pip install coveralls flake8 flake8-print mypy setuptools wheel twine Cython
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors, undefined names or print statements
flake8 box --count --select=E9,F63,F7,F82,T001,T002,T003,T004 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 . --count --exit-zero --max-complexity=20 --max-line-length=120 --statistics --extend-ignore E203
- name: Run mypy
run: mypy box
- name: Build Wheel and check distrubiton log description
run: |
python setup.py sdist bdist_wheel
twine check dist/*
- name: Test packaged wheel on *nix
if: matrix.os != 'windows-latest'
run: |
pip install dist/*.whl
rm -rf box
python -m pytest
- name: Test packaged wheel on Windows
if: matrix.os == 'windows-latest'
run: |
$wheel = (Get-ChildItem dist\*.whl | Sort lastWriteTime | Select-Object -last 1).Name
pip install dist\${wheel}
Remove-item box -recurse -force
python -m pytest
python -m pip install cibuildwheel --upgrade
python -m cibuildwheel --output-dir wheels
- name: Upload wheel artifact
uses: actions/upload-artifact@v2
with:
name: python_box
path: dist/*.whl
path: wheels/*.whl

package-manylinux-checks:
lint-and-mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- uses: actions/checkout@v3

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: package-manylinux-check-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-test.txt
pip install coveralls flake8 flake8-print mypy setuptools wheel twine Cython
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"

- uses: RalfG/python-wheels-manylinux-build@v0.4.2-manylinux2014_x86_64
with:
python-versions: 'cp37-cp37m cp38-cp38 cp39-cp39 cp310-cp310 cp311-cp311'
build-requirements: 'cython'
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: lint-and-mypy-${{ hashFiles('pyproject.toml') }}

- name: Test packaged wheel on linux
run: |
pip install dist/*cp310-manylinux*.whl
rm -rf box
python -m pytest
- name: Install Dependencies
run: |
python -m pip install poetry --upgrade
poetry config virtualenvs.create false --local
- name: Upload wheel artifact
uses: actions/upload-artifact@v2
with:
name: python_box
path: dist/*-manylinux*.whl
- name: Poetry Install
run: poetry install --with dev
continue-on-error: true

- name: Poetry Install 2
run: poetry install --with dev

- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors, undefined names or print statements
python -m flake8 box --count --select=E9,F63,F7,F82,T001,T002,T003,T004 --show-source --statistics
# exit-zero treats all errors as warnings.
python -m flake8 . --count --exit-zero --max-complexity=20 --max-line-length=120 --statistics --extend-ignore E203
test:
- name: Run mypy
run: python -m mypy box

- name: Build Wheel and Check Distribution Log Description
run: |
poetry build
python -m twine check dist/*
test-non-cython:
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: test-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }}
- name: Install dependencies
key: test-${{ hashFiles('pyproject.toml') }}

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-test.txt
pip install setuptools wheel Cython
python setup.py build_ext --inplace
pip install poetry --upgrade
poetry config virtualenvs.create false --local
- name: Poetry Install
run: poetry install --with dev --with test
continue-on-error: true

- name: Poetry Install 2
run: poetry install --with dev --with test

- name: Poetry Build
run: poetry build
continue-on-error: true

- name: Test with pytest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pytest --cov=box test/
python -m pytest --cov=box test/
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
# Identify invalid files
- id: check-ast
Expand Down Expand Up @@ -29,7 +29,7 @@ repos:
exclude: ^test/data/.+

- repo: https://github.com/ambv/black
rev: 22.10.0
rev: 22.12.0
hooks:
- id: black
args: [--config=.black.toml]
Expand All @@ -38,7 +38,7 @@ repos:
hooks:
- id: cythonize-check
name: Cythonize
entry: python setup.py build_ext --inplace
entry: python -m poetry build
language: system
types: [python]
pass_filenames: false
Expand All @@ -51,7 +51,7 @@ repos:
always_run: true

- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.982'
rev: 'v0.991'
hooks:
- id: mypy
types: [python]
Expand Down
8 changes: 8 additions & 0 deletions AUTHORS.rst
Expand Up @@ -28,6 +28,8 @@ Code contributions:
- Dominic (Yobmod)
- Ivan Pepelnjak (ipspace)
- Michał Górny (mgorny)
- Serge Lu (Serge45)


Suggestions and bug reporting:

Expand Down Expand Up @@ -79,3 +81,9 @@ Suggestions and bug reporting:
- Marcos Dione (mdione-cloudian)
- Varun Madiath (vamega)
- Rexbard
- Martin Schorfmann (schorfma)
- aviveh21
- Nishikant Parmar (nishikantparmariam)
- Peter B (barmettl)
- Ash A. (dragonpaw)
- Коптев Роман Викторович (romikforest)
17 changes: 17 additions & 0 deletions CHANGES.rst
@@ -1,6 +1,23 @@
Changelog
=========

Version 7.0.0
-------------

* 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
* Adding #242 more Cython builds using cibuildwheel (thanks to Jacob Hayes)
* 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
* Removing Cython builds for mac until we can build universal2 wheels for arm M1 macs

Version 6.1.0
-------------

Expand Down

0 comments on commit 0bfcb2d

Please sign in to comment.