boilerplates 1.1.4.dev1__tar.gz → 1.2.0.dev0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/NOTICE +1 -0
  2. {boilerplates-1.1.4.dev1/boilerplates.egg-info → boilerplates-1.2.0.dev0}/PKG-INFO +9 -9
  3. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates/sentry.py +49 -3
  4. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates/setup.py +2 -4
  5. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0/boilerplates.egg-info}/PKG-INFO +9 -9
  6. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/setup.py +2 -1
  7. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/test/__init__.py +4 -0
  8. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/LICENSE +0 -0
  9. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/MANIFEST.in +0 -0
  10. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/README.rst +0 -0
  11. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates/__init__.py +0 -0
  12. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates/bundled_version_query/__init__.py +0 -0
  13. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates/bundled_version_query/git_query.py +0 -0
  14. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates/bundled_version_query/parser.py +0 -0
  15. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates/bundled_version_query/patterns.py +0 -0
  16. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates/bundled_version_query/py.typed +0 -0
  17. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates/bundled_version_query/py_query.py +0 -0
  18. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates/bundled_version_query/query.py +0 -0
  19. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates/bundled_version_query/version.py +0 -0
  20. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates/cli.py +0 -0
  21. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates/config.py +0 -0
  22. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates/git_repo_tests.py +0 -0
  23. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates/logging.py +0 -0
  24. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates/packaging_tests.py +0 -0
  25. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates/py.typed +0 -0
  26. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates.egg-info/SOURCES.txt +0 -0
  27. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates.egg-info/dependency_links.txt +0 -0
  28. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates.egg-info/requires.txt +0 -0
  29. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/boilerplates.egg-info/top_level.txt +0 -0
  30. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/pyproject.toml +0 -0
  31. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/requirements.txt +0 -0
  32. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/requirements_cli.txt +0 -0
  33. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/requirements_config.txt +0 -0
  34. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/requirements_git_repo_tests.txt +0 -0
  35. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/requirements_logging.txt +0 -0
  36. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/requirements_packaging_tests.txt +0 -0
  37. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/requirements_sentry.txt +0 -0
  38. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/requirements_setup.txt +0 -0
  39. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/requirements_test.txt +0 -0
  40. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/setup.cfg +0 -0
  41. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/test/test_cli.py +0 -0
  42. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/test/test_config.py +0 -0
  43. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/test/test_git_repo.py +0 -0
  44. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/test/test_logging.py +0 -0
  45. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/test/test_packaging.py +0 -0
  46. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/test/test_sentry.py +0 -0
  47. {boilerplates-1.1.4.dev1 → boilerplates-1.2.0.dev0}/test/test_setup.py +0 -0
@@ -1,4 +1,5 @@
1
1
  Copyright (c) 2023-2025 Mateusz Bysiek https://mbdevpl.github.io/
2
+ Copyright (c) 2025 Stian Hanssen https://github.com/StianHanssen
2
3
 
3
4
  Licensed under the Apache License, Version 2.0 (the "License");
4
5
  you may not use this file except in compliance with the License.
@@ -1,18 +1,17 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: boilerplates
3
- Version: 1.1.4.dev1
3
+ Version: 1.2.0.dev0
4
4
  Summary: Various boilerplates used in almost all of my Python packages.
5
5
  Home-page: https://github.com/mbdevpl/python-boilerplates
6
6
  Download-URL:
7
- Author: Mateusz Bysiek
7
+ Author: Mateusz Bysiek, Stian Hanssen
8
8
  Author-email: mateusz.bysiek@gmail.com
9
9
  Maintainer: Mateusz Bysiek
10
10
  Maintainer-email: mateusz.bysiek@gmail.com
11
- License: Apache License 2.0
11
+ License: Apache-2.0
12
12
  Keywords: git,logging,packaging,releasing
13
13
  Classifier: Development Status :: 5 - Production/Stable
14
14
  Classifier: Intended Audience :: Developers
15
- Classifier: License :: OSI Approved :: Apache Software License
16
15
  Classifier: Operating System :: MacOS
17
16
  Classifier: Operating System :: Microsoft :: Windows
18
17
  Classifier: Operating System :: POSIX :: Linux
@@ -64,6 +63,7 @@ Dynamic: description-content-type
64
63
  Dynamic: home-page
65
64
  Dynamic: keywords
