Skip to content

Commit

Permalink
More flake8 fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
bje- committed Jul 24, 2023
1 parent 6b63e7a commit 2195564
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 63 deletions.
67 changes: 34 additions & 33 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, time
import sys
import time

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.append("..")
#sys.path.append(os.path.abspath('_ext/'))
# sys.path.append(os.path.abspath('_ext/'))

import deap

Expand Down Expand Up @@ -65,47 +66,47 @@

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# language = None

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
#today = ''
# today = ''
# Else, today_fmt is used as the format for a strftime call.
#today_fmt = '%B %d, %Y'
# today_fmt = '%B %d, %Y'

# List of documents that shouldn't be included in the build.
#unused_docs = []
# unused_docs = []

# List of directories, relative to source directory, that shouldn't be searched
# for source files.
exclude_trees = ['_build']

# The reST default role (used for this markup: `text`) to use for all documents.
#default_role = None
# default_role = None

# If true, '()' will be appended to :func: etc. cross-reference text.
#add_function_parentheses = True
# add_function_parentheses = True

# If true, the current module name will be prepended to all description
# unit titles (such as .. function::).
#add_module_names = True
# add_module_names = True

# If true, sectionauthor and moduleauthor directives will be shown in the
# output. They are ignored by default.
#show_authors = False
# show_authors = False

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'default'

# A list of ignored prefixes for module index sorting.
#modindex_common_prefix = []
# modindex_common_prefix = []

# If true, the todo will be printed in the documentation
todo_include_todos = True

# Search in python documentation
intersphinx_mapping = {'python' : ('http://docs.python.org/', None),
'numpy' : ('http://docs.scipy.org/doc/numpy', None)}
intersphinx_mapping = {'python': ('http://docs.python.org/', None),
'numpy': ('http://docs.scipy.org/doc/numpy', None)}

# Reload the cached values every 5 days
intersphinx_cache_limit = 5
Expand All @@ -116,12 +117,12 @@
plot_include_source = False

# Code that should be executed before each plot.
#plot_pre_code
# plot_pre_code

# Base directory, to which ``plot::`` file names are relative
# to. (If None or empty, file names are relative to the
# directory where the file containing the directive is.)
#plot_basedir
# plot_basedir

# Whether to show links to the files in HTML.
plot_html_show_formats = True
Expand All @@ -143,24 +144,24 @@
# The theme to use for HTML and HTML Help pages. Major themes that come with
# Sphinx are currently 'classic' and 'alabaster'.
html_theme = 'pydoctheme'
#RTFD.org does not support sphinx 1.3.1 yet.
#html_theme = 'alabaster'
# RTFD.org does not support sphinx 1.3.1 yet.
# html_theme = 'alabaster'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#html_theme_options = {'collapsiblesidebar': True}
# html_theme_options = {'collapsiblesidebar': True}

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
#html_title = None
# html_title = None

# A shorter title for the navigation bar. Default is the same as html_title.
#html_short_title = None
# html_short_title = None

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = ""
# html_logo = ""

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
Expand Down Expand Up @@ -190,7 +191,7 @@
html_additional_pages = {}

# If false, no module index is generated.
#html_use_modindex = True
# html_use_modindex = True

# If false, no index is generated.
html_use_index = True
Expand All @@ -199,15 +200,15 @@
html_split_index = True

# If true, links to the reST sources are added to the pages.
#html_show_sourcelink = True
# html_show_sourcelink = True

# If true, an OpenSearch description file will be output, and all pages will
# contain a <link> tag referring to it. The value of this option must be the
# base URL from which the finished HTML is served.
#html_use_opensearch = ''
# html_use_opensearch = ''

# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
#html_file_suffix = ''
# html_file_suffix = ''

# Output file base name for HTML help builder.
htmlhelp_basename = 'DEAP-doc'
Expand All @@ -216,31 +217,31 @@
# -- Options for LaTeX output --------------------------------------------------

# The paper size ('letter' or 'a4').
#latex_paper_size = 'letter'
# latex_paper_size = 'letter'

# The font size ('10pt', '11pt' or '12pt').
#latex_font_size = '10pt'
# latex_font_size = '10pt'

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('contents', 'DEAP.tex', u'DEAP Documentation',
u'DEAP Project', 'manual'),
('contents', 'DEAP.tex', u'DEAP Documentation',
u'DEAP Project', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
# the title page.
#latex_logo = None
# latex_logo = None

# For "manual" documents, if this is true, then toplevel headings are parts,
# not chapters.
#latex_use_parts = False
# latex_use_parts = False

# Additional stuff for the LaTeX preamble.
latex_preamble = r'\usepackage{amsmath,amssymb}'

# Documents to append as an appendix to all manuals.
#latex_appendices = []
# latex_appendices = []

# If false, no module index is generated.
#latex_use_modindex = True
# latex_use_modindex = True
64 changes: 34 additions & 30 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
#!/usr/bin/env python
import sys

from setuptools.command.build_ext import build_ext
from distutils.errors import CCompilerError, DistutilsExecError, \
DistutilsPlatformError

# read the contents of README file
from os import path
import codecs

import deap

warnings = list()

try:
Expand All @@ -11,30 +21,23 @@
from distutils.core import setup, Extension
modules = ['deap', 'deap.benchmarks', 'deap.tests', 'deap.tools', 'deap.tools._hypervolume']

from setuptools.command.build_ext import build_ext
from distutils.errors import CCompilerError, DistutilsExecError, \
DistutilsPlatformError

# read the contents of README file
from os import path
import codecs
this_directory = path.abspath(path.dirname(__file__))
long_description = codecs.open(path.join(this_directory, 'README.md'), 'r', 'utf-8').read()

import deap

if sys.platform == 'win32' and sys.version_info > (2, 6):
# 2.6's distutils.msvc9compiler can raise an IOError when failing to
# find the compiler
# It can also raise ValueError http://bugs.python.org/issue7511
ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError,
IOError, ValueError)
# 2.6's distutils.msvc9compiler can raise an IOError when failing to
# find the compiler
# It can also raise ValueError http://bugs.python.org/issue7511
ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError,
IOError, ValueError)
else:
ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError)
ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError)


class BuildFailed(Exception):
pass


class ve_build_ext(build_ext):
# This class allows C extension building to fail.

Expand All @@ -52,6 +55,7 @@ def build_extension(self, ext):
print(e)
raise BuildFailed()


def run_setup(build_ext):
extra_modules = None
if build_ext:
Expand All @@ -69,25 +73,25 @@ def run_setup(build_ext):
author_email='[email protected]',
url='https://www.github.com/deap',
packages=find_packages(exclude=['examples', 'tests']),
# packages=['deap', 'deap.tools', 'deap.tools._hypervolume', 'deap.benchmarks', 'deap.tests'],
platforms=['any'],
keywords=['evolutionary algorithms', 'genetic algorithms', 'genetic programming', 'cma-es', 'ga', 'gp', 'es', 'pso'],
license='LGPL',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering',
'Topic :: Software Development',
],
ext_modules=extra_modules,
cmdclass={"build_ext": ve_build_ext},
install_requires=['numpy'],
)
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering',
'Topic :: Software Development',
],
ext_modules=extra_modules,
cmdclass={"build_ext": ve_build_ext},
install_requires=['numpy'],
)


try:
run_setup(True)
Expand Down

0 comments on commit 2195564

Please sign in to comment.