From 9064e17fa4542adbb02720f6c21411ea215196cf Mon Sep 17 00:00:00 2001 From: Chris Chang Date: Fri, 8 Sep 2023 00:14:29 -0500 Subject: [PATCH] refactor: consolidate config in pyproject.toml (#22) and some basic maintenance on lint checking --- .github/workflows/ci.yaml | 5 ++--- Makefile | 4 ++++ pyproject.toml | 11 +++++++++++ requirements.txt | 3 ++- setup.cfg | 10 ---------- 5 files changed, 19 insertions(+), 14 deletions(-) delete mode 100644 setup.cfg diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 66e0a9d..d45518a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,7 +25,6 @@ jobs: - run: make test lint: - name: "Black" runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -33,5 +32,5 @@ jobs: uses: actions/setup-python@v4 with: python-version: "3.11" - - run: pip install black - - run: black --check . + - run: pip install -r requirements.txt + - run: make lint diff --git a/Makefile b/Makefile index 508e289..6801a45 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,10 @@ test: ## Run test suite coverage run test_project_runpy.py coverage report +lint: ## Run lint check + black --check . + ruff check . + # Bump project_runpy.__version__ # Update CHANGELOG (TODO) # `git commit -am "1.0.0"` diff --git a/pyproject.toml b/pyproject.toml index 454b1c0..8c6b53a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,3 +19,14 @@ classifiers = [ "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries :: Python Modules", ] + +[tool.coverage.run] +branch = true +source = ["project_runpy"] + +[tool.coverage.report] +show_missing = true +skip_covered = true + +[tool.ruff] +line-length = 100 diff --git a/requirements.txt b/requirements.txt index 9c4e869..1615b5d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ +black coverage -flake8 +ruff diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 7d0d1a6..0000000 --- a/setup.cfg +++ /dev/null @@ -1,10 +0,0 @@ -[flake8] -max-line-length = 100 - -[coverage:run] -branch = True -source = project_runpy - -[coverage:report] -show_missing = True -skip_covered = True