circuitpython-functools 1.0.2__tar.gz → 2.0.0__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 (43) hide show
  1. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md +1 -1
  2. circuitpython_functools-2.0.0/.pre-commit-config.yaml +24 -0
  3. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/.readthedocs.yaml +9 -6
  4. circuitpython_functools-2.0.0/LICENSE-PSF +47 -0
  5. {circuitpython-functools-1.0.2/circuitpython_functools.egg-info → circuitpython_functools-2.0.0}/PKG-INFO +9 -8
  6. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/README.rst +3 -3
  7. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0/circuitpython_functools.egg-info}/PKG-INFO +9 -8
  8. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/circuitpython_functools.egg-info/SOURCES.txt +2 -2
  9. circuitpython_functools-2.0.0/circuitpython_functools.py +167 -0
  10. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/docs/conf.py +2 -2
  11. circuitpython_functools-2.0.0/examples/functools_simpletest.py +35 -0
  12. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/pyproject.toml +6 -3
  13. circuitpython-functools-1.0.2/.pre-commit-config.yaml +0 -42
  14. circuitpython-functools-1.0.2/.pylintrc +0 -639
  15. circuitpython-functools-1.0.2/circuitpython_functools.py +0 -101
  16. circuitpython-functools-1.0.2/examples/functools_simpletest.py +0 -37
  17. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/.github/workflows/build.yml +0 -0
  18. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/.github/workflows/failure-help-text.yml +0 -0
  19. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/.github/workflows/release_gh.yml +0 -0
  20. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/.github/workflows/release_pypi.yml +0 -0
  21. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/.gitignore +0 -0
  22. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/CODE_OF_CONDUCT.md +0 -0
  23. /circuitpython-functools-1.0.2/LICENSE → /circuitpython_functools-2.0.0/LICENSE-MIT +0 -0
  24. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/LICENSES/CC-BY-4.0.txt +0 -0
  25. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/LICENSES/MIT.txt +0 -0
  26. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/LICENSES/PSF-2.0.txt +0 -0
  27. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/LICENSES/Unlicense.txt +0 -0
  28. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/README.rst.license +0 -0
  29. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/circuitpython_functools.egg-info/dependency_links.txt +0 -0
  30. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/circuitpython_functools.egg-info/requires.txt +0 -0
  31. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/circuitpython_functools.egg-info/top_level.txt +0 -0
  32. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/docs/_static/favicon.ico +0 -0
  33. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/docs/_static/favicon.ico.license +0 -0
  34. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/docs/api.rst +0 -0
  35. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/docs/api.rst.license +0 -0
  36. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/docs/examples.rst +0 -0
  37. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/docs/examples.rst.license +0 -0
  38. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/docs/index.rst +0 -0
  39. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/docs/index.rst.license +0 -0
  40. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/docs/requirements.txt +0 -0
  41. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/optional_requirements.txt +0 -0
  42. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/requirements.txt +0 -0
  43. {circuitpython-functools-1.0.2 → circuitpython_functools-2.0.0}/setup.cfg +0 -0
@@ -8,6 +8,6 @@ Make sure any changes you're submitting are in line with the CircuitPython Desig
8
8
 
9
9
  If your changes are to documentation, please verify that the documentation builds locally by following the steps found here: https://adafru.it/build-docs
10
10
 
11
- Before submitting the pull request, make sure you've run Pylint and Black locally on your code. You can do this manually or using pre-commit. Instructions are available here: https://adafru.it/check-your-code
11
+ Before submitting the pull request, make sure you've run pre-commit locally on your code. Instructions are available here: https://adafru.it/check-your-code
12
12
 
13
13
  Please remove all of this text before submitting. Include an explanation or list of changes included in your PR, as well as, if applicable, a link to any related issues.
@@ -0,0 +1,24 @@
1
+ # SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
2
+ # SPDX-FileCopyrightText: 2025 Alec Delaney
3
+ #
4
+ # SPDX-License-Identifier: Unlicense
5
+
6
+ repos:
7
+ - repo: https://github.com/fsfe/reuse-tool
8
+ rev: v5.0.2
9
+ hooks:
10
+ - id: reuse
11
+ - repo: https://github.com/pre-commit/pre-commit-hooks
12
+ rev: v5.0.0
13
+ hooks:
14
+ - id: check-yaml
15
+ - id: end-of-file-fixer
16
+ - id: trailing-whitespace
17
+ - repo: https://github.com/astral-sh/ruff-pre-commit
18
+ rev: v0.11.11
19
+ hooks:
20
+ - id: ruff
21
+ name: Lint via ruff
22
+ args: [--fix]
23
+ - id: ruff-format
24
+ name: Format via ruff
@@ -9,11 +9,14 @@
9
9
  version: 2
