Skip to content

Commit

Permalink
switching to rye as development dependency management
Browse files Browse the repository at this point in the history
also moving configuration of flake8 in to flake8 file
  • Loading branch information
yamatt committed Apr 1, 2024
1 parent 603950a commit 994b16f
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
exclude = .git,.venv,__pycache__
max-complexity = 10
9 changes: 5 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

try:
homoglyphs_dir = sys.argv[1]
except:
except IndexError:
homoglyphs_dir = "homoglyphs"

path = Path(homoglyphs_dir)
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"}
Expand Down
17 changes: 17 additions & 0 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions requirements.lock
Original file line number Diff line number Diff line change
@@ -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:.

0 comments on commit 994b16f

Please sign in to comment.