From 318529b8fc6ec082866111d1a7761182f5e2525a Mon Sep 17 00:00:00 2001 From: Russ Allbery Date: Thu, 16 Mar 2023 08:16:20 -0700 Subject: [PATCH] Convert to pyproject.toml Convert the packaging to use only pyproject.toml and remove setup.cfg and setup.py. Convert README to Markdown. --- .flake8 | 7 +++++ LICENSE | 2 +- README.md | 7 +++++ README.rst | 8 ------ pyproject.toml | 69 ++++++++++++++++++++++++++++++++++++++++---------- setup.cfg | 56 ---------------------------------------- setup.py | 3 --- tox.ini | 2 +- 8 files changed, 72 insertions(+), 82 deletions(-) create mode 100644 .flake8 create mode 100644 README.md delete mode 100644 README.rst delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..01ee5229 --- /dev/null +++ b/.flake8 @@ -0,0 +1,7 @@ +[flake8] +max-line-length = 79 +# E203: whitespace before :, flake8 disagrees with PEP-8 +# W503: line break after binary operator, flake8 disagrees with PEP-8 +ignore = E203, W503 +exclude = + docs/conf.py diff --git a/LICENSE b/LICENSE index 7766ce9c..65cd6872 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020-2022 Association of Universities for Research in Astronomy, Inc. (AURA) +Copyright (c) 2020-2023 Association of Universities for Research in Astronomy, Inc. (AURA) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md new file mode 100644 index 00000000..3c24d227 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# mobu + +mobu (short for "monkey business") is a test framework for the [Rubin Science Platform](https://phalanx.lsst.io/). +It attempts to simulate user interactions with Science Platform services continuously, recording successes and failures and optionally reporting failures to a Slack channel via a Slack incoming webhook. +It can be used for both monitoring and synthetic load testing. + +mobu is developed with the [Safir](https://safir.lsst.io/) framework. diff --git a/README.rst b/README.rst deleted file mode 100644 index 6f358bd8..00000000 --- a/README.rst +++ /dev/null @@ -1,8 +0,0 @@ -#### -mobu -#### - -Framework to generate random walking user load for testing services - -mobu is developed with the `Safir `__ framework. -`Get started with development with the tutorial `__. diff --git a/pyproject.toml b/pyproject.toml index ac7d1b07..702fa5e0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,37 @@ -[build-system] -requires = [ - "setuptools>=42", - "wheel", - "setuptools_scm[toml]>=3.4" +[project] +# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/ +name = "mobu" +description = "Simulate user load for Science Platform testing" +license = { file = "LICENSE" } +readme = "README.md" +keywords = ["rubin", "lsst"] +# https://pypi.org/classifiers/ +classifiers = [ + "Development Status :: 4 - Beta", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.11", + "Intended Audience :: Developers", + "Natural Language :: English", + "Operating System :: POSIX", + "Typing :: Typed", ] -build-backend = 'setuptools.build_meta' +requires-python = ">=3.11" +# Use requirements/main.in for runtime dependencies instead. +dependencies = [] +dynamic = ["version"] + +[project.scripts] +monkeyflocker = "monkeyflocker.cli:main" + +[project.urls] +Homepage = "https://github.com/lsst-sqre/mobu" +Source = "https://github.com/lsst-sqre/mobu" + +[build-system] +requires = ["setuptools>=61", "wheel", "setuptools_scm[toml]>=6.2"] +build-backend = "setuptools.build_meta" [tool.setuptools_scm] @@ -32,7 +59,7 @@ exclude_lines = [ [tool.black] line-length = 79 -target-version = ['py38'] +target-version = ['py311'] exclude = ''' /( \.eggs @@ -49,8 +76,8 @@ exclude = ''' # Multi-line strings are implicitly treated by black as regular expressions [tool.isort] -include_trailing_comma = true -multi_line_output = 3 +profile = "black" +line_length = 79 known_first_party = ["mobu", "tests"] skip = ["docs/conf.py"] @@ -60,7 +87,23 @@ filterwarnings = [ # Bug in aiojobs "ignore:with timeout\\(\\) is deprecated:DeprecationWarning" ] -python_files = [ - "tests/*.py", - "tests/*/*.py" -] +# The python_files setting is not for test detection (pytest will pick up any +# test files named *_test.py without this setting) but to enable special +# assert processing in any non-test supporting files under tests. We +# conventionally put test support functions under tests.support and may +# sometimes use assert in test fixtures in conftest.py, and pytest only +# enables magical assert processing (showing a full diff on assert failures +# with complex data structures rather than only the assert message) in files +# listed in python_files. +python_files = ["tests/*.py", "tests/*/*.py"] + +[tool.mypy] +disallow_untyped_defs = true +disallow_incomplete_defs = true +ignore_missing_imports = true +plugins = ["pydantic.mypy"] +show_error_codes = true +strict_equality = true +warn_redundant_casts = true +warn_unreachable = true +warn_unused_ignores = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 7982bff2..00000000 --- a/setup.cfg +++ /dev/null @@ -1,56 +0,0 @@ -[metadata] -name = mobu -description = Framework to generate science user load for testing. -author = Association of Universities for Research in Astronomy, Inc. (AURA) -author_email = sqre-admin@lists.lsst.org -long_description = file: README.rst, LICENSE -long_description_content_type = text/x-rst -url = https://github.com/lsst-sqre/mobu -project_urls = - Source code = https://github.com/lsst-sqre/mobu - Issue tracker = https://github.com/lsst-sqre/mobu/issues -classifiers = - Development Status :: 4 - Beta - License :: OSI Approved :: MIT License - Programming Language :: Python - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.11 - Natural Language :: English - Operating System :: POSIX -keywords = - lsst - -[options] -zip_safe = False -include_package_data = True -package_dir = - = src -packages=find: -python_requires = >=3.11 -setup_requires = - setuptools_scm -# Use requirements/main.in for runtime dependencies instead of install_requires - -[options.packages.find] -where = src - -[options.entry_points] -console_scripts = - monkeyflocker = monkeyflocker.cli:main - -[flake8] -max-line-length = 79 -# E203: whitespace before :, flake8 disagrees with PEP-8 -# W503: line break after binary operator, flake8 disagrees with PEP-8 -ignore = E203, W503 - -[mypy] -disallow_untyped_defs = True -disallow_incomplete_defs = True -ignore_missing_imports = True -plugins = pydantic.mypy -show_error_codes = True -strict_equality = True -warn_redundant_casts = True -warn_unreachable = True -warn_unused_ignores = True diff --git a/setup.py b/setup.py deleted file mode 100644 index d5d43d7c..00000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup(use_scm_version=True) diff --git a/tox.ini b/tox.ini index ad6984f9..780921e0 100644 --- a/tox.ini +++ b/tox.ini @@ -21,7 +21,7 @@ commands = coverage report [testenv:typing] description = Run mypy. commands = - mypy src/mobu tests setup.py + mypy src/mobu tests [testenv:lint] description = Lint codebase by running pre-commit (Black, isort, Flake8).