10
10
 
11
11
  build:
12
- os: ubuntu-20.04
13
- tools:
14
- python: "3"
12
+ os: ubuntu-24.04
13
+ tools:
14
+ python: "3"
15
+
16
+ sphinx:
17
+ configuration: docs/conf.py
15
18
 
16
19
  python:
17
- install:
18
- - requirements: docs/requirements.txt
19
- - requirements: requirements.txt
20
+ install:
21
+ - requirements: docs/requirements.txt
22
+ - requirements: requirements.txt
@@ -0,0 +1,47 @@
1
+ PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
2
+
3
+ 1. This LICENSE AGREEMENT is between the Python Software Foundation
4
+ ("PSF"), and the Individual or Organization ("Licensee") accessing and
5
+ otherwise using this software ("Python") in source or binary form and
6
+ its associated documentation.
7
+
8
+ 2. Subject to the terms and conditions of this License Agreement, PSF hereby
9
+ grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
10
+ analyze, test, perform and/or display publicly, prepare derivative works,
11
+ distribute, and otherwise use Python alone or in any derivative version,
12
+ provided, however, that PSF's License Agreement and PSF's notice of copyright,
13
+ i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
14
+ 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Python Software Foundation;
15
+ All Rights Reserved" are retained in Python alone or in any derivative version
16
+ prepared by Licensee.
17
+
18
+ 3. In the event Licensee prepares a derivative work that is based on
19
+ or incorporates Python or any part thereof, and wants to make
20
+ the derivative work available to others as provided herein, then
21
+ Licensee hereby agrees to include in any such work a brief summary of
22
+ the changes made to Python.
23
+
24
+ 4. PSF is making Python available to Licensee on an "AS IS"
25
+ basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
26
+ IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
27
+ DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
28
+ FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
29
+ INFRINGE ANY THIRD PARTY RIGHTS.
30
+
31
+ 5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
32
+ FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
33
+ A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
34
+ OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
35
+
36
+ 6. This License Agreement will automatically terminate upon a material
37
+ breach of its terms and conditions.
38
+
39
+ 7. Nothing in this License Agreement shall be deemed to create any
40
+ relationship of agency, partnership, or joint venture between PSF and
41
+ Licensee. This License Agreement does not grant permission to use PSF
42
+ trademarks or trade name in a trademark sense to endorse or promote
43
+ products or services of Licensee, or any third party.
44
+
45
+ 8. By copying, installing or otherwise using Python, Licensee
46
+ agrees to be bound by the terms and conditions of this License
47
+ Agreement.
@@ -1,21 +1,22 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: circuitpython-functools
3
- Version: 1.0.2
3
+ Version: 2.0.0
4
4
  Summary: A CircuitPython implementation of CPython's functools library
5
5
  Author-email: Alec Delaney <tekktrik@gmail.com>
6
- License: MIT
6
+ License-Expression: MIT AND PSF-2.0
7
7
  Project-URL: Homepage, https://github.com/tekktrik/CircuitPython_functools
8
8
  Keywords: adafruit,blinka,circuitpython,micropython,functools,cache,functions,decorators
9
9
  Classifier: Intended Audience :: Developers
10
10
  Classifier: Topic :: Software Development :: Libraries
11
11
  Classifier: Topic :: Software Development :: Embedded Systems
12
12
  Classifier: Topic :: System :: Hardware
13
- Classifier: License :: OSI Approved :: MIT License
14
13
  Classifier: Programming Language :: Python :: 3
15
14
  Description-Content-Type: text/x-rst
16
- License-File: LICENSE
15
+ License-File: LICENSE-MIT
16
+ License-File: LICENSE-PSF
17
17
  Requires-Dist: Adafruit-Blinka
18
18
  Provides-Extra: optional
19
+ Dynamic: license-file
19
20
 
20
21
  Introduction
21
22
  ============
@@ -36,9 +37,9 @@ Introduction
36
37
  :alt: Build Status
37
38
 
38
39
 
39
- .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
40
- :target: https://github.com/psf/black
41
- :alt: Code Style: Black
40
+ .. image:: https://img.shields.io/badge/code%20style-ruff-2a1833.svg
41
+ :target: https://github.com/astral-sh/ruff
42
+ :alt: Code Style: ruff
42
43
 
43
44
  A CircuitPython implementation of CPython's functools library
44
45
 
@@ -17,9 +17,9 @@ Introduction
17
17
  :alt: Build Status
18
18
 
19
19
 
