Skip to content

Commit d0e15e7

Browse files
committed
add codecov stuff
1 parent f8b212f commit d0e15e7

File tree

8 files changed

+49
-30
lines changed

8 files changed

+49
-30
lines changed

.coveragerc

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[run]
22
branch = True
3+
source = dotwiz
34
omit =
45
*/__version__.py
56

@@ -18,3 +19,5 @@ exclude_lines =
1819
if __name__ == .__main__.:
1920

2021
ignore_errors = True
22+
omit =
23+
tests/*

.github/workflows/release.yml

+17
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,20 @@ jobs:
6363
user: __token__
6464
password: ${{ secrets.PYPI_API_TOKEN }}
6565
skip_existing: true
66+
67+
- name: Generate coverage report
68+
run: |
69+
pip install pytest pytest-cov
70+
pytest --cov=./ --cov-report=xml
71+
72+
- name: Upload coverage to Codecov
73+
uses: codecov/codecov-action@v2
74+
with:
75+
directory: ./coverage/reports/
76+
env_vars: OS,PYTHON
77+
fail_ci_if_error: true
78+
files: ./coverage1.xml,./coverage2.xml
79+
flags: unittests
80+
name: codecov-umbrella
81+
path_to_write_report: ./coverage/codecov_report.txt
82+
verbose: true

README.rst

+18-12
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,19 @@ Dot Wiz
2121
:alt: Updates
2222

2323

24-
A ``dict`` subclass that is *easy* to create, and supports *fast* dot access notation.
24+
A `blazing fast`_ ``dict`` subclass that enables *dot access* notation via Python
25+
attribute style. Nested ``dict`` and ``list`` values are automatically
26+
transformed as well.
2527

2628
* Documentation: https://dotwiz.readthedocs.io.
2729

28-
Installation
29-
------------
30-
31-
The Dot Wiz library is available `on PyPI`_, and can be installed with ``pip``:
30+
Install
31+
-------
3232

33-
.. code-block:: shell
33+
.. code-block:: console
3434
3535
$ pip install dotwiz
3636
37-
The ``dotwiz`` library officially supports **Python 3.6** or higher.
38-
3937
Usage
4038
-----
4139

@@ -63,11 +61,15 @@ creating a ``DotWiz`` object:
6361
6462
from dotwiz import make_dot_wiz
6563
66-
dw = make_dot_wiz({'hello, world!': 123}, AnyKey='value', isActive=True)
64+
dw = make_dot_wiz([('hello, world!', 123), ('easy: as~ pie?', True)],
65+
AnyKey='value')
66+
67+
print(dw)
68+
#> DotWiz(AnyKey='value', hello, world!=123, easy: as~ pie?=True)
6769
6870
assert dw['hello, world!'] == 123
71+
assert dw['easy: as~ pie?']
6972
assert dw.AnyKey == 'value'
70-
assert dw.isActive
7173
7274
Features
7375
--------
@@ -83,8 +85,9 @@ Using a *dot-access* approach such as ``DotWiz`` can be up
8385
to **100x** faster than with `make_dataclass`_ from the ``dataclasses`` module.
8486

8587
It's also about *5x* faster to create a ``DotWiz`` from a ``dict`` object
86-
as compared to other libraries such as ``prodict``, and up to *2x* faster
87-
in general to access keys by *dot* access.
88+
as compared to other libraries such as ``prodict`` -- or close to **15x** faster
89+
than creating a `Box`_ -- and up to *10x* faster in general to access keys
90+
by *dot* access -- or almost **30x** faster than accessing keys from a `DotMap`_!
8891

8992
Contributing
9093
------------
@@ -99,11 +102,14 @@ Credits
99102

100103
This package was created with Cookiecutter_ and the `rnag/cookiecutter-pypackage`_ project template.
101104

105+
.. _blazing fast: https://dotwiz.readthedocs.io/en/latest/benchmarks.html#results
102106
.. _Read The Docs: https://dotwiz.readthedocs.io
103107
.. _Installation: https://dotwiz.readthedocs.io/en/latest/installation.html
104108
.. _on PyPI: https://pypi.org/project/dotwiz/
105109
.. _make_dataclass: https://docs.python.org/3/library/dataclasses.html#dataclasses.make_dataclass
106110
.. _benchmark: https://github.com/rnag/dotwiz/tree/main/benchmarks
111+
.. _Box: https://github.com/cdgriffith/Box/wiki/Quick-Start
112+
.. _DotMap: https://pypi.org/project/dotmap
107113
.. _`Contributing`: https://dotwiz.readthedocs.io/en/latest/contributing.html
108114
.. _`open an issue`: https://github.com/rnag/dotwiz/issues
109115
.. _Cookiecutter: https://github.com/cookiecutter/cookiecutter

benchmarks/README.rst

+8-6
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,21 @@ better in an average case.
6565
Creating a dot-access ``dict``
6666
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6767

68-
The results indicate it is about **3x** faster to *create* a :class:`DotWiz`
68+
The results indicate it is about **5x** faster to *create* a :class:`DotWiz`
6969
instance (from a ``dict`` object) as compared to other competitor libraries
70-
such as ``dotsi`` and ``prodict`` - and up to **10x** faster than
71-
``box`` for example.
70+
such as ``dotsi`` and ``prodict`` - and up to **15x** faster than creating
71+
a `Box`_.
7272

7373
Accessing keys by "dot" attribute
7474
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7575

76-
The results show it is up to **2x** faster to *access* a key by dot
77-
attribute than ``prodict``, and about **7x** faster than with
78-
libraries such as ``dotmap``.
76+
The results show it is up to **10x** faster to *access* a key by dot
77+
attribute than ``prodict``, and about **30x** faster than accessing
78+
keys from a `DotMap`_ for example.
7979

8080
.. _my post on SO: https://stackoverflow.com/a/72232461/10237506
8181
.. _benchmarks/: https://github.com/rnag/dotwiz/tree/main/benchmarks
8282
.. _virtual environment: https://realpython.com/python-virtual-environments-a-primer/
8383
.. _make_dataclass: https://docs.python.org/3/library/dataclasses.html#dataclasses.make_dataclass
84+
.. _Box: https://github.com/cdgriffith/Box/wiki/Quick-Start
85+
.. _DotMap: https://pypi.org/project/dotmap

docs/dotwiz.rst

-8
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ dotwiz package
44
Submodules
55
----------
66

7-
dotwiz.constants module
8-
-----------------------
9-
10-
.. automodule:: dotwiz.constants
11-
:members:
12-
:undoc-members:
13-
:show-inheritance:
14-
157
dotwiz.main module
168
------------------
179

requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ wheel==0.37.1
44
watchdog[watchmedo]==2.1.6
55
flake8>=3 # pyup: ignore
66
tox==3.24.5
7+
codecov==2.1.12
78
coverage>=6.2
89
Sphinx==4.4.0
910
twine==3.8.0
1011
# Test requirements
1112
pytest==7.0.1
1213
pytest-benchmark[histogram]==3.4.1
1314
pytest-cov==3.0.0
14-
pytest-runner==5.3.1
1515
# Benchmarks
1616
dict2dot==0.1
1717
dotmap==1.3.30

setup.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
test_requirements = [
1616
'pytest~=7.0.1',
1717
'pytest-benchmark[histogram]~=3.4.1',
18-
'pytest-cov~=3.0.0',
19-
'pytest-runner~=5.3.1'
18+
'pytest-cov~=3.0.0'
2019
]
2120

2221
about = {}

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ deps =
2626
commands =
2727
pip install -U pip
2828
pytest --basetemp={envtmpdir}
29-
29+
codecov
3030

3131
[flake8]
3232
ignore =

0 commit comments

Comments
 (0)