66
65
  Dynamic: license
66
+ Dynamic: license-file
67
67
  Dynamic: maintainer
68
68
  Dynamic: maintainer-email
69
69
  Dynamic: provides-extra
@@ -99,7 +99,7 @@ Various boilerplates used in almost all of my Python packages.
99
99
  :alt: grade from Codacy
100
100
 
101
101
  .. image:: https://img.shields.io/github/license/mbdevpl/python-boilerplates.svg
102
- :target: https://github.com/mbdevpl/python-boilerplates/blob/v1.1.4.dev1/NOTICE
102
+ :target: https://github.com/mbdevpl/python-boilerplates/blob/v1.2.0.dev0/NOTICE
103
103
  :alt: license
104
104
 
105
105
  This package includes boilerplates for various common tasks in Python packages, such as building
@@ -114,9 +114,9 @@ Requirements
114
114
 
115
115
  Python version 3.9 or later.
116
116
 
117
- Python libraries as specified in `requirements.txt <https://github.com/mbdevpl/python-boilerplates/blob/v1.1.4.dev1/requirements.txt>`_.
117
+ Python libraries as specified in `requirements.txt <https://github.com/mbdevpl/python-boilerplates/blob/v1.2.0.dev0/requirements.txt>`_.
118
118
 
119
- Building and running tests additionally requires packages listed in `requirements_test.txt <https://github.com/mbdevpl/python-boilerplates/blob/v1.1.4.dev1/requirements_test.txt>`_.
119
+ Building and running tests additionally requires packages listed in `requirements_test.txt <https://github.com/mbdevpl/python-boilerplates/blob/v1.2.0.dev0/requirements_test.txt>`_.
120
120
 
121
121
  Tested on Linux, macOS and Windows.
122
122
 
@@ -399,7 +399,7 @@ Your example ``cli.py`` file which defines your command-line interface may look
399
399
  verbosity = boilerplates.cli.get_verbosity_level(parsed_args)
400
400
  ...
401
401
 
402
- You can see the above example in action in the `examples.ipynb <https://github.com/mbdevpl/python-boilerplates/blob/v1.1.4.dev1/examples.ipynb>`_ notebook.
402
+ You can see the above example in action in the `examples.ipynb <https://github.com/mbdevpl/python-boilerplates/blob/v1.2.0.dev0/examples.ipynb>`_ notebook.
403
403
  Please see the ``boilerplates.cli`` module for details of the available features.
404
404
 
405
405
  And then, an example ``__main__.py`` file may look like:
@@ -20,16 +20,26 @@ _LOG = logging.getLogger(__name__)
20
20
  class Sentry:
21
21
  """Sentry configuration.
22
22
 
23
- For each parameter, the value is taken from the environment variable if it is set, otherwise
24
- from the class attribute if it is set.
23
+ For parameters 'dsn', 'release' and 'environment', the value is taken
24
+ from the environment variable if it is set, otherwise from the class
25
+ attribute if it is set.
25
26
 
26
27
  For each parameter, the name of the environment variable name is 'SENTRY_'
27
28
  followed by the parameter name in upper case.
29
+
30
+ The class attribute tags, if set, will be added to the global scope of the
31
+ current Sentry SDK.
28
32
  """
29
33
 
30
34
  dsn: str
35
+ """Sentry DSN (Data Source Name) used to identify the project in Sentry."""
36
+
31
37
  release: str
38
+ """Release version of your application."""
39
+
32
40
  environment: str
41
+ """Environment name (e.g., 'production', 'staging', 'development')."""
42
+
33
43
  integrations: t.List[sentry_sdk.integrations.Integration] = [
34
44
  sentry_sdk.integrations.argv.ArgvIntegration(),
35
45
  sentry_sdk.integrations.excepthook.ExcepthookIntegration(always_run=False),
@@ -40,15 +50,43 @@ class Sentry:
40
50
  sentry_sdk.integrations.stdlib.StdlibIntegration(),
41
51
  sentry_sdk.integrations.threading.ThreadingIntegration()
42
52
  ]