20
- .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
21
- :target: https://github.com/psf/black
22
- :alt: Code Style: Black
20
+ .. image:: https://img.shields.io/badge/code%20style-ruff-2a1833.svg
21
+ :target: https://github.com/astral-sh/ruff
22
+ :alt: Code Style: ruff
23
23
 
24
24
  A CircuitPython implementation of CPython's functools library
25
25
 
@@ -1,21 +1,22 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: circuitpython-functools
3
- Version: 1.0.2
3
+ Version: 2.0.0
4
4
  Summary: A CircuitPython implementation of CPython's functools library
5
5
  Author-email: Alec Delaney <tekktrik@gmail.com>
6
- License: MIT
6
+ License-Expression: MIT AND PSF-2.0
7
7
  Project-URL: Homepage, https://github.com/tekktrik/CircuitPython_functools
8
8
  Keywords: adafruit,blinka,circuitpython,micropython,functools,cache,functions,decorators
9
9
  Classifier: Intended Audience :: Developers
10
10
  Classifier: Topic :: Software Development :: Libraries
11
11
  Classifier: Topic :: Software Development :: Embedded Systems
12
12
  Classifier: Topic :: System :: Hardware
13
- Classifier: License :: OSI Approved :: MIT License
14
13
  Classifier: Programming Language :: Python :: 3
15
14
  Description-Content-Type: text/x-rst
16
- License-File: LICENSE
15
+ License-File: LICENSE-MIT
16
+ License-File: LICENSE-PSF
17
17
  Requires-Dist: Adafruit-Blinka
18
18
  Provides-Extra: optional
19
+ Dynamic: license-file
19
20
 
20
21
  Introduction
21
22
  ============
@@ -36,9 +37,9 @@ Introduction
36
37
  :alt: Build Status
37
38
 
38
39
 
39
- .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
40
- :target: https://github.com/psf/black
41
- :alt: Code Style: Black
40
+ .. image:: https://img.shields.io/badge/code%20style-ruff-2a1833.svg
41
+ :target: https://github.com/astral-sh/ruff
42
+ :alt: Code Style: ruff
42
43
 
43
44
  A CircuitPython implementation of CPython's functools library
44
45
 
@@ -1,9 +1,9 @@
1
1
  .gitignore
2
2
  .pre-commit-config.yaml
3
- .pylintrc
4
3
  .readthedocs.yaml
5
4
  CODE_OF_CONDUCT.md
6
- LICENSE
5
+ LICENSE-MIT
6
+ LICENSE-PSF
7
7
  README.rst
8
8
  README.rst.license
9
9
  circuitpython_functools.py
