Skip to content

Commit

Permalink
Use ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
kislyuk committed May 6, 2023
1 parent 1aea757 commit ce52636
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 24 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: make install
- name: Test
run: make test
- run: make install
- run: make lint
- run: make test
- uses: codecov/codecov-action@v3
black:
runs-on: ubuntu-22.04
Expand Down
29 changes: 13 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
SHELL=/bin/bash -e
SHELL=/bin/bash

test_deps:
pip install coverage flake8 mypy sphinx wheel
python -m pip install .[test]

lint: test_deps
flake8 src
lint:
ruff src
mypy --install-types --non-interactive --check-untyped-defs src

typecheck: test_deps
mypy --strict --no-warn-unused-ignores src

test: lint typecheck
test:
coverage run --branch --include 'src/*' -m unittest discover -s test -v

init_docs: test_deps
init_docs:
cd docs; sphinx-quickstart

docs: test_deps
docs:
python -m pip install furo sphinx-copybutton
sphinx-build docs docs/html

build:
pip install build
install: clean
python -m pip install build
python -m build

install: clean build
pip install --upgrade dist/*.whl
python -m pip install --upgrade $$(echo dist/*.whl)[test]

clean:
-rm -rf build dist
-rm -rf *.egg-info

.PHONY: lint test test_deps docs build install clean
.PHONY: test_deps lint test docs install clean

include common.mk
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
[tool.black]
line-length = 120

[tool.isort]
profile = "black"
line_length = 120

[tool.ruff]
line-length = 120
3 changes: 0 additions & 3 deletions setup.cfg

This file was deleted.

11 changes: 10 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,22 @@
name="pyotp",
version="2.8.0",
url="https://github.com/pyotp/pyotp",
project_urls={
"Documentation": "https://pyauth.github.io/pyotp",
"Source Code": "https://github.com/pyauth/pyotp",
"Issue Tracker": "https://github.com/pyauth/pyotp/issues",
"Change Log": "https://github.com/pyauth/pyotp/blob/master/Changes.rst",
},
license="MIT License",
author="PyOTP contributors",
author_email="[email protected]",
description="Python One Time Password Library",
long_description=open("README.rst").read(),
python_requires=">=3.7",
install_requires=[],
extras_require={
"test": ["coverage", "wheel", "ruff", "mypy"],
},
packages=["pyotp", "pyotp.contrib"],
package_dir={"": "src"},
package_data={"pyotp": ["py.typed"]},
Expand All @@ -26,11 +35,11 @@
"Operating System :: POSIX",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries :: Python Modules",
],
)

0 comments on commit ce52636

Please sign in to comment.