53
+ """Sentry SDK integrations to enable.
54
+
55
+ To configure integrations that are enabled by default, also add them to this list.
56
+ """
57
+
58
+ default_integrations: bool = True
59
+ """If true, enable Sentry's default integrations besides the ones set via 'integrations'."""
60
+
61
+ debug: bool = False
62
+ """If True, enable debug mode for the Sentry SDK."""
63
+
64
+ attach_stacktrace: bool = False
65
+ """If True, attach stacktraces to messages."""
66
+
67
+ shutdown_timeout: float = 2.0
68
+ """Time in seconds to wait for pending events to be sent before shutdown."""
69
+
70
+ send_default_pii: t.Optional[bool] = False
71
+ """If True, send personally identifiable information."""
43
72
 
44
73
  traces_sample_rate: float = 1.0
74
+ """Ratio of transactions to sample (0.0 to 1.0)."""
75
+
45
76
  profiles_sample_rate: float = 1.0
77
+ """Ratio of transactions to profile (0.0 to 1.0)."""
78
+
79
+ tags: t.Dict[str, str] = {}
80
+ """Tags to be added to all events."""
46
81
 
47
82
  @classmethod
48
83
  def _get_str_param(cls, param_name: str) -> t.Optional[str]:
49
84
  """Get a string parameter value by checking envvar first.
50
85
 
51
86
  Works only for 'dsn', 'release' or 'environment' parameters.
87
+
88
+ :param param_name: name of the parameter to get
89
+ :return: value of the parameter
52
90
  """
53
91
  assert param_name in ('dsn', 'release', 'environment'), param_name
54
92
  return os.environ.get(f'SENTRY_{param_name.upper()}', getattr(cls, param_name, None))
@@ -67,9 +105,17 @@ class Sentry:
67
105
  return
68
106
  sentry_sdk.init(
69
107
  *args, dsn=cls._get_str_param('dsn'),
70
- release=cls._get_str_param('release'), environment=cls._get_str_param('environment'),
108
+ release=cls._get_str_param('release'),
109
+ environment=cls._get_str_param('environment'),
71
110
  integrations=cls.integrations,
72
111
  traces_sample_rate=cls.traces_sample_rate,
73
112
  profiles_sample_rate=cls.profiles_sample_rate,
74
113
  enable_tracing=cls.profiles_sample_rate > 0,
114
+ debug=cls.debug,
115
+ attach_stacktrace=cls.attach_stacktrace,
116
+ shutdown_timeout=cls.shutdown_timeout,
117
+ send_default_pii=cls.send_default_pii,
118
+ default_integrations=cls.default_integrations,
75
119
  **kwargs)
120
+
121
+ sentry_sdk.set_tags(cls.tags)
@@ -19,7 +19,7 @@ HERE = pathlib.Path(__file__).resolve().parent
19
19
  DEFAULT_URL = 'https://github.com/mbdevpl'
20
20
  DEFAULT_AUTHOR = 'Mateusz Bysiek'
21
21
  DEFAULT_AUTHOR_EMAIL = 'mateusz.bysiek@gmail.com'
22
- DEFAULT_LICENSE_STR = 'Apache License 2.0'
22
+ DEFAULT_LICENSE_STR = 'Apache-2.0'
23
23
 