@@ -0,0 +1,167 @@
1
+ # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2
+ # SPDX-FileCopyrightText: Copyright (c) 2022 Alec Delaney
3
+ # SPDX-FileCopyrightText: Python Software Foundation
4
+ # SPDX-FileCopyrightText: MicroPython Developers
5
+ #
6
+ # SPDX-License-Identifier: MIT
7
+ # SPDX-License-Identifier: PSF-2.0
8
+
9
+ """CircuitPython implementation of CPython's functools library.
10
+
11
+ * Author(s): Alec Delaney
12
+
13
+ Implementation Notes
14
+ --------------------
15
+
16
+ **Software and Dependencies:**
17
+
18
+ * Adafruit CircuitPython firmware for the supported boards:
19
+ https://circuitpython.org/downloads
20
+
21
+ """
22
+
23
+ import gc
24
+ from collections import OrderedDict
25
+
26
+ __version__ = "2.0.0"
27
+ __repo__ = "https://github.com/tekktrik/CircuitPython_functools.git"
28
+
29
+ _cache_records = {}
30
+ _lru_cache_records = {}
31
+
32
+
33
+ class _ObjectMark:
34
+ pass
35
+
36
+
37
+ # Cache-related code ported from CPython
38
+
39
+ # As a general note, some weird things are happening here due to internal differences between
40
+ # CPython and CircuitPython, such as the fact that closures can't have things added to them,
41
+ # hence the need to create objects so that cache_clear can be called from the returned "wrapped"
42
+ # functions.
43
+
44
+
45
+ def _make_key(args, kwargs, kwd_mark=(_ObjectMark(),)):
46
+ """Make a key for the cache records."""
47
+ key = tuple(args)
48
+ if kwargs:
49
+ key += kwd_mark
50
+ for item in kwargs.items():
51
+ key += tuple(item)
52
+ return hash(key)
53
+
54
+
55
+ class CachedFunc:
56
+ """Wrapped unbounded cache function."""
57
+
58
+ def __init__(self, maxsize, user_func):
59
+ """Initialize the wrapped cache function."""
60
+ self._maxsize = maxsize
61
+ checked_records = _cache_records if maxsize < 0 else _lru_cache_records
62
+
63
+ def cache_wrapper(*args, **kwargs):
64
+ sentinel = object()
65
+
66
+ # Make the key for the inner dictionary
67
+ key = _make_key(args, kwargs)
68
+
69
+ # if there is no inner dictionary yet, make one
70
+ if checked_records.get(user_func) is None:
71
+ checked_records[user_func] = OrderedDict()
72
+
73
+ # Attempt to get an existing entry, updating its location in the queue
74
+ # and returning it if so
75
+ result = checked_records[user_func].get(key, sentinel)
76
+ if result is not sentinel:
77
+ checked_records[user_func].move_to_end(key)
78
+ return result
79
+
80
+ # Calculate the actual value
81
+ result = user_func(*args, **kwargs)
82
+
83
+ # If the cache is bounded and too full to store the new result, eject the
84
+ # least-recently-use entry
85
+ if maxsize >= 0 and len(checked_records[user_func]) >= maxsize:
86
+ first_key = next(iter(checked_records[user_func]))
87
+ del checked_records[user_func][first_key]
88
+
89
+ # Store the result
90
+ checked_records[user_func][key] = result
91
+
92
+ # Return the new result
93
+ return result
94
+
95
+ self._user_func = user_func
96
+ self._wrapped_func = cache_wrapper
97
+
98
+ def __call__(self, *args, **kwargs):
99
+ """Call the wrapped function."""
100
+ return self._wrapped_func(*args, **kwargs)
101
+
102
+ def cache_clear(self):
103
+ """Clear the cache."""
104
+ checked_records = _cache_records if self._maxsize < 0 else _lru_cache_records
105
+ if self._user_func in checked_records:
106
+ checked_records[self._user_func].clear()
107
+ gc.collect()
108
+
109
+
110
+ class LRUCachedFunc:
111
+ """Wrapped LRU cache function."""
112
+
113
+ def __init__(self, wrapped_func, maxsize):
114
+ """Initialize the wrapped LRU cache function."""
115
+ self._maxsize = maxsize
116
+ self._wrapped_func = wrapped_func
117
+
118
+ def __call__(self, *args, **kwargs):
119
+ """Call the wrapped function."""
120
+ print(type(self._wrapped_func))
121
+ return self._wrapped_func(*args, **kwargs)
122
+
123
+ def cache_clear(self):
124
+ """Clear the LRU cache."""
125
+ return self.cache_clear()
126
+
127
+
128
+ def cache(user_function):
129
+ """Create an unbounded cache."""
130
+ return CachedFunc(-1, user_function)
131
+
132
+
133
+ def lru_cache(*args, **kwargs):
134
+ """Create a bounded cache which ejects the least recently used entry."""
135
+ cpython_max_args = 2
136
+ if len(args) == cpython_max_args or "typed" in kwargs:
137
+ raise NotImplementedError("Using typed is not supported")
138
+
139
+ if len(args) == 1 and isinstance(args[0], int):
140
+ maxsize = args[0]
141
+ elif len(args) == 1 and str(type(args[0]) == "<class 'function'>"):
142
+ return CachedFunc(128, args[0])
143
+ elif "maxsize" in kwargs:
144
+ maxsize = kwargs["maxsize"]
145
+ else:
146
+ raise SyntaxError("lru_cache syntax incorrect")
147
+
148
+ return partial(CachedFunc, maxsize)
149
+
150
+
151
+ # Partial ported from the MicroPython library
152
+ def partial(func, *args, **kwargs):
153
+ """Create a partial of the function."""
154
+
155
+ def _partial(*more_args, **more_kwargs):
156
+ local_kwargs = kwargs.copy()
157
+ local_kwargs.update(more_kwargs)
158
+ return func(*(args + more_args), **local_kwargs)
159
+
160
+ return _partial
161
+
162
+
163
+ # Thank you to the MicroPython Development team for
164
+ # their simplified implementation of the wraps function!
165
+ def wraps(wrapped, assigned=None, updated=None):
166
+ """Define a wrapper function when writing function decorators."""
167
+ return wrapped
@@ -4,6 +4,8 @@
4
4
  #
5
5
  # SPDX-License-Identifier: MIT
6
6
 
7
+ """Sphinx configuration file."""
8
+
7
9
  import os
8
10
  import sys
9
11
 
@@ -101,10 +103,8 @@ napoleon_numpy_docstring = False
101
103
  # The theme to use for HTML and HTML Help pages. See the documentation for
