Skip to content

Commit

Permalink
Run black on the entire source code
Browse files Browse the repository at this point in the history
  • Loading branch information
BoboTiG committed Feb 27, 2023
1 parent 16015f5 commit 54f2cf0
Show file tree
Hide file tree
Showing 52 changed files with 1,873 additions and 1,591 deletions.
4 changes: 2 additions & 2 deletions changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Changelog

2023-xx-xx • `full history <https://github.com/gorakhargosh/watchdog/compare/v2.3.0...HEAD>`__

-
- Thanks to our beloved contributors: @
- Run ``black`` on the entire source code
- Thanks to our beloved contributors: @BoboTiG

2.3.0
~~~~~
Expand Down
46 changes: 24 additions & 22 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding: utf-8
#
# watchdog documentation build configuration file, created by
# sphinx-quickstart on Tue Nov 30 00:43:58 2010.
#
Expand All @@ -17,37 +15,37 @@
# 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.
TOP_DIR_PATH = os.path.abspath('../../') # noqa
SRC_DIR_PATH = os.path.join(TOP_DIR_PATH, 'src') # noqa
TOP_DIR_PATH = os.path.abspath("../../") # noqa
SRC_DIR_PATH = os.path.join(TOP_DIR_PATH, "src") # noqa
sys.path.insert(0, SRC_DIR_PATH) # noqa

import watchdog.version # noqa

PROJECT_NAME = 'watchdog'
AUTHOR_NAME = 'Yesudeep Mangalapilly and contributors'
COPYRIGHT = '2010-2023, ' + AUTHOR_NAME
PROJECT_NAME = "watchdog"
AUTHOR_NAME = "Yesudeep Mangalapilly and contributors"
COPYRIGHT = "2010-2023, " + AUTHOR_NAME


# -- General configuration -----------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode'
"sphinx.ext.autodoc",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.ifconfig",
"sphinx.ext.viewcode",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix of source filenames.
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# General information about the project.
project = PROJECT_NAME
Expand All @@ -67,35 +65,39 @@
exclude_patterns = []

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


# -- Options for HTML output ---------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'pyramid'
html_theme = "pyramid"

# Output file base name for HTML help builder.
htmlhelp_basename = '%sdoc' % PROJECT_NAME
htmlhelp_basename = "%sdoc" % PROJECT_NAME


# -- Options for LaTeX output --------------------------------------------------

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', '%s.tex' % PROJECT_NAME, '%s Documentation' % PROJECT_NAME,
AUTHOR_NAME, 'manual'),
(
"index",
"%s.tex" % PROJECT_NAME,
"%s Documentation" % PROJECT_NAME,
AUTHOR_NAME,
"manual",
),
]

# -- Options for manual page output --------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', PROJECT_NAME, '%s Documentation' % PROJECT_NAME,
[AUTHOR_NAME], 1)
("index", PROJECT_NAME, "%s Documentation" % PROJECT_NAME, [AUTHOR_NAME], 1)
]


Expand Down
2 changes: 0 additions & 2 deletions docs/source/examples/logger.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding: utf-8

import sys
import time

Expand Down
9 changes: 4 additions & 5 deletions docs/source/examples/patterns.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# coding: utf-8

import sys
import time

from watchdog.events import PatternMatchingEventHandler
from watchdog.observers import Observer

import logging

logging.basicConfig(level=logging.DEBUG)


Expand All @@ -15,9 +14,9 @@ def on_any_event(self, event):
logging.debug(event)


event_handler = MyEventHandler(patterns=['*.py', '*.pyc'],
ignore_patterns=['version.py'],
ignore_directories=True)
event_handler = MyEventHandler(
patterns=["*.py", "*.pyc"], ignore_patterns=["version.py"], ignore_directories=True
)
observer = Observer()
observer.schedule(event_handler, sys.argv[1], recursive=True)
observer.start()
Expand Down
2 changes: 0 additions & 2 deletions docs/source/examples/simple.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding: utf-8

import logging
import sys
import time
Expand Down
204 changes: 104 additions & 100 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# coding: utf-8
#
# Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com>
# Copyright 2012 Google, Inc & contributors.
#
Expand All @@ -24,133 +22,139 @@
from setuptools.extension import Extension
from setuptools.command.build_ext import build_ext

SRC_DIR = 'src'
WATCHDOG_PKG_DIR = os.path.join(SRC_DIR, 'watchdog')
SRC_DIR = "src"
WATCHDOG_PKG_DIR = os.path.join(SRC_DIR, "watchdog")

# Load the module version
spec = importlib.util.spec_from_file_location(
'version', os.path.join(WATCHDOG_PKG_DIR, 'version.py'))
"version", os.path.join(WATCHDOG_PKG_DIR, "version.py")
)
version = importlib.util.module_from_spec(spec)
spec.loader.exec_module(version)

# Ignored Apple devices on which compiling watchdog_fsevents.c would fail.
# The FORCE_MACOS_MACHINE envar, when set to 1, will force the compilation.
_apple_devices = ('appletv', 'iphone', 'ipod', 'ipad', 'watch')
is_macos = sys.platform == 'darwin' and not machine().lower().startswith(_apple_devices)
_apple_devices = ("appletv", "iphone", "ipod", "ipad", "watch")
is_macos = sys.platform == "darwin" and not machine().lower().startswith(_apple_devices)

