Skip to content

Commit

Permalink
Several improvememts to project files
Browse files Browse the repository at this point in the history
  • Loading branch information
avalentino committed Dec 24, 2023
1 parent d478276 commit b4da169
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# max_line_length = 79
# max-complexity = 10
doctests = true
extend-ignore = E203,W503,D107
extend-ignore = E203,W503
extend-select = W504
per-file-ignores =
*/tests/test_*.py: D
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install sphinx sphinxcontrib-spelling
python -m pip install .[test,docs]
python -m pip install .[test]
if [ -f requirements-docs.txt ]; then pip install -r requirements-docs.txt; fi
if [ -f docs/requirements-docs.txt ]; then pip install -r docs/requirements-docs.txt; fi
- name: Build docs
run: |
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ venv/
ENV/
env.bak/
venv.bak/
_venv

# Spyder project settings
.spyderproject
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ clean:
$(RM) -r *.*-info build
find . -name __pycache__ -type d -exec $(RM) -r {} +
# $(RM) -r __pycache__ */__pycache__ */*/__pycache__ */*/*/__pycache__
$(RM) $(TARGET)/_*.c $(TARGET)/*.so $(TARGET)/*.o
if [ -f docs/makefile ] ; then $(MAKE) -C docs clean; fi
$(RM) -r docs/_build

Expand Down
20 changes: 18 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
Binary data structures (un-)Packing library
===========================================

:Copyright: 2020-2023, Antonio Valentino <[email protected]>

.. badges
|PyPI Status| |GHA Status| |Documentation Status|
Expand Down Expand Up @@ -48,3 +46,21 @@ Encoders/decoders (*backends*) rely on well known Python packages like:
.. local-definitions
.. |struct| replace:: struct_


License
-------

:Copyright: 2020-2023, Antonio Valentino <[email protected]>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
2 changes: 2 additions & 0 deletions docs/requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sphinx
sphinx_rtd_theme
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ dynamic = ["version"]
bs = ["bitstruct"]
ba = ["bitarray>=1.5.1"]
np = ["numpy"]
docs = ["sphinx", "sphinx_rtd_theme"]
test = ["pytest", "bpack[bs]", "bpack[ba]", "bpack[np]"]
full = ["bpack[bs]", "bpack[ba]", "bpack[np]", "bpack[test]"]

Expand Down Expand Up @@ -79,3 +78,7 @@ no_inline_sort = true
include_trailing_comma = true
use_parentheses = true
line_length = 79


# [tool.pydocstyle]
# add-ignore = ["D105", "D107"]
51 changes: 27 additions & 24 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
minversion = 4
minversion = 4.3.5
env_list =
py38
py39
Expand All @@ -9,9 +9,9 @@ env_list =
pypy3
strict
coverage
codestyle
docs
linkcheck
codestyle
spelling
isolated_build = True

Expand Down Expand Up @@ -44,11 +44,29 @@ deps =
commands =
python3 -m pytest {tty:--color=yes} --cov bpack --cov-report=html --cov-report=term bpack

[testenv:codestyle]
skip_install = true
deps =
flake8
pydocstyle
isort
black
mypy
changedir = {toxinidir}
commands =
python3 -m flake8 --version
python3 -m flake8 --count --statistics --count bpack
python3 -m pydocstyle --count bpack
python3 -m isort --check bpack
python3 -m black --check bpack
# python3 -m mypy --check-untyped-defs --ignore-missing-imports bpack

[testenv:docs]
allowlist_externals = mkdir
changedir = docs
extras = docs
deps = bitstruct
extras = bs
deps =
-r docs/requirements-docs.txt
commands =
mkdir -p _static
python3 -m sphinx -W -b html . _build/html
Expand All @@ -57,33 +75,18 @@ commands =
[testenv:linkcheck]
allowlist_externals = mkdir
changedir = docs
extras = docs
deps =
-r docs/requirements-docs.txt
commands =
mkdir -p _static
python3 -m sphinx -W -b linkcheck . _build/linkcheck

[testenv:spelling]
allowlist_externals = mkdir
changedir = docs
extras = docs
deps = sphinxcontrib-spelling
deps =
-r docs/requirements-docs.txt
sphinxcontrib-spelling
commands =
mkdir -p _static
python3 -m sphinx -W -b spelling . _build/spelling

[testenv:codestyle]
skip_install = true
deps =
flake8
pydocstyle
isort
black
mypy
changedir = {toxinidir}
commands =
python3 -m flake8 --version
python3 -m flake8 --count --statistics --count bpack
python3 -m pydocstyle --count bpack
python3 -m isort --check bpack
python3 -m black --check bpack
# python3 -m mypy --check-untyped-defs --ignore-missing-imports bpack

0 comments on commit b4da169

Please sign in to comment.