102
104
  # a list of builtin themes.
103
105
  #
104
- import sphinx_rtd_theme
105
106
 
106
107
  html_theme = "sphinx_rtd_theme"
107
- html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
108
108
 
109
109
  # Add any paths that contain custom static files (such as style sheets) here,
110
110
  # relative to this directory. They are copied after the builtin static files,
@@ -0,0 +1,35 @@
1
+ # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2
+ # SPDX-FileCopyrightText: Copyright (c) 2022 Alec Delaney
3
+ #
4
+ # SPDX-License-Identifier: Unlicense
5
+
6
+ """Example usage of the circuitpython_functools module."""
7
+
8
+ from circuitpython_functools import cache
9
+
10
+
11
+ @cache
12
+ def add(a, b, *, c=1, d=2):
13
+ """Perform addition."""
14
+ return a + b + c + d
15
+
16
+
17
+ @cache
18
+ def subtract(first_value, second_value):
19
+ """Perform subtraction."""
20
+ return first_value - second_value
21
+
22
+
23
+ print(add(1, 1, c=2, d=3))
24
+ print(add(1, 1, c=2, d=3)) # Repeat call, will use cached result
25
+ print(add(1, 0, c=3, d=4))
26
+ print(subtract(42, 20))
27
+ print(add(1, b=1, c=2, d=3))
28
+ print(add(1, b=0, c=2, d=3))
29
+
30
+ # Clear all the caches so we don't use too much memory
31
+ add.cache_clear()
32
+ subtract.cache_clear()
33
+
34
+ print(add(1, 0, c=3, d=4)) # Cache was cleared, so this is caclulated again
35
+ print(subtract(18, 4))
@@ -12,7 +12,7 @@ requires = [
12
12
  [project]
13
13
  name = "circuitpython-functools"
14
14
  description = "A CircuitPython implementation of CPython's functools library"
15
- version = "1.0.2"
15
+ version = "2.0.0"
16
16
  readme = "README.rst"
17
17
  authors = [
18
18
  {name = "Alec Delaney", email = "tekktrik@gmail.com"}
@@ -28,13 +28,12 @@ keywords = [
28
28
  "functions",
29
29
  "decorators",
30
30
  ]
31
- license = {text = "MIT"}
31
+ license = "MIT AND PSF-2.0"
32
32
  classifiers = [
33
33
  "Intended Audience :: Developers",
34
34
  "Topic :: Software Development :: Libraries",
35
35
  "Topic :: Software Development :: Embedded Systems",
36
36
  "Topic :: System :: Hardware",
37
- "License :: OSI Approved :: MIT License",
38
37
  "Programming Language :: Python :: 3",
39
38
  ]
40
39
  dynamic = ["dependencies", "optional-dependencies"]
@@ -45,3 +44,7 @@ py-modules = ["circuitpython_functools"]
45
44
  [tool.setuptools.dynamic]
46
45
  dependencies = {file = ["requirements.txt"]}
47
46
  optional-dependencies = {optional = {file = ["optional_requirements.txt"]}}
47
+
48
+ [tool.ruff.lint]
49
+ select = ["D", "PL", "I"]
50
+ ignore = ["D213", "D203"]
@@ -1,42 +0,0 @@
1
- # SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
2
- #
3
- # SPDX-License-Identifier: Unlicense
4
-
5
- repos:
6
- - repo: https://github.com/python/black
7
- rev: 23.12.1
8
- hooks:
9
- - id: black
10
- - repo: https://github.com/fsfe/reuse-tool
11
- rev: v2.1.0
12
- hooks:
13
- - id: reuse
14
- - repo: https://github.com/pre-commit/pre-commit-hooks
15
- rev: v4.5.0
16
- hooks:
17
- - id: check-yaml
18
- - id: end-of-file-fixer
19
- - id: trailing-whitespace
20
- - repo: https://github.com/pycqa/pylint
21
- rev: v3.0.3
22
- hooks:
23
- - id: pylint
24
- name: pylint (library code)
25
- types: [python]
26
- args:
27
- - --disable=consider-using-f-string
28
- exclude: "^(docs/|examples/|tests/|setup.py$)"
29
- - id: pylint
30
- name: pylint (example code)
31
- description: Run pylint rules on "examples/*.py" files
32
- types: [python]
33
- files: "^examples/"
34
- args:
35
- - --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code
36
- - id: pylint
37
- name: pylint (test code)
38
- description: Run pylint rules on "tests/*.py" files
39
- types: [python]
40
- files: "^tests/"
41
- args:
42
- - --disable=missing-docstring,consider-using-f-string,duplicate-code