Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop lgeiger/black-action; Use black and isort directly #64

Merged
merged 4 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
- 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
2 changes: 1 addition & 1 deletion .github/workflows/packaging_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions dev_requirements/requirements-format.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# specific requirements for the formatting envs
black
isort
24 changes: 24 additions & 0 deletions dev_requirements/requirements-format.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions dev_requirements/requirements-linting.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# specific requirements for the tox linting env
pylint
24 changes: 24 additions & 0 deletions dev_requirements/requirements-linting.txt
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions dev_requirements/requirements-packaging.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# requirements for the hatchling build ssystem
build
twine
78 changes: 78 additions & 0 deletions dev_requirements/requirements-packaging.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions dev_requirements/requirements-tests.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# specific requirements for the tox tests env
pytest
18 changes: 18 additions & 0 deletions dev_requirements/requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions dev_requirements/requirements-type_check.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# specific requirements for the tox type_check environment
mypy
types-pytz
types-python-dateutil
16 changes: 16 additions & 0 deletions dev_requirements/requirements-type_check.txt
Original file line number Diff line number Diff line change
@@ -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
15 changes: 5 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ 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}

[testenv:linting]
# 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
Expand All @@ -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
Expand All @@ -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 .
Expand All @@ -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/*