From e2c8680d2aa43c528a18e82bd673289035bd3bfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Thu, 23 Jan 2020 19:53:05 +0100 Subject: [PATCH] various import cleanup and lgtm.yml tweak --- .lgtm.yml | 5 +++++ build/sage_bootstrap/download/app.py | 8 +++----- build/sage_bootstrap/download/cmdline.py | 8 +++----- src/fpickle_setup.py | 1 - src/sage_setup/docbuild/ext/inventory_builder.py | 5 +---- src/sage_setup/docbuild/ext/multidocs.py | 3 --- 6 files changed, 12 insertions(+), 18 deletions(-) diff --git a/.lgtm.yml b/.lgtm.yml index b0978fd288d..3696b57dacc 100644 --- a/.lgtm.yml +++ b/.lgtm.yml @@ -6,6 +6,11 @@ path_classifiers: imports_only: - "**/all.py" - "**/*catalog*.py" + - "**/species/library.py" + - "**/matroids/advanced.py" + - "**/categories/basic.py" + - "**/interacts/geometry.py" + - "**/combinat/ribbon.py" extraction: python: python_setup: diff --git a/build/sage_bootstrap/download/app.py b/build/sage_bootstrap/download/app.py index 31083b57a2c..69acdb78e2d 100644 --- a/build/sage_bootstrap/download/app.py +++ b/build/sage_bootstrap/download/app.py @@ -4,18 +4,16 @@ """ -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2016 Volker Braun # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. -# http://www.gnu.org/licenses/ -#***************************************************************************** +# https://www.gnu.org/licenses/ +# **************************************************************************** -import os -import sys import logging log = logging.getLogger() diff --git a/build/sage_bootstrap/download/cmdline.py b/build/sage_bootstrap/download/cmdline.py index dc3ef44cd84..c26e9d08e35 100644 --- a/build/sage_bootstrap/download/cmdline.py +++ b/build/sage_bootstrap/download/cmdline.py @@ -5,18 +5,16 @@ This module handles the main "sage-download-file" commandline utility. """ - -#***************************************************************************** +# **************************************************************************** # Copyright (C) 2016 Volker Braun # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. -# http://www.gnu.org/licenses/ -#***************************************************************************** +# https://www.gnu.org/licenses/ +# **************************************************************************** -import os import sys import logging log = logging.getLogger() diff --git a/src/fpickle_setup.py b/src/fpickle_setup.py index f9572d2546d..1c800a7f012 100644 --- a/src/fpickle_setup.py +++ b/src/fpickle_setup.py @@ -4,7 +4,6 @@ a library file. It solves the issue from :trac:`11874`. """ import types -import copy from six.moves import copyreg from six import get_method_function, get_method_self diff --git a/src/sage_setup/docbuild/ext/inventory_builder.py b/src/sage_setup/docbuild/ext/inventory_builder.py index 09520372733..c3b58cca354 100644 --- a/src/sage_setup/docbuild/ext/inventory_builder.py +++ b/src/sage_setup/docbuild/ext/inventory_builder.py @@ -7,13 +7,10 @@ inventory files and pickle files. The documentation files are not written. """ from sphinx.builders.html import StandaloneHTMLBuilder -from sphinx.util.console import bold from os import path - -from six import iteritems, text_type - import shutil + class InventoryBuilder(StandaloneHTMLBuilder): """ A customized HTML builder which only generates intersphinx "object.inv" diff --git a/src/sage_setup/docbuild/ext/multidocs.py b/src/sage_setup/docbuild/ext/multidocs.py index bc5ca9e23c5..71a08cd9379 100644 --- a/src/sage_setup/docbuild/ext/multidocs.py +++ b/src/sage_setup/docbuild/ext/multidocs.py @@ -23,10 +23,7 @@ from six import text_type import os -import sys import shutil -import re -import tempfile import sphinx from sphinx.util.console import bold from sage.env import SAGE_DOC