24
24
  TEST_PACKAGES = [
25
25
  'test',
@@ -298,8 +298,6 @@ class Package:
298
298
  'console_scripts': ['script_name = package.subpackage:function']
299
299
  """
300
300
 
301
- test_suite: str = 'test'
302
-
303
301
  @classmethod
304
302
  def try_fields(cls, *names) -> t.Optional[t.Any]:
305
303
  """Return first existing of given class field names."""
@@ -366,4 +364,4 @@ class Package:
366
364
  package_data=cls.package_data, exclude_package_data=cls.exclude_package_data,
367
365
  install_requires=cls.install_requires, extras_require=cls.extras_require,
368
366
  python_requires=cls.python_requires,
369
- entry_points=cls.entry_points, test_suite=cls.test_suite)
367
+ entry_points=cls.entry_points)
@@ -1,18 +1,17 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: boilerplates
3
- Version: 1.1.4.dev1
3
+ Version: 1.2.0.dev0
4
4
  Summary: Various boilerplates used in almost all of my Python packages.
5
5
  Home-page: https://github.com/mbdevpl/python-boilerplates
6
6
  Download-URL:
7
- Author: Mateusz Bysiek
7
+ Author: Mateusz Bysiek, Stian Hanssen
8
8
  Author-email: mateusz.bysiek@gmail.com
9
9
  Maintainer: Mateusz Bysiek
10
10
  Maintainer-email: mateusz.bysiek@gmail.com
11
- License: Apache License 2.0
11
+ License: Apache-2.0
12
12
  Keywords: git,logging,packaging,releasing
13
13
  Classifier: Development Status :: 5 - Production/Stable
14
14
  Classifier: Intended Audience :: Developers
15
- Classifier: License :: OSI Approved :: Apache Software License
16
15
  Classifier: Operating System :: MacOS
17
16
  Classifier: Operating System :: Microsoft :: Windows
18
17
  Classifier: Operating System :: POSIX :: Linux
@@ -64,6 +63,7 @@ Dynamic: description-content-type
64
63
  Dynamic: home-page
65
64
  Dynamic: keywords
66
65
  Dynamic: license
66
+ Dynamic: license-file
67
67
  Dynamic: maintainer
68
68
  Dynamic: maintainer-email
69
69
  Dynamic: provides-extra
@@ -99,7 +99,7 @@ Various boilerplates used in almost all of my Python packages.
99
99
  :alt: grade from Codacy
100
100
 
101
101
  .. image:: https://img.shields.io/github/license/mbdevpl/python-boilerplates.svg
102
- :target: https://github.com/mbdevpl/python-boilerplates/blob/v1.1.4.dev1/NOTICE
102
+ :target: https://github.com/mbdevpl/python-boilerplates/blob/v1.2.0.dev0/NOTICE
103
103
  :alt: license
104
104
 
105
105
  This package includes boilerplates for various common tasks in Python packages, such as building
@@ -114,9 +114,9 @@ Requirements
114
114
 
115
115
  Python version 3.9 or later.
116
116
 
117
- Python libraries as specified in `requirements.txt <https://github.com/mbdevpl/python-boilerplates/blob/v1.1.4.dev1/requirements.txt>`_.
117
+ Python libraries as specified in `requirements.txt <https://github.com/mbdevpl/python-boilerplates/blob/v1.2.0.dev0/requirements.txt>`_.
118
118
 
119
- Building and running tests additionally requires packages listed in `requirements_test.txt <https://github.com/mbdevpl/python-boilerplates/blob/v1.1.4.dev1/requirements_test.txt>`_.
119
+ Building and running tests additionally requires packages listed in `requirements_test.txt <https://github.com/mbdevpl/python-boilerplates/blob/v1.2.0.dev0/requirements_test.txt>`_.
120
120
 
121
121
  Tested on Linux, macOS and Windows.
122
122
 
@@ -399,7 +399,7 @@ Your example ``cli.py`` file which defines your command-line interface may look
399
399
  verbosity = boilerplates.cli.get_verbosity_level(parsed_args)
400
400
  ...
401
401
 
402
- You can see the above example in action in the `examples.ipynb <https://github.com/mbdevpl/python-boilerplates/blob/v1.1.4.dev1/examples.ipynb>`_ notebook.
402
+ You can see the above example in action in the `examples.ipynb <https://github.com/mbdevpl/python-boilerplates/blob/v1.2.0.dev0/examples.ipynb>`_ notebook.
403
403
  Please see the ``boilerplates.cli`` module for details of the available features.
404
404
 
405
405
  And then, an example ``__main__.py`` file may look like:
@@ -41,10 +41,11 @@ class Package(boilerplates.setup.Package):
41
41
  version = VERSION
42
42
  description = 'Various boilerplates used in almost all of my Python packages.'
43
43
  url = 'https://github.com/mbdevpl/python-boilerplates'
44
+ author = 'Mateusz Bysiek, Stian Hanssen'
45
+ maintainer = 'Mateusz Bysiek'
44
46
  classifiers = [
45
47
  'Development Status :: 5 - Production/Stable',
46
48
  'Intended Audience :: Developers',
47
- 'License :: OSI Approved :: Apache Software License',
48
49
  'Operating System :: MacOS',
49
50
  'Operating System :: Microsoft :: Windows',
50
51
  'Operating System :: POSIX :: Linux',
@@ -1,5 +1,7 @@
1
1
  """Initialization of tests of boilerplates package."""
2
2
 
3
+ import logging
4
+
3
5
  import boilerplates.logging
4
6
 
5
7
 
@@ -10,3 +12,5 @@ class TestsLogging(boilerplates.logging.Logging):
10
12
 
11
13
 
12
14
  TestsLogging.configure()
15
+
16
+ logging.getLogger('boilerplates.bundled_version_query').setLevel(logging.WARNING)