From b207744a7bc801f83498348bc14afddbfc995e6f Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Mon, 26 Jul 2021 14:44:38 -0500 Subject: [PATCH] Update for py3 support This updates the default jobs and various settings to reflect py3 support. Updates to the README also due to switching to use a requirements.txt file. Signed-off-by: Sean McGinnis Change-Id: I19ae0818e166e1b801797a6d50ec4aa8cb0c3300 --- README.rst | 34 +++++++++++++++------------------- bugdaystats.py | 2 +- requirements.txt | 2 ++ setup.cfg | 24 ++++++++++++++++++++++++ setup.py | 16 +++++----------- tox.ini | 3 ++- 6 files changed, 49 insertions(+), 32 deletions(-) create mode 100644 requirements.txt create mode 100644 setup.cfg diff --git a/README.rst b/README.rst index 98823bb..faf3bc6 100644 --- a/README.rst +++ b/README.rst @@ -1,24 +1,17 @@ Bug Day Stats page generator ============================ -The bugdaystats.py script is used to extract data from Launchpad +The ``bugdaystats.py`` script is used to extract data from Launchpad and produce static HTML that shows progress during a Bug Day. -Prerequisites -------------- - -You'll need the following Python modules installed: - - launchpadlib - - jinja2 - Usage ----- -python bugdaystats.py output +``python3 bugdaystats.py output`` -'output' is the name of the directory you will generate data +``output`` is the name of the directory you will generate data and HTML files to (if they don't exist yet). It should contain a -'js' subdirectory containing JavaScript include files, but +``js`` subdirectory containing JavaScript include files, but otherwise be empty. In addition, it can contain two types of data files. One file contains data in each time when running the script, and another one is created daily. That means the creation is skipped @@ -29,22 +22,25 @@ You'll need to run the script at least twice to generate enough stats to get a graph. Stats are updated every time the script is run. You should run -bugdaystats.py regularly over the course of your bugday. +``bugdaystats.py`` regularly over the course of your bugday. Configuration ------------- -The config.js configuration file describes the projects you want -to generate data for. "height" is an optional parameter detailing -the size of the graph (230 pixels is the default value). "title" +The ``config.js`` configuration file describes the projects you want +to generate data for. An example ``config.js.sample`` file is provided +that may be renamed and modified to suite your needs. + +``height`` is an optional parameter detailing +the size of the graph (230 pixels is the default value). ``title`` is an optional parameter for the name of the project in the index page. -You can also optionally specify a 'rotation' parameter. Entries older +You can also optionally specify a ``rotation`` parameter. Entries older than the value (in days) will be removed from the dataset, resulting in a rolling view of bug activity. -And you can also optionally specify a 'daily' parameter to enable the +And you can also optionally specify a ``daily`` parameter to enable the feature of daily data collection and showing its graphs. -'daily_rotation' parameter is for daily data collection feature but -it is same as 'rotation' parameter. +``daily_rotation`` parameter is for daily data collection feature but +it is same as ``rotation`` parameter. diff --git a/bugdaystats.py b/bugdaystats.py index f938ecc..e3299bb 100755 --- a/bugdaystats.py +++ b/bugdaystats.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright 2011 Thierry Carrez # All Rights Reserved. diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..2b8e748 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +launchpadlib>=1.10.6 # LGPL +Jinja2 diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..43aa343 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,24 @@ +[metadata] +name = bugdaystats +summary = OpenStack Bugday Stats +description_file = + README.rst +author = OpenStack +author_email = openstack-discuss@lists.openstack.org +home_page = https://opendev.org/openstack/bugdaystats +python_requires = >=3.6 +classifier = + Environment :: OpenStack + Intended Audience :: Information Technology + Intended Audience :: System Administrators + License :: OSI Approved :: Apache Software License + Operating System :: POSIX :: Linux + Programming Language :: Python + Programming Language :: Python :: Implementation :: CPython + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 +project_urls: + Source=https://opendev.org/openstack/bugdaystats diff --git a/setup.py b/setup.py index 881c817..bb4226e 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,14 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from setuptools import setup +import setuptools -setup( - name="bugdaystats", - author="Thierry Carrez", - scripts=['bugdaystats.py'], - install_requires=[ - "launchpadlib", - "jinja2", - ], -) +setuptools.setup( + setup_requires=['pbr>=2.0.0'], + pbr=True) diff --git a/tox.ini b/tox.ini index 404a87b..53cc482 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ [tox] minversion = 3.18.0 skipsdist = True -envlist = pep8,py27 +envlist = pep8,py3 [testenv] basepython = python3 @@ -9,6 +9,7 @@ usedevelop = True install_command=python -m pip install -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} {opts} {packages} deps = -r{toxinidir}/test-requirements.txt + -r{toxinidir}/requirements.txt [testenv:pep8] commands =