Skip to content

Commit

Permalink
Reformat files according to linting rules (#1577)
Browse files Browse the repository at this point in the history
* added pre-commit config

* truncated pre-commit config

* flake8 config

* reformat all with black

test fix

* added pre-commit docs

* removed precommit ci config in favour of github action script

* added pre-commit.yml

* removed isort from tox - now provided by pre-commit

* removed isort from ci and Makefile

* updated pre-commit.yml workflow
  • Loading branch information
matthewhegarty committed Apr 24, 2023
1 parent 27e868c commit dc025e1
Show file tree
Hide file tree
Showing 48 changed files with 2,838 additions and 1,995 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
on:
#pull_request:
pull_request:
push:
branches:
- main
Expand All @@ -14,4 +14,4 @@ jobs:
python-version: 3.x
- uses: pre-commit/action@v3.0.0
- uses: pre-commit-ci/lite-action@v1.0.1
if: always()
if: always()
67 changes: 43 additions & 24 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,37 @@
# 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.
sys.path.append(os.path.abspath('.'))
sys.path.append(os.path.abspath('..'))
sys.path.append(os.path.abspath('../tests'))
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
sys.path.append(os.path.abspath("."))
sys.path.append(os.path.abspath(".."))
sys.path.append(os.path.abspath("../tests"))
os.environ["DJANGO_SETTINGS_MODULE"] = "settings"

django.setup()

# -- 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.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.autosectionlabel']
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.autosectionlabel",
]

autosectionlabel_prefix_document = True

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

# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"

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

# General information about the project.
project = 'django-import-export'
copyright = '2012–2023, Bojan Mihelac'
project = "django-import-export"
copyright = "2012–2023, Bojan Mihelac"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand All @@ -42,14 +46,14 @@
from import_export import __version__

# The short X.Y version.
version = '.'.join(__version__.split('.')[:2])
version = ".".join(__version__.split(".")[:2])
# The full version, including alpha/beta/rc tags.
release = __version__
except ImportError:
version = release = 'dev'
version = release = "dev"

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
pygments_style = "sphinx"

# -- Options for HTML output ---------------------------------------------------

Expand All @@ -60,27 +64,37 @@
# 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"]

# Output file base name for HTML help builder.
htmlhelp_basename = 'django-import-export'
htmlhelp_basename = "django-import-export"

# -- Options for LaTeX output --------------------------------------------------

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'django-import-export.tex', 'django-import-export Documentation',
'Bojan Mihelac', 'manual'),
(
"index",
"django-import-export.tex",
"django-import-export Documentation",
"Bojan Mihelac",
"manual",
),
]

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

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'django-import-export', 'django-import-export Documentation',
['Bojan Mihelac'], 1)
(
"index",
"django-import-export",
"django-import-export Documentation",
["Bojan Mihelac"],
1,
)
]

# -- Options for Texinfo output ------------------------------------------------
Expand All @@ -89,14 +103,19 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'django-import-export', 'django-import-export Documentation', 'Bojan Mihelac',
'django-import-export', 'Import/export data for Django', 'Miscellaneous'),
(
"index",
"django-import-export",
"django-import-export Documentation",
"Bojan Mihelac",
"django-import-export",
"Import/export data for Django",
"Miscellaneous",
),
]

# Documents to append as an appendix to all manuals.
texinfo_appendices = []

# intersphinx documentation
intersphinx_mapping = {
'tablib': ('https://tablib.readthedocs.io/en/stable/', None)
}
intersphinx_mapping = {"tablib": ("https://tablib.readthedocs.io/en/stable/", None)}
2 changes: 1 addition & 1 deletion import_export/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '3.2.1.dev0'
__version__ = "3.2.1.dev0"

0 comments on commit dc025e1

Please sign in to comment.