Repository: HypothesisWorks/hypothesis

Issue:
Make settings.define_setting a private method
By renaming it to have a leading underscore, `_define_setting`.

That will stop it showing up [here](https://hypothesis.readthedocs.io/en/latest/settings.html#hypothesis.settings), which should only be listing the settings attributes!

Implementing this change should be very simple, just find-and-replace the name in `_settings.py` and write a small changelog entry.  If you would like to try fixing this issue, feel free to ask me any questions about getting set up, or for help with making the actual fix :smile:


Discussion:
Hey @Zac-HD I'd be interested in working on this! Looks pretty simple but I want to make sure I follow the guidelines and can build the docs locally to test :)
Awesome!  Let me know if you need any help :smile:  
Tips:
- `pip install -r requirements/tools.in` (`.txt` in a virtualenv to get pinned versions), then `pip install -e hypothesis-python`
- `cd hypothesis-python/docs` then `sphinx-build . _build` to make the docs
- If you're on Linux and don't mind automatically downloading some stuff, `make docs` will do everything including creating a reproducible environment to do it in.
- Don't forget to add yourself to the list of contributors in `CONTRIBUTING.rst`, and to write a changelog entry (see `guides/documentation.rst`)
- Have fun!

Resolving patch:
diff --git a/hypothesis-python/src/hypothesis/_settings.py b/hypothesis-python/src/hypothesis/_settings.py
--- a/hypothesis-python/src/hypothesis/_settings.py
+++ b/hypothesis-python/src/hypothesis/_settings.py
@@ -245,7 +245,7 @@ def new_test(*args, **kwargs):
         return test_to_use
 
     @classmethod
-    def define_setting(
+    def _define_setting(
         cls, name, description, default, options=None,
         validator=None, show_default=True, future_default=not_set,
         deprecation_message=None, hide_repr=not_set,
@@ -392,7 +392,7 @@ class Setting(object):
     hide_repr = attr.ib()
 
 
-settings.define_setting(
+settings._define_setting(
     'min_satisfying_examples',
     default=not_set,
     description="""
@@ -405,7 +405,7 @@ class Setting(object):
 """
 )
 
-settings.define_setting(
+settings._define_setting(
     'max_examples',
     default=100,
     description="""
@@ -414,7 +414,7 @@ class Setting(object):
 """
 )
 
-settings.define_setting(
+settings._define_setting(
     'max_iterations',
     default=not_set,
     description="""
@@ -426,7 +426,7 @@ class Setting(object):
 """
 )
 
-settings.define_setting(
+settings._define_setting(
     'buffer_size',
     default=8 * 1024,
     description="""
@@ -437,7 +437,7 @@ class Setting(object):
 )
 
 
-settings.define_setting(
+settings._define_setting(
     'max_shrinks',
     default=500,
     description="""
@@ -455,7 +455,7 @@ def _validate_timeout(n):
         return n
 
 
-settings.define_setting(
+settings._define_setting(
     'timeout',
     default=60,
     description="""
@@ -476,7 +476,7 @@ def _validate_timeout(n):
     validator=_validate_timeout
 )
 
-settings.define_setting(
+settings._define_setting(
     'derandomize',
     default=False,
     description="""
@@ -490,7 +490,7 @@ def _validate_timeout(n):
 """
 )
 
-settings.define_setting(
+settings._define_setting(
     'strict',
     default=os.getenv('HYPOTHESIS_STRICT_MODE') == 'true',
     description="""
@@ -521,7 +521,7 @@ def _validate_database(db, _from_db_file=False):
     )
 
 
-settings.define_setting(
+settings._define_setting(
     'database',
     default=not_set,
     show_default=False,
@@ -534,7 +534,7 @@ def _validate_database(db, _from_db_file=False):
     validator=_validate_database,
 )
 
-settings.define_setting(
+settings._define_setting(
     'database_file',
     default=not_set,
     show_default=False,
@@ -649,7 +649,7 @@ def __repr__(self):
         return 'Verbosity.%s' % (self.name,)
 
 
-settings.define_setting(
+settings._define_setting(
     'verbosity',
     options=tuple(Verbosity),
     default=Verbosity._get_default(),
@@ -667,7 +667,7 @@ def _validate_phases(phases):
     return phases
 
 
-settings.define_setting(
+settings._define_setting(
     'phases',
     default=tuple(Phase),
     description=(
@@ -677,7 +677,7 @@ def _validate_phases(phases):
     validator=_validate_phases,
 )
 
-settings.define_setting(
+settings._define_setting(
     name='stateful_step_count',
     default=50,
     description="""
@@ -685,7 +685,7 @@ def _validate_phases(phases):
 """
 )
 
-settings.define_setting(
+settings._define_setting(
     'perform_health_check',
     default=not_set,
     description=u"""
@@ -720,14 +720,14 @@ def validate_health_check_suppressions(suppressions):
     return suppressions
 
 
-settings.define_setting(
+settings._define_setting(
     'suppress_health_check',
     default=(),
     description="""A list of health checks to disable.""",
     validator=validate_health_check_suppressions
 )
 
-settings.define_setting(
+settings._define_setting(
     'deadline',
     default=not_set,
     description=u"""
@@ -746,7 +746,7 @@ def validate_health_check_suppressions(suppressions):
 """
 )
 
-settings.define_setting(
+settings._define_setting(
     'use_coverage',
     default=True,
     description="""
@@ -782,7 +782,7 @@ class PrintSettings(Enum):
     """Always print a blob on failure."""
 
 
-settings.define_setting(
+settings._define_setting(
     'print_blob',
     default=PrintSettings.INFER,
     description="""


Test patch:
diff --git a/hypothesis-python/tests/cover/test_settings.py b/hypothesis-python/tests/cover/test_settings.py
--- a/hypothesis-python/tests/cover/test_settings.py
+++ b/hypothesis-python/tests/cover/test_settings.py
@@ -259,7 +259,7 @@ def test_can_override_database_file():
 
 def test_cannot_define_settings_once_locked():
     with pytest.raises(InvalidState):
-        settings.define_setting('hi', 'there', 4)
+        settings._define_setting('hi', 'there', 4)
 
 
 def test_cannot_assign_default():