Skip to content

Commit

Permalink
Bump version of dependecies and migrate to ruff 20241213
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco Faraone committed Dec 13, 2024
1 parent f0f032c commit 512dd2d
Show file tree
Hide file tree
Showing 36 changed files with 2,278 additions and 2,221 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8
FROM python:3.12

RUN apt update && apt install -y vim

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v3
with:
Expand All @@ -61,7 +61,7 @@ jobs:
echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV
- name: Linting
run: |
poetry run flake8
poetry run ruff check .
- name: Testing
run: |
poetry run pytest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
poetry install
- name: Linting
run: |
poetry run flake8
poetry run ruff check .
- name: Testing
run: |
poetry run pytest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,4 @@ venv.bak/
local

.vscode/
.ruff_cache
60 changes: 32 additions & 28 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
Expand All @@ -16,20 +15,20 @@
import sys
from datetime import datetime

sys.path.insert(0, os.path.abspath('..'))
sys.path.insert(0, os.path.abspath(".."))

# on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

# -- Project information -----------------------------------------------------

project = 'interrogatio'
copyright = '{}, Francesco Faraone.'.format(datetime.now().year)
author = 'Francesco Faraone'
project = "interrogatio"
copyright = f"{datetime.now().year}, Francesco Faraone."
author = "Francesco Faraone"

# The short X.Y version
version = ''
version = ""
# The full version, including alpha/beta/rc tags
release = '1.0.0'
release = "1.0.0"


# -- General configuration ---------------------------------------------------
Expand All @@ -42,7 +41,7 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
"sphinx.ext.autodoc",
]

# if not on_rtd: # only import and set the theme if we're building docs locally
Expand All @@ -52,16 +51,16 @@


# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -73,7 +72,7 @@
# 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']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = None
Expand All @@ -85,7 +84,7 @@
# a list of builtin themes.
#

html_theme = 'sphinx_rtd_theme'
html_theme = "sphinx_rtd_theme"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -96,7 +95,7 @@
# 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']
html_static_path = ["_static"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -112,7 +111,7 @@
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'interrogatiodoc'
htmlhelp_basename = "interrogatiodoc"


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -121,15 +120,12 @@
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -139,19 +135,21 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'interrogatio.tex', 'interrogatio Documentation',
'Francesco Faraone', 'manual'),
(
master_doc,
"interrogatio.tex",
"interrogatio Documentation",
"Francesco Faraone",
"manual",
),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'interrogatio', 'interrogatio Documentation',
[author], 1)
]
man_pages = [(master_doc, "interrogatio", "interrogatio Documentation", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------
Expand All @@ -160,9 +158,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'interrogatio', 'interrogatio Documentation',
author, 'interrogatio', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"interrogatio",
"interrogatio Documentation",
author,
"interrogatio",
"One line description of project.",
"Miscellaneous",
),
]


Expand All @@ -181,7 +185,7 @@
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
epub_exclude_files = ["search.html"]


# -- Extension configuration -------------------------------------------------
6 changes: 3 additions & 3 deletions interrogatio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
from interrogatio.core.dialog import dialogus
from interrogatio.core.prompt import interrogatio

__all__ = ('dialogus', 'interrogatio')
__all__ = ("dialogus", "interrogatio")


try:
__version__ = get_distribution('interrogatio').version
__version__ = get_distribution("interrogatio").version
except DistributionNotFound: # pragma: no cover
__version__ = '0.0.0'
__version__ = "0.0.0"


def get_version():
Expand Down
34 changes: 19 additions & 15 deletions interrogatio/core/dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
from interrogatio.themes import for_dialog, set_theme
from interrogatio.widgets.wizard import WizardDialog


__all__ = ['dialogus']
__all__ = ["dialogus"]


def show_dialog(
Expand All @@ -16,19 +15,24 @@ def show_dialog(
intro=None,
summary=False,
fast_forward=False,
next_text='Next',
previous_text='Previous',
cancel_text='Cancel',
finish_text='Finish',
next_text="Next",
previous_text="Previous",
cancel_text="Cancel",
finish_text="Finish",
):
handlers = [get_instance(q) for q in questions]
app = Application(
layout=Layout(
WizardDialog(
title, handlers,
intro=intro, summary=summary, fast_forward=fast_forward,
next_text=next_text, previous_text=previous_text,
cancel_text=cancel_text, finish_text=finish_text,
title,
handlers,
intro=intro,
summary=summary,
fast_forward=fast_forward,
next_text=next_text,
previous_text=previous_text,
cancel_text=cancel_text,
finish_text=finish_text,
),
),
mouse_support=False,
Expand All @@ -51,11 +55,11 @@ def dialogus(
intro=None,
summary=False,
fast_forward=False,
next_text='Next',
previous_text='Previous',
cancel_text='Cancel',
finish_text='Finish',
theme='default',
next_text="Next",
previous_text="Previous",
cancel_text="Cancel",
finish_text="Finish",
theme="default",
):
"""
Show a dialog with inputs as defined in the questions parameter and returns
Expand Down
3 changes: 2 additions & 1 deletion interrogatio/core/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ class ValidationError(Exception):
"""
Exception raised when validation fails.
"""

def __init__(self, message):
super(ValidationError, self).__init__()
super().__init__()
self._message = message

def __str__(self):
Expand Down
7 changes: 3 additions & 4 deletions interrogatio/core/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
from interrogatio.handlers import get_instance
from interrogatio.themes import for_prompt, set_theme

__all__ = ["interrogatio"]

__all__ = ['interrogatio']


def interrogatio(questions, theme='default'):
def interrogatio(questions, theme="default"):
"""
Prompts user for inputs as defined in the questions parameter and returns
a dictionary with the answers.
Expand Down Expand Up @@ -83,7 +82,7 @@ def interrogatio(questions, theme='default'):
break
else:
print_formatted_text(
FormattedText([('class:error', handler.errors[0])]),
FormattedText([("class:error", handler.errors[0])]),
style=for_prompt(),
)
return answers
Loading

0 comments on commit 512dd2d

Please sign in to comment.