Browse Source

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
changes/37/720737/1
Andreas Jaeger 10 months ago
parent
commit
4363f45062
8 changed files with 12 additions and 38 deletions
  1. +2
    -3
      doc/requirements.txt
  2. +2
    -2
      os_net_config/impl_ifcfg.py
  3. +2
    -2
      os_net_config/sriov_config.py
  4. +0
    -5
      releasenotes/source/conf.py
  5. +3
    -13
      setup.cfg
  6. +0
    -9
      setup.py
  7. +1
    -1
      test-requirements.txt
  8. +2
    -3
      tox.ini

+ 2
- 3
doc/requirements.txt 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>=1.6.2,!=1.6.6,!=1.6.7,!=2.1.0;python_version>='3.4' # BSD
openstackdocstheme>=1.20.0 # Apache-2.0
sphinx>=2.0.0 # BSD
openstackdocstheme>=2.0.0 # Apache-2.0

+ 2
- 2
os_net_config/impl_ifcfg.py View File

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


+ 2
- 2
os_net_config/sriov_config.py View File

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


+ 0
- 5
releasenotes/source/conf.py View File

@ -142,11 +142,6 @@ html_theme = 'openstackdocs'
# directly to the root of the documentation.
# 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
# typographically correct entities.
# html_use_smartypants = True


+ 3
- 13
setup.cfg View File

@ -7,6 +7,7 @@ author = OpenStack
author-email = openstack-discuss@lists.openstack.org
license = Apache License (2.0)
home-page = https://opendev.org/openstack/os-net-config
python-requires = >=3.6
classifier =
Environment :: OpenStack
Intended Audience :: Developers
@ -14,6 +15,8 @@ classifier =
License :: OSI Approved :: Apache Software License
Operating System :: OS Independent
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
@ -26,16 +29,3 @@ packages =
console_scripts =
os-net-config = os_net_config.cli: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

+ 0
- 9
setup.py View File

@ -13,17 +13,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
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(
setup_requires=['pbr>=2.0.0'],
pbr=True)

+ 1
- 1
test-requirements.txt View File

@ -1,7 +1,7 @@
# 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
# 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
fixtures>=3.0.0 # Apache-2.0/BSD


+ 2
- 3
tox.ini View File

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

Loading…
Cancel
Save