From 96614ea658fc67f67dae961bf9e4112990096130 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 28 Jan 2025 21:00:22 +0100 Subject: [PATCH] PEP 621: Storing project metadata in pyproject.toml (#423) --- .style.yapf | 3 --- pyproject.toml | 38 ++++++++++++++++++++++++++++++++++++++ pytest.ini | 45 --------------------------------------------- 3 files changed, 38 insertions(+), 48 deletions(-) delete mode 100644 .style.yapf create mode 100644 pyproject.toml delete mode 100644 pytest.ini diff --git a/.style.yapf b/.style.yapf deleted file mode 100644 index 64ab7f0e..00000000 --- a/.style.yapf +++ /dev/null @@ -1,3 +0,0 @@ -[style] -based_on_style = yapf -indent_width = 2 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..bdf58d2c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,38 @@ +# DO always create a tracking issue when allow-listing warnings +# DO NOT disable warnings-as-error: warnings of today are tomorrow's evolvability blocker. + +[tool.pytest.ini_options] +filterwarnings = [ + # Treat warnings as errors + "error", + # ...except this allow list: + # Issue #35 + "ignore:the imp module is deprecated:DeprecationWarning", + # Issue #36 + "ignore:`np.bool` is a deprecated alias:DeprecationWarning", + # Issue #37 + "ignore:Encoding a StructuredValue with type tf_agents.policies.greedy_policy.DeterministicWithLogProb_ACTTypeSpec:UserWarning", + # Not much to do about this, it's caused by gin + "ignore:Using or importing the ABCs from 'collections':DeprecationWarning", + # Issue #119 + "ignore:Encoding a StructuredValue with type tfp.distributions.Deterministic_ACTTypeSpec:UserWarning", + # This warning stems from tensorflow and tf-agents and will presumably + # be fixed by them before v3.12 + "ignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning", + # Also an issue internal to tensorflow + "ignore:Call to deprecated create function .*Descriptor.*:DeprecationWarning", + # Also internal to tensorflow + "ignore:non-integer arguments to randrange.*:DeprecationWarning", + # Issue #110 + "ignore:Importing display from IPython.core.display is deprecated since IPython 7.14, please import from IPython display:DeprecationWarning", + # Issue #132 + "ignore:Encoding a StructuredValue with type tfp.distributions.Categorical_ACTTypeSpec:UserWarning", + "ignore:distutils Version classes are deprecated. Use packaging.version instead:DeprecationWarning", + # Issue #255 + "ignore:The line search algorithm did not converge", + "ignore:Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation.", +] + +[tool.yapf] +based_on_style = "yapf" +indent_width = 2 diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index cbfbbaf4..00000000 --- a/pytest.ini +++ /dev/null @@ -1,45 +0,0 @@ -# DO always create a tracking issue when allow-listing warnings -# DO NOT disable warnings-as-error: warnings of today are tomorrow's evolvability blocker. -[pytest] -filterwarnings = - # Treat warnings as errors - error - - # ...except this allow list: - # Issue #35 - ignore:the imp module is deprecated:DeprecationWarning - - # Issue #36 - ignore:`np.bool` is a deprecated alias:DeprecationWarning - - # Issue #37 - ignore:Encoding a StructuredValue with type tf_agents.policies.greedy_policy.DeterministicWithLogProb_ACTTypeSpec:UserWarning - - # Not much to do about this, it's caused by gin - ignore:Using or importing the ABCs from 'collections':DeprecationWarning - - # Issue #119 - ignore:Encoding a StructuredValue with type tfp.distributions.Deterministic_ACTTypeSpec:UserWarning - - # This warning stems from tensorflow and tf-agents and will presumably - # be fixed by them before v3.12 - ignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning - - # Also an issue internal to tensorflow - ignore:Call to deprecated create function .*Descriptor.*:DeprecationWarning - - # Also internal to tensorflow - ignore:non-integer arguments to randrange.*:DeprecationWarning - - # Issue #110 - ignore:Importing display from IPython.core.display is deprecated since IPython 7.14, please import from IPython display:DeprecationWarning - - # Issue #132 - ignore:Encoding a StructuredValue with type tfp.distributions.Categorical_ACTTypeSpec:UserWarning - - ignore:distutils Version classes are deprecated. Use packaging.version instead:DeprecationWarning - - # Issue #255 - ignore:The line search algorithm did not converge - - ignore:Conversion of an array with ndim > 0 to a scalar is deprecated, and will error in future. Ensure you extract a single element from your array before performing this operation.