ext_modules = []
if is_macos or os.getenv('FORCE_MACOS_MACHINE', '0') == '1':
if is_macos or os.getenv("FORCE_MACOS_MACHINE", "0") == "1":
ext_modules = [
Extension(
name='_watchdog_fsevents',
name="_watchdog_fsevents",
sources=[
'src/watchdog_fsevents.c',
"src/watchdog_fsevents.c",
],
libraries=['m'],
libraries=["m"],
define_macros=[
('WATCHDOG_VERSION_STRING',
'"' + version.VERSION_STRING + '"'),
('WATCHDOG_VERSION_MAJOR', version.VERSION_MAJOR),
('WATCHDOG_VERSION_MINOR', version.VERSION_MINOR),
('WATCHDOG_VERSION_BUILD', version.VERSION_BUILD),
("WATCHDOG_VERSION_STRING", '"' + version.VERSION_STRING + '"'),
("WATCHDOG_VERSION_MAJOR", version.VERSION_MAJOR),
("WATCHDOG_VERSION_MINOR", version.VERSION_MINOR),
("WATCHDOG_VERSION_BUILD", version.VERSION_BUILD),
],
extra_link_args=[
'-framework', 'CoreFoundation',
'-framework', 'CoreServices',
"-framework",
"CoreFoundation",
"-framework",
"CoreServices",
],
extra_compile_args=[
'-std=c99',
'-pedantic',
'-Wall',
'-Wextra',
'-fPIC',

"-std=c99",
"-pedantic",
"-Wall",
"-Wextra",
"-fPIC",
# Issue #620
'-Wno-nullability-completeness',
"-Wno-nullability-completeness",
# Issue #628
'-Wno-nullability-extension',
'-Wno-newline-eof',

"-Wno-nullability-extension",
"-Wno-newline-eof",
# required w/Xcode 5.1+ and above because of '-mno-fused-madd'
'-Wno-error=unused-command-line-argument'
]
"-Wno-error=unused-command-line-argument",
],
),
]

extras_require = {
'watchmedo': ['PyYAML>=3.10'],
"watchmedo": ["PyYAML>=3.10"],
}

with open('README.rst', encoding='utf-8') as f:
with open("README.rst", encoding="utf-8") as f:
readme = f.read()

with open('changelog.rst', encoding='utf-8') as f:
with open("changelog.rst", encoding="utf-8") as f:
changelog = f.read()

setup(name="watchdog",
version=version.VERSION_STRING,
description="Filesystem events monitoring",
long_description=readme + '\n\n' + changelog,
long_description_content_type="text/x-rst",
author="Yesudeep Mangalapilly",
author_email="yesudeep@gmail.com",
license="Apache License 2.0",
url="https://github.com/gorakhargosh/watchdog",
keywords=' '.join([
'python',
'filesystem',
'monitoring',
'monitor',
'FSEvents',
'kqueue',
'inotify',
'ReadDirectoryChangesW',
'polling',
'DirectorySnapshot',
]),
classifiers=[
'Development Status :: 3 - Alpha',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Operating System :: POSIX :: Linux',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: BSD',
'Operating System :: Microsoft :: Windows :: Windows Vista',
'Operating System :: Microsoft :: Windows :: Windows 7',
'Operating System :: Microsoft :: Windows :: Windows 8',
'Operating System :: Microsoft :: Windows :: Windows 8.1',
'Operating System :: Microsoft :: Windows :: Windows 10',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: Implementation :: PyPy',
'Programming Language :: C',
'Topic :: Software Development :: Libraries',
'Topic :: System :: Monitoring',
'Topic :: System :: Filesystems',
'Topic :: Utilities',
],
package_dir={'': SRC_DIR},
packages=find_packages(SRC_DIR),
include_package_data=True,
extras_require=extras_require,
cmdclass={
'build_ext': build_ext,
},
ext_modules=ext_modules,
entry_points={'console_scripts': [
'watchmedo = watchdog.watchmedo:main [watchmedo]',
]},
python_requires='>=3.6',
zip_safe=False
)
setup(
name="watchdog",
version=version.VERSION_STRING,
description="Filesystem events monitoring",
long_description=readme + "\n\n" + changelog,
long_description_content_type="text/x-rst",
author="Yesudeep Mangalapilly",
author_email="yesudeep@gmail.com",
license="Apache License 2.0",
url="https://github.com/gorakhargosh/watchdog",
keywords=" ".join(
[
"python",
"filesystem",
"monitoring",
"monitor",
"FSEvents",
"kqueue",
"inotify",
"ReadDirectoryChangesW",
"polling",
"DirectorySnapshot",
]
),
classifiers=[
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: BSD",
"Operating System :: Microsoft :: Windows :: Windows Vista",
"Operating System :: Microsoft :: Windows :: Windows 7",
"Operating System :: Microsoft :: Windows :: Windows 8",
"Operating System :: Microsoft :: Windows :: Windows 8.1",
"Operating System :: Microsoft :: Windows :: Windows 10",
"Operating System :: Microsoft :: Windows :: Windows 11",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: C",
"Topic :: Software Development :: Libraries",
"Topic :: System :: Monitoring",
"Topic :: System :: Filesystems",
"Topic :: Utilities",
],
package_dir={"": SRC_DIR},
packages=find_packages(SRC_DIR),
include_package_data=True,
extras_require=extras_require,
cmdclass={
"build_ext": build_ext,
},
ext_modules=ext_modules,
entry_points={
"console_scripts": [
"watchmedo = watchdog.watchmedo:main [watchmedo]",
]
},
python_requires=">=3.6",
zip_safe=False,
)
Loading

0 comments on commit 54f2cf0

Please sign in to comment.