From f54b940f8bb169bd54d901e37eeb3b95afb89d57 Mon Sep 17 00:00:00 2001 From: Claas Date: Tue, 20 Feb 2024 13:09:36 +0100 Subject: [PATCH] Moved all project configuration from setup.cfg to pyproject.toml Moved all tox configuration from setup.cfg to tox.ini. Deleted setup.cfg --- pyproject.toml | 285 +++++++++++++++++++++++++++++-------------------- setup.cfg | 83 -------------- tox.ini | 27 +++++ 3 files changed, 197 insertions(+), 198 deletions(-) delete mode 100644 setup.cfg create mode 100644 tox.ini diff --git a/pyproject.toml b/pyproject.toml index 05c7b26..ec84acb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,115 +1,170 @@ -[build-system] -requires = ["setuptools", "wheel"] -build-backend = "setuptools.build_meta" - -[tool.black] -line-length = 120 -target-version = ["py39", "py310", "py311", "py312"] - -[tool.ruff] -exclude = [ - ".git", - ".venv", - ".tox", - "build", - "dist", - "__pycache__", - "./docs/source/conf.py", - "./src/folder_to_be_ignored", -] -src = ["src"] -ignore = [ - "E501", # Line length too long - "D100", # Missing docstring in public module - "D104", # Missing docstring in public package - "D105", # Missing docstring in magic method - "D107", # Missing docstring in __init__ - "D202", # No blank lines allowed after function docstring - "D203", # 1 blank line required before class docstring - "D205", # 1 blank line required between summary line and description - "D212", # Multi-line docstring summary should start at the first line - "D213", # Multi-line docstring summary should start at the second line - # "N802", # Function name should be lowercase (uncomment if you want to allow Uppercase function names) - # "N803", # Argument name should be lowercase (uncomment if you want to allow Uppercase argument names) - "N806", # Variable in function should be lowercase (uncomment if you want to allow Uppercase variable names in functions) - # "N815", # Variable in class scope should not be mixedCase (uncomment if you want to allow mixedCase variable names in class scope) - # "N816", # Variable in global scope should not be mixedCase (uncomment if you want to allow mixedCase variable names in global scope) - "N999", # Invalid module name - ] -line-length = 120 -select = [ - "E", - "D", - "F", - "N", - "W", - "I", - "B", -] -target-version = "py39" - -[tool.ruff.pep8-naming] -ignore-names = [ - "test_*", - "setUp", - "tearDown", -] - -[tool.ruff.pydocstyle] -convention = "numpy" - -[tool.ruff.per-file-ignores] -"__init__.py" = ["I001"] -"./tests/*" = ["D"] - -[tool.pyright] -exclude = [ - ".git", - ".venv", - ".tox", - "build", - "dist", - "**/__pycache__", - "./docs/source/conf.py", - "./src/folder_to_be_ignored", - "./venv", -] -extraPaths = ["./src"] -typeCheckingMode = "basic" -useLibraryCodeForTypes = true -reportMissingParameterType = "error" -reportUnknownParameterType = "warning" -reportUnknownMemberType = "warning" -reportMissingTypeArgument = "error" -reportPropertyTypeMismatch = "error" -reportFunctionMemberAccess = "warning" -reportPrivateUsage = "warning" -reportTypeCommentUsage = "warning" -reportIncompatibleMethodOverride = "warning" -reportIncompatibleVariableOverride = "error" -reportInconsistentConstructor = "error" -reportOverlappingOverload = "warning" -reportUninitializedInstanceVariable = "warning" -reportCallInDefaultInitializer = "warning" -reportUnnecessaryIsInstance = "information" -reportUnnecessaryCast = "warning" -reportUnnecessaryComparison = "warning" -reportUnnecessaryContains = "warning" -reportUnusedCallResult = "warning" -reportUnusedExpression = "warning" -reportMatchNotExhaustive = "warning" -reportShadowedImports = "warning" -reportUntypedFunctionDecorator = "warning" -reportUntypedBaseClass = "error" -reportUntypedNamedTuple = "warning" -# Activate the following rules only locally and temporary, i.e. for a QA session. -# (For server side CI they are considered too strict.) -# reportConstantRedefinition = "warning" -# reportUnnecessaryTypeIgnoreComment = "information" -# reportImportCycles = "warning" -# reportImplicitStringConcatenation = "warning" - -[tool.pytest.ini_options] -testpaths = "tests" -addopts = "--strict-markers" -xfail_strict = true +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "maritime-schema" +version = "0.0.3b1" +description = "Python data classes and JSON schemata for maritime traffic scenarios." +readme = "README.md" +requires-python = ">= 3.9" +license = {file = "LICENSE"} +authors = [ + {name = "Author One", email = "author.one@dnv.com"}, +] +maintainers = [ + {name = "Claas Rostock", email = "claas.rostock@dnv.com"} +] +keywords = [] +classifiers = [ + "Development Status :: 3 - Alpha", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + "Operating System :: MacOS", + "Environment :: Console", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Topic :: Scientific/Engineering", + "Topic :: Software Development :: Libraries :: Python Modules", +] +dependencies = [ + "pydantic>=2.5", + "dictIO>=0.3.1", + # "some_package_on_pypi>=0.1.0", + # "some_project_in_my_local_dev @ file:../some_project_in_my_local_dev", + # "some_project_on_github @ git+https://github.com/user/project.git@version_or_tag_or_branch_name#egg=project_name", +] + +[project.urls] +Homepage = "https://github.com/dnv-opensource/maritime-schema" +Documentation = "https://dnv-opensource.github.io/maritime-schema/README.html" +Repository = "https://github.com/dnv-opensource/maritime-schema.git" +Issues = "https://github.com/dnv-opensource/maritime-schema/issues" +Changelog = "https://github.com/dnv-opensource/maritime-schema/blob/main/CHANGELOG.md" + +[project.scripts] +maritime-schema = "maritime_schema.cli.maritime_schema:main" + +[tool.setuptools] +packages = "find:" + +[tool.setuptools.packages.find] +where = ["src"] +exclude = ["test*"] + +[tool.black] +line-length = 120 +target-version = ["py39", "py310", "py311", "py312"] + +[tool.ruff] +exclude = [ + ".git", + ".venv", + ".tox", + "build", + "dist", + "__pycache__", + "./docs/source/conf.py", + "./src/folder_to_be_ignored", +] +src = ["src"] +ignore = [ + "E501", # Line length too long + "D100", # Missing docstring in public module + "D104", # Missing docstring in public package + "D105", # Missing docstring in magic method + "D107", # Missing docstring in __init__ + "D202", # No blank lines allowed after function docstring + "D203", # 1 blank line required before class docstring + "D205", # 1 blank line required between summary line and description + "D212", # Multi-line docstring summary should start at the first line + "D213", # Multi-line docstring summary should start at the second line + # "N802", # Function name should be lowercase (uncomment if you want to allow Uppercase function names) + # "N803", # Argument name should be lowercase (uncomment if you want to allow Uppercase argument names) + "N806", # Variable in function should be lowercase (uncomment if you want to allow Uppercase variable names in functions) + # "N815", # Variable in class scope should not be mixedCase (uncomment if you want to allow mixedCase variable names in class scope) + # "N816", # Variable in global scope should not be mixedCase (uncomment if you want to allow mixedCase variable names in global scope) + "N999", # Invalid module name + ] +line-length = 120 +select = [ + "E", + "D", + "F", + "N", + "W", + "I", + "B", +] +target-version = "py39" + +[tool.ruff.pep8-naming] +ignore-names = [ + "test_*", + "setUp", + "tearDown", +] + +[tool.ruff.pydocstyle] +convention = "numpy" + +[tool.ruff.per-file-ignores] +"__init__.py" = ["I001"] +"./tests/*" = ["D"] + +[tool.pyright] +exclude = [ + ".git", + ".venv", + ".tox", + "build", + "dist", + "**/__pycache__", + "./docs/source/conf.py", + "./src/folder_to_be_ignored", + "./venv", +] +extraPaths = ["./src"] +typeCheckingMode = "basic" +useLibraryCodeForTypes = true +reportMissingParameterType = "error" +reportUnknownParameterType = "warning" +reportUnknownMemberType = "warning" +reportMissingTypeArgument = "error" +reportPropertyTypeMismatch = "error" +reportFunctionMemberAccess = "warning" +reportPrivateUsage = "warning" +reportTypeCommentUsage = "warning" +reportIncompatibleMethodOverride = "warning" +reportIncompatibleVariableOverride = "error" +reportInconsistentConstructor = "error" +reportOverlappingOverload = "warning" +reportUninitializedInstanceVariable = "warning" +reportCallInDefaultInitializer = "warning" +reportUnnecessaryIsInstance = "information" +reportUnnecessaryCast = "warning" +reportUnnecessaryComparison = "warning" +reportUnnecessaryContains = "warning" +reportUnusedCallResult = "warning" +reportUnusedExpression = "warning" +reportMatchNotExhaustive = "warning" +reportShadowedImports = "warning" +reportUntypedFunctionDecorator = "warning" +reportUntypedBaseClass = "error" +reportUntypedNamedTuple = "warning" +# Activate the following rules only locally and temporary, i.e. for a QA session. +# (For server side CI they are considered too strict.) +# reportConstantRedefinition = "warning" +# reportUnnecessaryTypeIgnoreComment = "information" +# reportImportCycles = "warning" +# reportImplicitStringConcatenation = "warning" + +[tool.pytest.ini_options] +testpaths = "tests" +addopts = "--strict-markers" +xfail_strict = true diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 3d4e942..0000000 --- a/setup.cfg +++ /dev/null @@ -1,83 +0,0 @@ -[metadata] -name = maritime-schema -version = 0.0.3b1 -summary = Python data classes and JSON schemata for maritime traffic scenarios. -description = Python package containing data classes and corresponding JSON schemata for common types used in generating traffic scenarios and testing of autonomy. -long_description = file: README.md -long_description_content_type = text/markdown -home_page = https://dnv-opensource.github.io/maritime-schema/README.html -project_urls = - GitHub = https://github.com/dnv-opensource/maritime-schema -license = MIT -license_files = LICENSE -classifiers = - Development Status :: 3 - Alpha - License :: OSI Approved :: MIT License - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3.12 - Operating System :: Microsoft :: Windows - Operating System :: POSIX :: Linux - Operating System :: MacOS - Environment :: Console - Intended Audience :: Developers - Intended Audience :: Science/Research - Topic :: Scientific/Engineering - Topic :: Software Development :: Libraries :: Python Modules -platform = Python3.x -readme_file = README.md -author = Author One -author_email = "Author One" -maintainer = Claas Rostock -maintainer_email = "Claas Rostock" - -[options] -package_dir = - =src -packages = find: -include_package_data = True -python_requires = >=3.9 -install_requires = - pydantic>=2.5 - dictIO>=0.3.1 - # some_package_on_pypi>=0.1.0 - # some_project_in_my_local_dev @ file:../some_project_in_my_local_dev - # some_project_on_github @ git+https://github.com/user/project.git@version_or_tag_or_branch_name#egg=project_name - -[options.packages.find] -where = src -exclude = - test* - -[options.entry_points] -console_scripts = - maritime-schema = maritime_schema.cli.maritime_schema:main - -[coverage:run] -source = maritime_schema -branch = True - -[coverage:report] -fail_under = 10.0 -show_missing = True -skip_covered = True - -[coverage:paths] -source = - src/maritime_schema - */site-packages/maritime-schema - -[tox:tox] -isolated_build = True -envlist = py{39,310,311,312}-{linux,macos,windows} -# envlist = py{39,310,311,312}-{windows} -# envlist = py{39,310,311,312} - -[testenv] -system_site_packages = True -deps = - pytest>=7.4 - pytest-cov>=4.1 -commands = - pytest --cov --cov-config setup.cfg {posargs} diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..85e7ff0 --- /dev/null +++ b/tox.ini @@ -0,0 +1,27 @@ +[tox] +isolated_build = True +envlist = py{39,310,311,312}-{linux,macos,windows} +# envlist = py{39,310,311,312}-{windows} +# envlist = py{39,310,311,312} + +[coverage:paths] +source = + src/maritime_schema + */site-packages/maritime-schema + +[coverage:run] +source = maritime_schema +branch = True + +[coverage:report] +fail_under = 10.0 +show_missing = True +skip_covered = True + +[testenv] +system_site_packages = True +deps = + pytest>=7.4 + pytest-cov>=4.1 +commands = + pytest --cov --cov-config setup.cfg {posargs}