Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ jobs:
run: |
pip install flake8-pyproject
flake8
- name: Check formatting with black
run: |
pip install -r requirements.d/codestyle.txt
black --check .
test:
needs: lint
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -58,9 +62,9 @@ jobs:
pip install codecov
pip install -e .
- name: Run tox
run: |
run: |
tox --skip-missing-interpreters
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }}
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/psf/black
rev: 24.8.0
hooks:
- id: black

- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies: [flake8-pyproject]
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 2016-2022 The Borg Collective (see AUTHORS file)
Copyright (C) 2016-2025 The Borg Collective (see AUTHORS file)
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
111 changes: 53 additions & 58 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import os
import sys

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

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

# -- General configuration ------------------------------------------------

Expand All @@ -33,40 +33,37 @@
# 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',
'usage',
]
extensions = ["sphinx.ext.autodoc", "usage"]

# 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 encoding of source files.
#
# source_encoding = 'utf-8-sig'

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

# General information about the project.
project = 'Borg - Import'
copyright = '2016-2017 The Borg Collective (see AUTHORS file)'
author = 'The Borg Collective'
project = "Borg - Import"
copyright = "2016-2025 The Borg Collective (see AUTHORS file)"
author = "The Borg Collective"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '0.0'
version = "0.0"
# The full version, including alpha/beta/rc tags.
release = '0.0.0'
release = "0.0.0"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -83,12 +80,12 @@
# Else, today_fmt is used as the format for a strftime call.
#
# today_fmt = '%B %d, %Y'
today_fmt = '%Y-%m-%d'
today_fmt = "%Y-%m-%d"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# The reST default role (used for this markup: `text`) to use for all
# documents.
Expand All @@ -110,7 +107,7 @@
# show_authors = False

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

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
Expand All @@ -129,16 +126,17 @@
#
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
html_style = 'css/borg.css'
html_style = "css/borg.css"
else:
html_context = {
'css_files': [
'https://media.readthedocs.org/css/sphinx_rtd_theme.css',
'https://media.readthedocs.org/css/readthedocs-doc-embed.css',
'_static/css/borg.css',
],
"css_files": [
"https://media.readthedocs.org/css/sphinx_rtd_theme.css",
"https://media.readthedocs.org/css/readthedocs-doc-embed.css",
"_static/css/borg.css",
]
}

# Theme options are theme-specific and customize the look and feel of a theme
Expand All @@ -163,20 +161,20 @@
# of the sidebar.
#
# html_logo = None
html_logo = '_static/logo.png'
html_logo = "_static/logo.png"

# The name of an image file (relative to this directory) to use as a favicon of
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
#
# html_favicon = None
html_favicon = '_static/favicon.ico'
html_favicon = "_static/favicon.ico"

# 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 = ['borg_theme']
# html_static_path = ['_static']
html_static_path = ["borg_theme"]

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand All @@ -189,7 +187,7 @@
# The empty string is equivalent to '%b %d, %Y'.
#
# html_last_updated_fmt = None
html_last_updated_fmt = '%Y-%m-%d'
html_last_updated_fmt = "%Y-%m-%d"

# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
Expand All @@ -201,8 +199,8 @@
# html_sidebars = {}
# Custom sidebar templates, maps document names to template names.
html_sidebars = {
'index': ['sidebarlogo.html', 'sidebarusefullinks.html', 'searchbox.html'],
'**': ['sidebarlogo.html', 'relations.html', 'searchbox.html', 'localtoc.html', 'sidebarusefullinks.html']
"index": ["sidebarlogo.html", "sidebarusefullinks.html", "searchbox.html"],
"**": ["sidebarlogo.html", "relations.html", "searchbox.html", "localtoc.html", "sidebarusefullinks.html"],
}

# Additional templates that should be rendered to pages, maps page names to
Expand Down Expand Up @@ -262,35 +260,29 @@
# html_search_scorer = 'scorer.js'

# Output file base name for HTML help builder.
htmlhelp_basename = 'borg-importdoc'
htmlhelp_basename = "borg-importdoc"

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

latex_elements = {
# 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',
# 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',
}

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'borg-import.tex', 'borg-import Documentation',
'The Borg Collective', 'manual'),
]
latex_documents = [(master_doc, "borg-import.tex", "borg-import Documentation", "The Borg Collective", "manual")]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
Expand Down Expand Up @@ -329,10 +321,7 @@

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

# If true, show URL addresses after external links.
#
Expand All @@ -345,9 +334,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'borg-import', 'borg-import Documentation',
author, 'borg-import', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"borg-import",
"borg-import Documentation",
author,
"borg-import",
"One line description of project.",
"Miscellaneous",
)
]

# Documents to append as an appendix to all manuals.
Expand Down
16 changes: 16 additions & 0 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,19 @@ Open a terminal in the borg-import directory and execute the following to instal

If you have */home/user/.local/bin/* in your ``PATH`` variable, you can then start using Borg-Import.
Otherwise, you will need to add *.local/bin/* to your ``PATH``.

For Developers
--------------

If you're planning to contribute to Borg-Import, you should set up the development environment:

1. Install development dependencies:

:code:`pip install -r requirements.d/development.txt`

2. Set up pre-commit hooks:

:code:`pre-commit install`

This will automatically run code formatting (black) and linting (flake8) checks before each commit.
The pre-commit hooks will ensure your code follows the project's style guidelines.
Loading