-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from bandophahita/ruff
Ruff & project standardization
- Loading branch information
Showing
25 changed files
with
961 additions
and
879 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,3 +144,6 @@ dmypy.json | |
|
||
# Pyre type checker | ||
.pyre/ | ||
|
||
# ruff linter | ||
.ruff_cache/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,19 @@ | ||
files: 'screenpy_pyotp/.*' | ||
files: '(screenpy_pyotp|tests)/.*' | ||
fail_fast: false | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 23.3.0 | ||
hooks: | ||
- id: black | ||
language_version: python3.11 | ||
- repo: https://github.com/timothycrosley/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
language_version: python3.11 | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 6.0.0 | ||
hooks: | ||
- id: flake8 | ||
language_version: python3.11 | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.3.0 | ||
hooks: | ||
- id: mypy | ||
language_version: python3.11 | ||
additional_dependencies: ["pyotp>=2.3.0"] | ||
- repo: local | ||
hooks: | ||
- id: pylint | ||
name: pylint | ||
entry: pylint | ||
language: system | ||
types: [python] | ||
- repo: https://github.com/psf/black | ||
rev: 24.1.1 | ||
hooks: | ||
- id: black | ||
language_version: python3.12 | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.2.0 | ||
hooks: | ||
- id: ruff | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.8.0 | ||
hooks: | ||
- id: mypy | ||
language_version: python3.12 | ||
additional_dependencies: ["pyotp>=2.3.0"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,55 @@ | ||
# shortcuts to help manage flipping between branches with different dependencies | ||
sync: | ||
poetry install --extras dev_all --sync | ||
poetry install --extras dev --sync | ||
|
||
update_lock_only: | ||
poetry update --lock | ||
|
||
update: update_lock_only | ||
poetry install --extras dev_all | ||
poetry install --extras dev | ||
|
||
check: | ||
poetry check | ||
|
||
.PHONY: sync update_lock_only update check | ||
|
||
black-check: | ||
black --check . | ||
|
||
black-fix: | ||
black . | ||
|
||
ruff-check: | ||
ruff check . | ||
|
||
ruff-fix: | ||
ruff check . --fix --show-fixes | ||
|
||
mypy: | ||
mypy . | ||
|
||
.PHONY: black-check black-fix ruff-check ruff-fix mypy | ||
|
||
pre-check-in: black-check ruff-check mypy | ||
|
||
pre-check-in-fix: black-fix ruff-fix mypy | ||
|
||
.PHONY: pre-check-in pre-check-in-fix | ||
|
||
# requires poetry-plugin-export | ||
requirements: | ||
poetry export --without-hashes --with dev -f requirements.txt > requirements.txt | ||
poetry export --without-hashes --extras dev -f requirements.txt > requirements.txt | ||
|
||
.PHONY: requirements | ||
|
||
################################################################################ | ||
# sub-package specific | ||
|
||
trunk_screenpy: | ||
poetry add screenpy git+ssh://[email protected]:ScreenPyHQ/screenpy.git#trunk | ||
|
||
local_screenpy: | ||
pip uninstall screenpy | ||
pip install -e ~/projects/screenpy | ||
|
||
.PHONY: sync update_lock_only update check requirements | ||
.PHONY: trunk_screenpy local_screenpy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,70 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# This file only contains a selection of the most common options. For a full | ||
# list see the documentation: | ||
# For the full list of built-in configuration values, see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- Path setup -------------------------------------------------------------- | ||
|
||
# If extensions (or modules to document with autodoc) are in another directory, | ||
# add these directories to sys.path here. If the directory is relative to the | ||
# documentation root, use os.path.abspath to make it absolute, like shown here. | ||
|
||
# | ||
import os | ||
import sys | ||
|
||
sys.path.insert(0, os.path.abspath("./ext")) | ||
sys.path.insert(0, os.path.abspath("../")) | ||
|
||
from screenpy_pyotp.__version__ import __version__ # noqa: need the path first | ||
from screenpy_pyotp.__version__ import __author__, __copyright__, __version__ | ||
|
||
autodoc_mock_imports = ["pyotp", "screenpy"] | ||
|
||
|
||
# -- Project information ----------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | ||
|
||
project = 'ScreenPy PyOTP' | ||
copyright = '2022-2023, Perry Goy' | ||
author = 'Perry Goy' | ||
|
||
# The full version, including alpha/beta/rc tags | ||
project = "ScreenPy PyOTP" | ||
copyright = __copyright__ | ||
author = __author__ | ||
release = __version__ | ||
|
||
|
||
# -- General configuration --------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
|
||
# Add any Sphinx extension module names here, as strings. They can be | ||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
# ones. | ||
extensions = [ | ||
"sphinx.ext.intersphinx", | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.autosectionlabel", | ||
"sphinx.ext.intersphinx", | ||
"sphinx_rtd_theme", | ||
"autodoc_skip_protocols", | ||
] | ||
|
||
intersphinx_mapping = { | ||
"screenpy": ("https://screenpy-docs.readthedocs.io/en/latest/", None), | ||
} | ||
|
||
# Add any paths that contain templates here, relative to this directory. | ||
templates_path = ['_templates'] | ||
|
||
# List of patterns, relative to source directory, that match files and | ||
# directories to ignore when looking for source files. | ||
# This pattern also affects html_static_path and html_extra_path. | ||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] | ||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
|
||
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
# | ||
html_theme = 'default' | ||
|
||
# Add any paths that contain custom static files (such as style sheets) here, | ||
# relative to this directory. They are copied after the builtin static files, | ||
# so a file named "default.css" will overwrite the builtin "default.css". | ||
html_static_path = ['_static'] | ||
|
||
# Other HTML settings | ||
|
||
|
||
|
||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
||
html_theme = "sphinx_rtd_theme" | ||
html_static_path = [] | ||
|
||
autodoc_member_order = "bysource" | ||
add_module_names = False | ||
|
||
|
||
# -- Options for intersphinx extension --------------------------------------- | ||
|
||
# Example configuration for intersphinx: refer to the Python standard library. | ||
intersphinx_mapping = { | ||
"screenpy": ("https://screenpy-docs.readthedocs.io/en/latest/", None), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.