Cleanup py27 support

This repo is now testing only with Python 3, so let's make
a few cleanups:
- Remove python 2.7 stanza from setup.py
- Add requires on python >= 3.6 to setup.cfg so that pypi and pip
  know about the requirement
- Remove obsolete sections from setup.cfg
- Update classifiers
- Update requirements, no need for python_version anymore
- Cleanup releasenotes/source/conf.py to remove now obsolete content.
- Use newer openstackdocstheme and Sphinx versions
- Remove install_command from tox.ini, the default is fine
- Update to hacking 3.0 for Sphinx 3 support, fix problems found

Change-Id: Id7cab423584af9280da54f12a29daa1f60a3ca35
This commit is contained in:
Andreas Jaeger 2020-04-17 16:42:57 +02:00
parent 733adbf5c9
commit 4363f45062
8 changed files with 12 additions and 38 deletions

View File

@ -1,3 +1,2 @@
sphinx>=1.6.2,!=1.6.6,!=1.6.7,<2.0.0;python_version=='2.7' # BSD sphinx>=2.0.0 # BSD
sphinx>=1.6.2,!=1.6.6,!=1.6.7,!=2.1.0;python_version>='3.4' # BSD openstackdocstheme>=2.0.0 # Apache-2.0
openstackdocstheme>=1.20.0 # Apache-2.0

View File

@ -47,7 +47,7 @@ def ifcfg_config_path(name):
def remove_ifcfg_config(ifname): def remove_ifcfg_config(ifname):
if re.match('[\w-]+$', ifname): if re.match(r'[\w-]+$', ifname):
ifcfg_file = ifcfg_config_path(ifname) ifcfg_file = ifcfg_config_path(ifname)
if os.path.exists(ifcfg_file): if os.path.exists(ifcfg_file):
os.remove(ifcfg_file) os.remove(ifcfg_file)
@ -430,7 +430,7 @@ class IfcfgNetConfig(os_net_config.NetConfig):
data += "PKEY=yes\n" data += "PKEY=yes\n"
data += "PHYSDEV=%s\n" % base_opt.parent data += "PHYSDEV=%s\n" % base_opt.parent
data += "PKEY_ID=%s\n" % base_opt.pkey_id data += "PKEY_ID=%s\n" % base_opt.pkey_id
elif re.match('\w+\.\d+$', base_opt.name): elif re.match(r'\w+\.\d+$', base_opt.name):
data += "VLAN=yes\n" data += "VLAN=yes\n"
elif isinstance(base_opt, objects.Interface): elif isinstance(base_opt, objects.Interface):
if base_opt.linkdelay: if base_opt.linkdelay:

View File

@ -113,7 +113,7 @@ def get_numvfs(ifname):
"device/sriov_numvfs") "device/sriov_numvfs")
with open(sriov_numvfs_path, 'r') as f: with open(sriov_numvfs_path, 'r') as f:
return int(f.read()) return int(f.read())
except IOError as exc: except IOError:
msg = ("Unable to read numvfs for %s" % ifname) msg = ("Unable to read numvfs for %s" % ifname)
raise SRIOVNumvfsException(msg) raise SRIOVNumvfsException(msg)
@ -591,7 +591,7 @@ def main(argv=sys.argv):
configure_logger(opts.verbose, opts.debug) configure_logger(opts.verbose, opts.debug)
if opts.numvfs: if opts.numvfs:
if re.match("^\w+:\d+$", opts.numvfs): if re.match(r"^\w+:\d+$", opts.numvfs):
device_name, numvfs = opts.numvfs.split(':') device_name, numvfs = opts.numvfs.split(':')
_write_numvfs(device_name, int(numvfs)) _write_numvfs(device_name, int(numvfs))
else: else:

View File

@ -142,11 +142,6 @@ html_theme = 'openstackdocs'
# directly to the root of the documentation. # directly to the root of the documentation.
# html_extra_path = [] # html_extra_path = []
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
# html_last_updated_fmt = '%b %d, %Y'
html_last_updated_fmt = '%Y-%m-%d %H:%M'
# If true, SmartyPants will be used to convert quotes and dashes to # If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities. # typographically correct entities.
# html_use_smartypants = True # html_use_smartypants = True

View File

@ -7,6 +7,7 @@ author = OpenStack
author-email = openstack-discuss@lists.openstack.org author-email = openstack-discuss@lists.openstack.org
license = Apache License (2.0) license = Apache License (2.0)
home-page = https://opendev.org/openstack/os-net-config home-page = https://opendev.org/openstack/os-net-config
python-requires = >=3.6
classifier = classifier =
Environment :: OpenStack Environment :: OpenStack
Intended Audience :: Developers Intended Audience :: Developers
@ -14,6 +15,8 @@ classifier =
License :: OSI Approved :: Apache Software License License :: OSI Approved :: Apache Software License
Operating System :: OS Independent Operating System :: OS Independent
Programming Language :: Python Programming Language :: Python
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3 Programming Language :: Python :: 3
Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7 Programming Language :: Python :: 3.7
@ -26,16 +29,3 @@ packages =
console_scripts = console_scripts =
os-net-config = os_net_config.cli:main os-net-config = os_net_config.cli:main
os-net-config-sriov = os_net_config.sriov_config:main os-net-config-sriov = os_net_config.sriov_config:main
[build_sphinx]
source-dir = doc/source
build-dir = doc/build
all_files = 1
[upload_sphinx]
upload-dir = doc/build/html
[egg_info]
tag_build =
tag_date = 0
tag_svn_revision = 0

View File

@ -13,17 +13,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
import setuptools import setuptools
# In python < 2.7.4, a lazy loading of package `pbr` will break
# setuptools if some other modules registered functions in `atexit`.
# solution from: http://bugs.python.org/issue15881#msg170215
try:
import multiprocessing # noqa
except ImportError:
pass
setuptools.setup( setuptools.setup(
setup_requires=['pbr>=2.0.0'], setup_requires=['pbr>=2.0.0'],
pbr=True) pbr=True)

View File

@ -1,7 +1,7 @@
# The order of packages is significant, because pip processes them in the order # The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration # of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later. # process, which may cause wedges in the gate later.
hacking>=1.1.0,<1.2.0 # Apache-2.0 hacking>=3.0,<3.1.0 # Apache-2.0
coverage>=4.0 # Apache-2.0 coverage>=4.0 # Apache-2.0
fixtures>=3.0.0 # Apache-2.0/BSD fixtures>=3.0.0 # Apache-2.0/BSD

View File

@ -6,7 +6,6 @@ skipsdist = True
[testenv] [testenv]
usedevelop = True usedevelop = True
basepython = python3 basepython = python3
install_command = pip install -U {opts} {packages}
setenv = setenv =
VIRTUAL_ENV={envdir} VIRTUAL_ENV={envdir}
deps = deps =
@ -37,8 +36,8 @@ commands =
[flake8] [flake8]
# E123, E125 skipped as they are invalid PEP-8. # E123, E125 skipped as they are invalid PEP-8.
# W504 line break after binary operator
show-source = True show-source = True
ignore = E123,E125 ignore = E123,E125,W504
builtins = _ builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build