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
2 changes: 1 addition & 1 deletion .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
id: test
uses: fedora-python/tox-github-action@main
with:
tox_env: py39,py313,lint,isort
tox_env: py39,py313,lint,isort,black
dnf_install: >-
--repo fedora --repo updates
krb5-devel
Expand Down
72 changes: 37 additions & 35 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@
import os
import sys

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


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

project = u'Sync2Jira'
copyright = u'2019, Ralph Bean'
author = u'Ralph Bean'
project = "Sync2Jira"
copyright = "2019, Ralph Bean"
author = "Ralph Bean"

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


# -- General configuration ---------------------------------------------------
Expand All @@ -40,28 +40,28 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.mathjax",
"sphinx.ext.ifconfig",
"sphinx.ext.viewcode",
"sphinx.ext.githubpages",
]

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

# 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 @@ -84,7 +84,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# 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 @@ -95,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 = ['nstatic']
html_static_path = ["nstatic"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -105,13 +105,13 @@
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
# 'searchbox.html']``.
#
html_sidebars = { '**': ['globaltoc.html', 'searchbox.html'] }
html_sidebars = {"**": ["globaltoc.html", "searchbox.html"]}


# -- Options for HTMLHelp output ---------------------------------------------

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


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -120,15 +120,15 @@
# 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 @@ -138,19 +138,15 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'Sync2Jira.tex', u'Sync2Jira Documentation',
u'Ralph Bean', 'manual'),
(master_doc, "Sync2Jira.tex", "Sync2Jira Documentation", "Ralph Bean", "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, 'sync2jira', u'Sync2Jira Documentation',
[author], 1)
]
man_pages = [(master_doc, "sync2jira", "Sync2Jira Documentation", [author], 1)]


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


Expand All @@ -180,7 +182,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 -------------------------------------------------
26 changes: 13 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@

from setuptools import setup

with open('requirements.txt', 'rb') as f:
install_requires = f.read().decode('utf-8').split('\n')
if not os.getenv('READTHEDOCS'):
install_requires.append('requests-kerberos')
with open("requirements.txt", "rb") as f:
install_requires = f.read().decode("utf-8").split("\n")
if not os.getenv("READTHEDOCS"):
install_requires.append("requests-kerberos")

with open('test-requirements.txt', 'rb') as f:
test_requires = f.read().decode('utf-8').split('\n')
with open("test-requirements.txt", "rb") as f:
test_requires = f.read().decode("utf-8").split("\n")

setup(
name='sync2jira',
name="sync2jira",
version=2.0,
description="Sync GitHub issues to jira, via fedmsg",
author='Ralph Bean',
author_email='rbean@redhat.com',
url='https://github.com/release-engineering/Sync2Jira',
license='LGPLv2+',
author="Ralph Bean",
author_email="rbean@redhat.com",
url="https://github.com/release-engineering/Sync2Jira",
license="LGPLv2+",
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU Lesser General "
Expand All @@ -47,12 +47,12 @@
install_requires=install_requires,
tests_require=test_requires,
packages=[
'sync2jira',
"sync2jira",
],
include_package_data=True,
zip_safe=False,
entry_points={
'console_scripts': [
"console_scripts": [
"sync2jira=sync2jira.main:main",
"sync2jira-list-managed-urls=sync2jira.main:list_managed",
"sync2jira-close-duplicates=sync2jira.main:close_duplicates",
Expand Down
33 changes: 18 additions & 15 deletions sync-page/event-handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@

# Global Variables
app = Flask(__name__, static_url_path="/assets", static_folder="assets")
BASE_URL = os.environ['BASE_URL']
REDIRECT_URL = os.environ['REDIRECT_URL']
BASE_URL = os.environ["BASE_URL"]
REDIRECT_URL = os.environ["REDIRECT_URL"]
config = load_config()

# Set up our logging
FORMAT = "[%(asctime)s] %(levelname)s: %(message)s"
logging.basicConfig(format=FORMAT, level=logging.INFO)
logging.basicConfig(format=FORMAT, level=logging.DEBUG)
logging.basicConfig(format=FORMAT, level=logging.WARNING)
log = logging.getLogger('sync2jira-sync-page')
log = logging.getLogger("sync2jira-sync-page")


@app.route('/handle-event', methods=['POST'])
@app.route("/handle-event", methods=["POST"])
def handle_event():
"""
Handler for when a user wants to sync a repo
Expand All @@ -37,32 +37,35 @@ def handle_event():
initialize_pr(config, repo_name=repo_name)
synced_repos.append(repo_name)
if synced_repos:
return render_template('sync-page-success.jinja',
synced_repos=synced_repos,
url=f"https://{REDIRECT_URL}")
return render_template(
"sync-page-success.jinja",
synced_repos=synced_repos,
url=f"https://{REDIRECT_URL}",
)
else:
return render_template('sync-page-failure.jinja',
url=f"https://{REDIRECT_URL}")
return render_template("sync-page-failure.jinja", url=f"https://{REDIRECT_URL}")


@app.route('/', methods=['GET'])
@app.route("/", methods=["GET"])
def index():
"""
Return relevant redirect
"""
return redirect("/github")


@app.route('/github', methods=['GET'])
@app.route("/github", methods=["GET"])
def github():
"""
Github Sync Page
"""
# Build and return our updated HTML page
return render_template('sync-page-github.jinja',
github=config['sync2jira']['map']['github'],
url=f"https://{REDIRECT_URL}")
return render_template(
"sync-page-github.jinja",
github=config["sync2jira"]["map"]["github"],
url=f"https://{REDIRECT_URL}",
)


if __name__ == '__main__':
if __name__ == "__main__":
app.run(host=BASE_URL)
2 changes: 1 addition & 1 deletion sync2jira/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110.15.0 USA
#
# Authors: Ralph Bean <rbean@redhat.com>
__version__ = '1.7'
__version__ = "1.7"
Loading
Loading