From 994b16f9b1ff7f87173afae10b0f88f7d53f709a Mon Sep 17 00:00:00 2001 From: Matt Copperwaite Date: Mon, 1 Apr 2024 08:50:10 +0100 Subject: [PATCH] switching to rye as development dependency management also moving configuration of flake8 in to flake8 file --- .flake8 | 3 +++ .github/workflows/test.yml | 9 +++++---- generate.py | 2 +- pyproject.toml | 4 ++++ requirements-dev.lock | 17 +++++++++++++++++ requirements.lock | 10 ++++++++++ 6 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 .flake8 create mode 100644 requirements-dev.lock create mode 100644 requirements.lock diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..f9f33d7 --- /dev/null +++ b/.flake8 @@ -0,0 +1,3 @@ +[flake8] +exclude = .git,.venv,__pycache__ +max-complexity = 10 \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f3dfde6..bff4e25 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,13 +15,14 @@ jobs: uses: actions/setup-python@v5 with: python-version: '3.12' + - uses: eifinger/setup-rye@v2 - name: Lint - run: | - python3 -m pip install flake8==4.0.1 + run: | + rye sync # stop the build if there are Python syntax errors or undefined names - python3 -m flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + rye run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - python3 -m flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + rye run flake8 . --count --max-line-length=127 --statistics test: name: Test the library runs-on: ubuntu-latest diff --git a/generate.py b/generate.py index d036060..1e6cc83 100644 --- a/generate.py +++ b/generate.py @@ -13,7 +13,7 @@ try: homoglyphs_dir = sys.argv[1] -except: +except IndexError: homoglyphs_dir = "homoglyphs" path = Path(homoglyphs_dir) diff --git a/pyproject.toml b/pyproject.toml index 95bc23f..3c8268c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,7 @@ +[tool] +rye = { dev-dependencies = [ + "flake8>=7.0.0", +] } [tool.dephell.main] from = {format = "flit", path = "pyproject.toml"} to = {format = "setuppy", path = "setup.py"} diff --git a/requirements-dev.lock b/requirements-dev.lock new file mode 100644 index 0000000..1b5862c --- /dev/null +++ b/requirements-dev.lock @@ -0,0 +1,17 @@ +# generated by rye +# use `rye lock` or `rye sync` to update this lockfile +# +# last locked with the following flags: +# pre: false +# features: [] +# all-features: false +# with-sources: false + +-e file:. +flake8==7.0.0 +mccabe==0.7.0 + # via flake8 +pycodestyle==2.11.1 + # via flake8 +pyflakes==3.2.0 + # via flake8 diff --git a/requirements.lock b/requirements.lock new file mode 100644 index 0000000..8f23096 --- /dev/null +++ b/requirements.lock @@ -0,0 +1,10 @@ +# generated by rye +# use `rye lock` or `rye sync` to update this lockfile +# +# last locked with the following flags: +# pre: false +# features: [] +# all-features: false +# with-sources: false + +-e file:.