move code to distgit_bugzilla_sync package

This allows as to have different functionality, e.g. handling
configuration, in their own separate modules.

Use relative imports for project-internal modules and remove shebangs
from them as they're not marked executable anyway. Instead, add
run-distgit-bugzilla-sync for testing from the repo worktree.

Signed-off-by: Nils Philippsen <nils@redhat.com>
This commit is contained in:
Nils Philippsen 2019-11-18 16:10:33 +01:00
parent 47dd4e39c7
commit e59e1d510f
5 changed files with 8 additions and 7 deletions

View file

View file

@ -1,5 +1,3 @@
#!/usr/bin/python3 -tt
""" """
This module provides the functionality to download the latest primary.xml This module provides the functionality to download the latest primary.xml
database from koji on the rawhide repo. database from koji on the rawhide repo.
@ -12,7 +10,6 @@ which can then later be re-used in other places.
This prevents relying on remote services such as mdapi (of which a lot of This prevents relying on remote services such as mdapi (of which a lot of
code here is coming from) when needing to access the summary of a lot of code here is coming from) when needing to access the summary of a lot of
packages. packages.
""" """
import contextlib import contextlib
import hashlib import hashlib

View file

@ -1,4 +1,3 @@
#!/usr/bin/python3 -tt
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# #
# Copyright © 2013-2019 Red Hat, Inc. # Copyright © 2013-2019 Red Hat, Inc.
@ -53,7 +52,7 @@ from requests.adapters import HTTPAdapter
from urllib3.util import Retry from urllib3.util import Retry
import yaml import yaml
import package_summary from . import package_summary
env = 'staging' env = 'staging'

5
run-distgit-bugzilla-sync Executable file
View file

@ -0,0 +1,5 @@
#!/usr/bin/python3 -tt
from distgit_bugzilla_sync.script import main
main()

View file

@ -33,14 +33,14 @@ setup(
platforms=['Fedora', 'GNU/Linux'], platforms=['Fedora', 'GNU/Linux'],
url='https://pagure.io/Fedora-Infra/distgit-bugzilla-sync', url='https://pagure.io/Fedora-Infra/distgit-bugzilla-sync',
keywords='fedora', keywords='fedora',
packages=[], packages=['distgit_bugzilla_sync'],
include_package_data=True, include_package_data=True,
zip_safe=False, zip_safe=False,
install_requires=INSTALL_REQUIRES, install_requires=INSTALL_REQUIRES,
tests_require=TESTS_REQUIRE, tests_require=TESTS_REQUIRE,
entry_points={ entry_points={
'console_scripts': [ 'console_scripts': [
'distgit-bugzilla-sync = pagure_sync_bugzilla:main', 'distgit-bugzilla-sync = distgit_bugzilla_sync.script:main',
], ],
}, },
) )