# pyproject.toml # Part of the OZI Project, under the Apache License v2.0 with LLVM Exceptions. # See LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception [build-system] build-backend = "ozi_build.buildapi" requires = [ "OZI.build>=0.0.18", "pip-tools>=7", "pipx~=1.5", "setuptools_scm[toml]~=8.0", ] [tool.ozi-build.entry-points] console_scripts = [ "ozi = ozi.__main__:main", "ozi-new = ozi.new.__main__:main", "ozi-fix = ozi.fix.__main__:main", ] [tool.ozi-build.metadata] pkg-info-file = 'PKG-INFO' [tool.setuptools_scm] version_file_template = """ Metadata-Version: 2.1 Name: @PROJECT_NAME@ Version: @SCM_VERSION@ Summary: Package Python projects with Meson. Download-URL: https://github.com/rjdbcm/OZI/archive/refs/tags/@SCM_VERSION@.tar.gz Home-page: https://oziproject.dev/ Author: Eden Ross Duff MSc Author-email: help@oziproject.dev License: @LICENSE@ Keywords: meson,packaging,wheel Project-URL: Bug Tracker, https://github.com/rjdbcm/ozi/issues Project-URL: Community, https://github.com/orgs/OZI-Project/discussions @REQUIREMENTS_IN@ Requires-External: git Requires-Python: >=3.10, <3.13 Classifier: Development Status :: 3 - Alpha Classifier: Environment :: Console Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Apache Software License Classifier: Natural Language :: English Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Topic :: Software Development :: Build Tools Classifier: Topic :: Software Development :: Quality Assurance Classifier: Typing :: Typed Description-Content-Type: text/x-rst @README_TEXT@ """ version_file = "PKG-INFO" fallback_version = "@VCS_TAG@" parentdir_prefix_version = "OZI-" tag_regex = "^(?Pv)?(?P[^\\+]+)(?P.*)?$" [tool.setuptools.dynamic] dependencies = { file = ["requirements.in"] } [project] dynamic = ["dependencies", "version"] license = {file = "LICENSE.txt"} [project.optional_dependencies] # also meson test suite names # continuous integration ci = ["tox>4", "tox-gh>1.2"] # tox -e fix fix = ["black", "ruff>=0.1.6", "autoflake", "isort"] # Default meson test setup dev = ["[dist,lint,test]"] ## Packaging Setup dist = ["python-semantic-release", "sigstore"] ## Linting and Formatting Setup lint = ["bandit[toml]", "black", "flake8", "flake8-quotes", "flake8-pytest-style", "flake8-type-checking", "flake8-annotations", "flake8-broken-line", "flake8-eradicate", "flake8-fixme", "flake8-bugbear", "flake8-datetimez", "flake8-no-pep420", "flake8-comprehensions", "flake8-leading-blank-lines", "flake8-tidy-imports", "flake8-pyi", "Flake8-pyproject", "isort", "mypy", "pyright"] ## Testing Setup test = ["coverage[toml]", "hypothesis[all]", "pytest", "pytest-asyncio", "pytest-cov", "pytest-tcpclient", "pytest-randomly", "pytest-xdist"] [tool.bandit] exclude_dirs = ["venv", "meson-private", "tests"] format = "txt" ignore_nosec = true verbose = true [tool.black] extend-exclude = "(\\.pyi|meson-private|venv)" line-length = 93 [tool.coverage.report] exclude_lines = [ "^.*#\\s*(pragma|PRAGMA)[:\\s]?\\s*(no|NO)\\s*(cover|COVER)", "^.*#\\s*(pragma|PRAGMA)[:\\s]?\\s*(defer|DEFER)\\s*(to|TO)\\s*[a-zA-Z0-9_]*", "def __repr__", "def __wrapper", # functools.wraps decorated functions "(\\.\\.\\.)", "@(abc\\.)?abstractmethod", "class .*\\bProtocol\\):", "if __name__ == .__main__.:", "if (typing\\.)?TYPE_CHECKING:", "(el)?if\\s?(sys\\.)?version_info\\s?(==|<=|>=|<|>)\\s?\\([234],\\s?[0-9]{1,3}\\)\\s?:", ] fail_under = 100.0 show_missing = true skip_covered = true skip_empty = true [tool.coverage.run] branch = true relative_files = true omit = [ '*/vendor/*', ] [tool.ruff] line-length = 93 extend-exclude = ["meson-private", "scripts", "vendor"] # target-version = "@PYTHON_VERSION_DIST@" [tool.ruff.lint] ignore = [ "A003", "ANN401", "ARG", "B028", "B905", "D1", "D101", "D2", "D4", "EM", "FBT", "FLY", "PERF203", "PGH003", "PLR", "PLW", "PT001", "PTH", "RET", "RUF009", "RUF012", "RUF015", "RUF200", "SIM", "T201", "TCH002", "TCH004", "TRY003", "UP", ] select = ["ALL"] [tool.ruff.lint.mccabe] max-complexity = 6 [tool.ruff.format] line-ending = "lf" quote-style = "single" [tool.ruff.lint.isort] force-single-line = true [tool.ruff.lint.pycodestyle] max-line-length = 102 [tool.ruff.lint.flake8-copyright] author="Eden Ross Duff MSc" [tool.ruff.lint.flake8-quotes] inline-quotes = "single" [tool.ruff.lint.flake8-type-checking] strict = true [tool.flake8] ban-relative-imports = "parents" max-line-length = 93 extend-exclude = ["meson-private", "build-env-*", "vendor", "venv", "build*", "*.pyi"] extend-ignore = "E203,E501,TC007,TC008" extend-select = "B950" [tool.isort] line_length = 93 profile = "black" force_single_line = true skip_glob = ['subprojects/*',] [tool.mypy] implicit_reexport = true strict = true exclude = [ 'meson-private', 'tests', 'venv', ] [[tool.mypy.overrides]] module = ["ozi.vendor.*"] ignore_errors = true [[tool.mypy.overrides]] module = ["spdx_license_list.*"] ignore_missing_imports = true [[tool.mypy.overrides]] module = ["mesonbuild.*"] ignore_missing_imports = true [tool.pylint.MASTER] disable = "C0301" expected-line-ending-format = "LF" max-line-length = 93 max-nested-blocks = 4 [tool.pyright] reportMissingTypeStubs = false exclude = [ 'meson-private', 'tests', 'venv', '*/vendor/', ] [tool.pytest.ini_options] #[tool.pytest] # This will be used by pytest in the future filterwarnings = [ "error", "ignore:The --rsyncdir command line argument and rsyncdirs config variable are deprecated.:DeprecationWarning", ] asyncio_mode = "auto" log_cli = true log_cli_date_format = "%Y-%m-%d %H:%M:%S" log_cli_format = "%(asctime)s [%(levelname)8s] %(name)s: %(message)s (%(filename)s:%(lineno)s)" log_cli_level = "INFO" [tool.semantic_release] commit_parser = "emoji" major_on_zero = true tag_format = "{version}" [tool.semantic_release.branches.main] match = "(main|master)" prerelease_token = "alpha" prerelease = false [tool.semantic_release.branches."0.0"] match = "0.0" prerelease_token = "alpha" prerelease = false [tool.semantic_release.branches."release/0.1"] match = "release/0.1" prerelease_token = "alpha" prerelease = false [tool.semantic_release.branches."release/1.0"] match = "release/1.0" prerelease_token = "alpha" prerelease = false [tool.semantic_release.branches."release/1.1"] match = "release/1.1" prerelease_token = "alpha" prerelease = false [tool.semantic_release.branches."release/1.2"] match = "release/1.2" prerelease_token = "alpha" prerelease = false [tool.semantic_release.branches."release/1.3"] match = "release/1.3" prerelease_token = "alpha" prerelease = false [tool.semantic_release.branches."release/1.4"] match = "release/1.4" prerelease_token = "alpha" prerelease = false [tool.semantic_release.branches."release/1.5"] match = "release/1.5" prerelease_token = "alpha" prerelease = false [tool.semantic_release.branches."release/1.6"] match = "release/1.6" prerelease_token = "alpha" prerelease = false [tool.semantic_release.branches."release/1.7"] match = "release/1.7" prerelease_token = "alpha" prerelease = false [tool.semantic_release.branches."release/1.8"] match = "release/1.8" prerelease_token = "alpha" prerelease = false [tool.semantic_release.branches."release/1.9"] match = "release/1.9" prerelease_token = "alpha" prerelease = false [tool.semantic_release.branches."release/1.10"] match = "release/1.10" prerelease_token = "alpha" prerelease = false [tool.semantic_release.branches."release/1.11"] match = "release/1.11" prerelease_token = "alpha" prerelease = false [tool.semantic_release.commit_parser_options] major_tags = [":boom:"] minor_tags = [ ":sparkles:", ] patch_tags = [ ":adhesive_bandage:", ":alembic:", ":alien:", ":ambulance:", ":apple:", ":arrow_down:", ":arrow_up:", ":bento:", ":bug:", ":bulb:", ":card_file_box:", ":chart_with_upwards_trend:", ":checkered_flag:", ":children_crossing:", ":dizzy:", ":egg:", ":fire:", ":globe_with_meridians:", ":goal_net:", ":green_apple:", ":green_heart:", ":hammer:", ":heavy_minus_sign:", ":heavy_plus_sign:", ":iphone:", ":label:", ":lipstick:", ":lock:", ":mag:", ":necktie:", ":package:", ":passport_control:", ":pencil2:", ":penguin:", ":pushpin:", ":recycle:", ":rewind:", ":robot:", ":speech_balloon:", ":triangular_flag_on_post:", ":wastebasket:", ":wheelchair:", ":wrench:", ":zap:", ] [tool.semantic_release.changelog] changelog_file = "CHANGELOG.md" exclude_commit_patterns = ["Merge.*"] [tool.semantic_release.remote] type = "github" [tool.semantic_release.publish] dist_glob_patterns = ["*.whl", "*.tar.gz", "sig/*"] upload_to_vcs_release = true [tool.tox] legacy_tox_ini = """ [tox] skipsdist = True env_list = dist lint test [gh] python = 3.12 = dist,lint,test 3.11 = dist,lint,test 3.10 = dist,lint,test [testenv] allowlist_externals = rm pipx meson python package = wheel deps = -r requirements.in virtualenv commands = meson compile -C {env_tmp_dir} rm -rf {env_tmp_dir}/.gitignore [testenv:dist] description = OZI distribution checkpoint commands_pre = pipx install --python=python meson meson setup {env_tmp_dir} -Ddist=enabled -Dtox-env-dir={env_dir} commands_post = meson test --no-rebuild --maxfail=1 -C {env_tmp_dir} --setup=dist {posargs} [testenv:lint] description = OZI format/lint checkpoint commands_pre = pipx install --python=python meson meson setup {env_tmp_dir} -Dlint=enabled -Dtox-env-dir={env_dir} commands_post = meson test --no-rebuild --maxfail=1 -C {env_tmp_dir} --setup=lint {posargs} [testenv:test] description = OZI unit tests checkpoint commands_pre = pipx install --python=python meson meson setup {env_tmp_dir} -Dtest=enabled -Dozi-blastpipe=enabled -Dtox-env-dir={env_dir} {posargs} commands_post = meson test --no-rebuild --maxfail=1 -C {env_tmp_dir} --setup=test [testenv:fix] description = OZI project fix issues utility (black, isort, autoflake, ruff) deps = pipx skip_install = true commands = pipx run --python {env_python} black -S . pipx run --python {env_python} isort . pipx run --python {env_python} autoflake -i -r . pipx run --python {env_python} ruff check ozi --fix [testenv:scm] description = OZI supply chain management (setuptools_scm) deps = setuptools_scm[toml]>=8 commands = {env_python} -m setuptools_scm {posargs} """