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
- Switch to using sphinx-build
- Use newer openstackdocstheme version
- Remove install_command from tox.ini, the default is fine
- Update to hacking 3.0, fix warnings

Change-Id: If66a87c519ce82ee7890ac3e133afef13fb35bd2
This commit is contained in:
Andreas Jaeger 2020-04-13 11:25:17 +02:00
parent 1d6cb4cf0c
commit 2abc37868b
7 changed files with 12 additions and 33 deletions

View File

@ -1,10 +1,9 @@
# 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.
sphinx!=1.6.6,!=1.6.7,>=1.6.2,<2.0.0;python_version=='2.7' # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2,!=2.1.0;python_version>='3.4' # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2,!=2.1.0 # BSD
sphinx-feature-classification>=0.2.0 # Apache-2.0
openstackdocstheme>=1.24.0 # Apache-2.0
openstackdocstheme>=1.31.2 # Apache-2.0
cliff>=2.14
# releasenotes

View File

@ -47,8 +47,8 @@ class SessionClient(object):
def request(self, method, url, **kwargs):
version = kwargs.pop('version', None)
api_version = (self.ks_filter['service_type'] + ' ' +
(version or self.api_version))
api_version = (self.ks_filter['service_type'] + ' '
+ (version or self.api_version))
headers = kwargs.pop('headers', {})
headers.setdefault('OpenStack-API-Version', api_version)
headers.setdefault('Accept', 'application/json')

View File

@ -326,8 +326,8 @@ class DeleteInventory(command.Command, version.CheckerMixin):
'--resource-class',
metavar='<resource_class>',
required=self.compare_version(version.lt('1.5')),
help=(RC_HELP +
'\nThis argument can be omitted starting with '
help=(RC_HELP
+ '\nThis argument can be omitted starting with '
'``--os-placement-api-version 1.5``. If it is omitted all '
'inventories of the specified resource provider '
'will be deleted.')

View File

@ -6,6 +6,7 @@ description-file =
author = OpenStack
author-email = openstack-discuss@lists.openstack.org
home-page = https://docs.openstack.org/osc-placement/latest/
python-requires = >=3.6
classifier =
Environment :: OpenStack
Intended Audience :: Information Technology
@ -13,6 +14,8 @@ classifier =
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
@ -58,14 +61,6 @@ openstack.placement.v1 =
resource_provider_trait_delete = osc_placement.resources.trait:DeleteResourceProviderTrait
allocation_candidate_list = osc_placement.resources.allocation_candidate:ListAllocationCandidate
[build_sphinx]
source-dir = doc/source
build-dir = doc/build
all_files = 1
[upload_sphinx]
upload-dir = doc/build/html
[compile_catalog]
directory = osc_placement/locale
domain = osc_placement
@ -79,8 +74,3 @@ input_file = osc_placement/locale/osc_placement.pot
keywords = _ gettext ngettext l_ lazy_gettext
mapping_file = babel.cfg
output_file = osc_placement/locale/osc_placement.pot
[build_releasenotes]
all_files = 1
build-dir = releasenotes/build
source-dir = releasenotes/source

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)

View File

@ -2,7 +2,7 @@
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
hacking>=0.12.0,<0.13 # Apache-2.0
hacking>=3.0,<3.1.0 # Apache-2.0
coverage>=4.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0

View File

@ -12,7 +12,6 @@ basepython = python3
usedevelop = True
whitelist_externals =
rm
install_command = pip install {opts} {packages}
setenv =
VIRTUAL_ENV={envdir}
PYTHONWARNINGS=ignore::DeprecationWarning:distutils,ignore::DeprecationWarning:site
@ -84,8 +83,8 @@ commands = oslo_debug_helper {posargs}
[flake8]
# E123, E125 skipped as they are invalid PEP-8.
# W503 line break before binary operator
show-source = True
ignore = E123,E125
ignore = E123,E125,W503
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build