Skip to content

Commit

Permalink
Version 5.0.0 (#145)
Browse files Browse the repository at this point in the history
* Adding support for msgpack converters `to_msgpack` and `from_msgpack`
* Adding support for comparision of `Box` to other boxes or dicts via the `-` sub operator #144 (thanks to Hitz)
* Adding support to `|` union boxes like will come default in Python 3.9 from PEP 0584
* Adding `mypy` type checking, `black` formatting and other checks on commit
* Adding new parameter `box_class` for cleaner inheritance #148 (thanks to David Aronchick)
* Adding `dotted` option for `keys` method to return box_dots style keys (thanks to ipcoder)
* Fixing box_dots to properly delete items from lists
* Fixing box_dots to properly find items with dots in their key
* Fixing that recast of subclassses of `Box` or `BoxList` were not fed box properties (thanks to Alexander Kapustin)
* Changing that sub boxes are always created to properly propagate settings and copy objects #150 (thanks to ipcoder)
* Changing that default_box will not raise key errors on `pop` #67 (thanks to Patrock)
* Changing `to_csv` and `from_csv` to have same string and filename options as all other transforms
* Changing back to no required external imports, instead have extra requires like [all] (thanks to wim glenn)
* Changing from putting all details in README.rst to a github wiki at https://github.com/cdgriffith/Box/wiki
* Changing `BoxList.box_class` to be stored in `BoxList.box_options` dict as `box_class`
* Changing `del` will raise `BoxKeyError`, subclass of both `KeyError` and `BoxError`
* Removing support for single level circular references
* Removing readthedocs generation
* Removing overrides for `keys`, `values` and `items` which will return views again
  • Loading branch information
cdgriffith authored Jul 12, 2020
1 parent cb450cc commit 1289508
Show file tree
Hide file tree
Showing 32 changed files with 1,891 additions and 1,606 deletions.
15 changes: 15 additions & 0 deletions .black.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[tool.black]
line-length = 120
target-version = ['py36', 'py37', 'py38']
exclude = '''
/(
\.eggs
| \.git
| \.idea
| \.pytest_cache
| _build
| build
| dist
| venv
)/
'''
17 changes: 11 additions & 6 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ exclude_lines =
raise err
except ImportError
yaml = none
raise BoxError\('_box_config key must exist
raise BoxError\("_box_config key must exist
raise err
if 'box_class' in self.__dict__:
raise BoxError\(f'File
if "box_class" in self.__dict__:
raise BoxError\(f"File
except OSError
raise BoxError\(f'{filename}
item._box_config['__box_heritage'] = \(\)
raise BoxError\(f"{filename}
item._box_config["__box_heritage"] = \(\)
raise BoxKeyError\(err
(.*)is unavailable on this system
def to_
def from_
warnings.warn
@classmethod
no package is available to open it
47 changes: 33 additions & 14 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,42 @@ on:
branches: [ master, development ]

jobs:
build:
package_checks:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- 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
- 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
- name: Run mypy
run: mypy box
- name: Check distrubiton log description
run: |
python setup.py sdist bdist_wheel
twine check dist/*
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: [3.6, 3.7, 3.8, pypy3]

steps:
- uses: actions/checkout@v2
Expand All @@ -29,21 +59,10 @@ jobs:
pip install -r requirements.txt
pip install -r requirements-test.txt
pip install coveralls
- name: Lint with flake8
run: |
pip install flake8 flake8-print
# stop the build if there are Python syntax errors or undefined names
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
- name: Test with pytest
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: |
pytest --cov=box test/
coveralls
- name: Check distrubiton log description
run: |
pip install setuptools wheel twine
python setup.py sdist bdist_wheel
twine check dist/*
21 changes: 21 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.5.0
hooks:
- id: mixed-line-ending
- id: trailing-whitespace
- id: requirements-txt-fixer
- id: fix-encoding-pragma
- id: check-byte-order-marker
- id: debug-statements
- id: check-yaml
- repo: https://github.com/ambv/black
rev: 19.10b0
hooks:
- id: black
args: [--config=.black.toml]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.770'
hooks:
- id: mypy
additional_dependencies: [ruamel.yaml,toml,msgpack]
4 changes: 4 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,7 @@ Suggestions and bug reporting:
- Pymancer
- Krishna Penukonda (tasercake)
- J Alan Brogan (jalanb)
- Hitz (hitengajjar)
- David Aronchick (aronchick)
- Alexander Kapustin (dyens)

25 changes: 24 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,18 +1,41 @@
Changelog
=========

Version 5.0.0
-------------

* Adding support for msgpack converters `to_msgpack` and `from_msgpack`
* Adding support for comparision of `Box` to other boxes or dicts via the `-` sub operator #144 (thanks to Hitz)
* Adding support to `|` union boxes like will come default in Python 3.9 from PEP 0584
* Adding `mypy` type checking, `black` formatting and other checks on commit
* Adding new parameter `box_class` for cleaner inheritance #148 (thanks to David Aronchick)
* Adding `dotted` option for `keys` method to return box_dots style keys (thanks to ipcoder)
* Fixing box_dots to properly delete items from lists
* Fixing box_dots to properly find items with dots in their key
* Fixing that recast of subclassses of `Box` or `BoxList` were not fed box properties (thanks to Alexander Kapustin)
* Changing that sub boxes are always created to properly propagate settings and copy objects #150 (thanks to ipcoder)
* Changing that default_box will not raise key errors on `pop` #67 (thanks to Patrock)
* Changing `to_csv` and `from_csv` to have same string and filename options as all other transforms
* Changing back to no required external imports, instead have extra requires like [all] (thanks to wim glenn)
* Changing from putting all details in README.rst to a github wiki at https://github.com/cdgriffith/Box/wiki
* Changing `BoxList.box_class` to be stored in `BoxList.box_options` dict as `box_class`
* Changing `del` will raise `BoxKeyError`, subclass of both `KeyError` and `BoxError`
* Removing support for single level circular references
* Removing readthedocs generation
* Removing overrides for `keys`, `values` and `items` which will return views again

Version 4.2.3
-------------

* Fixing README.md example #149 (thanks to J Alan Brogan)
* Changing `protected_keys` to remove magic methods from dict #146 (thanks to Krishna Penukonda)


Version 4.2.2
-------------

* Fixing `default_box` doesn't first look for safe attributes before falling back to default (thanks to Pymancer)
* Changing from TravisCI to Github Actions
* Changing that due to `default_box` fix, `pop` or `del` no longer raise BoxKeyErrors on missing items (UNCAUGHT BUG)

Version 4.2.1
-------------
Expand Down
Loading

0 comments on commit 1289508

Please sign in to comment.