diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 63be4c1..bb7c781 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -6,11 +6,19 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ["3.11"] + python-version: ["3.12"] os: [ubuntu-latest] + tool: ["black", "isort"] steps: - uses: actions/checkout@v4 - - name: Black Code Formatter - uses: lgeiger/black-action@v1.0.1 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 with: - args: ". --check" + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r dev_requirements/requirements-format.txt + - name: ${{ matrix.tool }} Code Formatter + run: | + ${{ matrix.tool }} . --check diff --git a/.github/workflows/packaging_test.yml b/.github/workflows/packaging_test.yml index ac3a748..1a4525a 100644 --- a/.github/workflows/packaging_test.yml +++ b/.github/workflows/packaging_test.yml @@ -6,7 +6,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] os: [ubuntu-latest] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index 197f9a1..07ff01f 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -6,7 +6,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] os: [ ubuntu-latest ] steps: - uses: actions/checkout@v4 diff --git a/dev_requirements/requirements-format.in b/dev_requirements/requirements-format.in new file mode 100644 index 0000000..41e6b86 --- /dev/null +++ b/dev_requirements/requirements-format.in @@ -0,0 +1,3 @@ +# specific requirements for the formatting envs +black +isort diff --git a/dev_requirements/requirements-format.txt b/dev_requirements/requirements-format.txt new file mode 100644 index 0000000..c28101b --- /dev/null +++ b/dev_requirements/requirements-format.txt @@ -0,0 +1,24 @@ +# +# This file is autogenerated by pip-compile with python 3.10 +# To update, run: +# +# pip-compile requirements-formatting.in +# +black==23.12.1 + # via -r dev_requirements/requirements-formatting.in +click==8.1.3 + # via black +isort==5.13.2 + # via -r dev_requirements/requirements-formatting.in +mypy-extensions==1.0.0 + # via black +packaging==23.0 + # via black +pathspec==0.11.0 + # via black +platformdirs==3.1.0 + # via black +tomli==2.0.1 + # via black +typing-extensions==4.9.0 + # via black diff --git a/dev_requirements/requirements-linting.in b/dev_requirements/requirements-linting.in new file mode 100644 index 0000000..787ac85 --- /dev/null +++ b/dev_requirements/requirements-linting.in @@ -0,0 +1,2 @@ +# specific requirements for the tox linting env +pylint diff --git a/dev_requirements/requirements-linting.txt b/dev_requirements/requirements-linting.txt new file mode 100644 index 0000000..8afe665 --- /dev/null +++ b/dev_requirements/requirements-linting.txt @@ -0,0 +1,24 @@ +# +# This file is autogenerated by pip-compile with python 3.10 +# To update, run: +# +# pip-compile requirements-linting.in +# +astroid==3.0.1 + # via pylint +dill==0.3.7 + # via pylint +isort==5.13.2 + # via pylint +mccabe==0.7.0 + # via pylint +platformdirs==3.1.0 + # via pylint +pylint==3.0.3 + # via -r dev_requirements/requirements-linting.in +tomli==2.0.1 + # via pylint +tomlkit==0.11.6 + # via pylint +typing-extensions==4.9.0 + # via astroid diff --git a/dev_requirements/requirements-packaging.in b/dev_requirements/requirements-packaging.in new file mode 100644 index 0000000..3aad7fa --- /dev/null +++ b/dev_requirements/requirements-packaging.in @@ -0,0 +1,3 @@ +# requirements for the hatchling build ssystem +build +twine diff --git a/dev_requirements/requirements-packaging.txt b/dev_requirements/requirements-packaging.txt new file mode 100644 index 0000000..9b039d5 --- /dev/null +++ b/dev_requirements/requirements-packaging.txt @@ -0,0 +1,78 @@ +# +# This file is autogenerated by pip-compile with python 3.10 +# To update, run: +# +# pip-compile requirements-packaging.in +# +bleach==6.0.0 + # via readme-renderer +build==1.0.3 + # via -r requirements-packaging.in +certifi==2023.7.22 + # via requests +cffi==1.15.1 + # via cryptography +charset-normalizer==3.1.0 + # via requests +cryptography==41.0.6 + # via secretstorage +docutils==0.20.1 + # via readme-renderer +idna==3.4 + # via requests +importlib-metadata==6.7.0 + # via + # keyring + # twine +jaraco-classes==3.2.3 + # via keyring +jeepney==0.8.0 + # via + # keyring + # secretstorage +keyring==23.13.1 + # via twine +markdown-it-py==3.0.0 + # via rich +mdurl==0.1.2 + # via markdown-it-py +more-itertools==9.1.0 + # via jaraco-classes +packaging==23.1 + # via build +pkginfo==1.9.6 + # via twine +pycparser==2.21 + # via cffi +pygments==2.15.1 + # via + # readme-renderer + # rich +pyproject-hooks==1.0.0 + # via build +readme-renderer==37.3 + # via twine +requests==2.31.0 + # via + # requests-toolbelt + # twine +requests-toolbelt==1.0.0 + # via twine +rfc3986==2.0.0 + # via twine +rich==13.4.2 + # via twine +secretstorage==3.3.3 + # via keyring +six==1.16.0 + # via bleach +twine==4.0.2 + # via -r requirements-packaging.in +urllib3==2.0.7 + # via + # requests + # twine +webencodings==0.5.1 + # via bleach +zipp==3.15.0 + # via importlib-metadata diff --git a/dev_requirements/requirements-tests.in b/dev_requirements/requirements-tests.in new file mode 100644 index 0000000..5497961 --- /dev/null +++ b/dev_requirements/requirements-tests.in @@ -0,0 +1,2 @@ +# specific requirements for the tox tests env +pytest diff --git a/dev_requirements/requirements-tests.txt b/dev_requirements/requirements-tests.txt new file mode 100644 index 0000000..51b6ccb --- /dev/null +++ b/dev_requirements/requirements-tests.txt @@ -0,0 +1,18 @@ +# +# This file is autogenerated by pip-compile with python 3.10 +# To update, run: +# +# pip-compile requirements-tests.in +# +exceptiongroup==1.1.3 + # via pytest +iniconfig==2.0.0 + # via pytest +packaging==23.0 + # via pytest +pluggy==1.0.0 + # via pytest +pytest==7.4.4 + # via -r dev_requirements/requirements-tests.in +tomli==2.0.1 + # via pytest diff --git a/dev_requirements/requirements-type_check.in b/dev_requirements/requirements-type_check.in new file mode 100644 index 0000000..55cde2e --- /dev/null +++ b/dev_requirements/requirements-type_check.in @@ -0,0 +1,4 @@ +# specific requirements for the tox type_check environment +mypy +types-pytz +types-python-dateutil diff --git a/dev_requirements/requirements-type_check.txt b/dev_requirements/requirements-type_check.txt new file mode 100644 index 0000000..560ac79 --- /dev/null +++ b/dev_requirements/requirements-type_check.txt @@ -0,0 +1,16 @@ +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# pip-compile requirements-type_check.in +# +mypy==1.8.0 + # via -r requirements-type_check.in +mypy-extensions==1.0.0 + # via mypy +types-python-dateutil==2.8.19.14 + # via -r requirements-type_check.in +types-pytz==2023.3.1.1 + # via -r requirements-type_check.in +typing-extensions==4.9.0 + # via mypy diff --git a/tox.ini b/tox.ini index 08041a1..37d9bbf 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,7 @@ commands = python -m pip install --upgrade pip # the tests environment is called by the Github action that runs the unit tests deps = -r requirements.txt - pytest + -r dev_requirements/requirements-tests.txt setenv = PYTHONPATH = {toxinidir}/src commands = python -m pytest --basetemp={envtmpdir} {posargs} @@ -25,7 +25,7 @@ commands = python -m pytest --basetemp={envtmpdir} {posargs} # the linting environment runs pylint on the code base deps = -r requirements.txt - pylint + -r dev_requirements/requirements-linting.txt setenv = PYTHONPATH = {toxinidir}/src commands = pylint bdew_datetimes @@ -34,10 +34,7 @@ commands = # the type_check environment checks the type hints using mypy deps = -r requirements.txt - holidays - mypy - types-pytz - types-python-dateutil + -r dev_requirements/requirements-type_check.txt setenv = PYTHONPATH = {toxinidir}/src commands = mypy --show-error-codes src/bdew_datetimes @@ -46,8 +43,7 @@ commands = [testenv:format] # install isort and black and invoke them on the current folder deps = - isort - black + -r dev_requirements/requirements-formatting.txt commands = isort . black . @@ -67,8 +63,7 @@ commands = [testenv:test_packaging] skip_install = true deps = - build - twine + -r dev_requirements/requirements-packaging.txt commands = python -m build twine check dist/*