8000 Initial work on version 2.0 · FirebirdSQL/python3-base@fb68bbd · GitHub
[go: up one dir, main page]

Skip to content

Commit fb68bbd

Browse files
committed
Initial work on version 2.0
1 parent c793e9b commit fb68bbd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+9334
-6939
lines changed

docs/changelog.txt

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,51 @@
22
Changelog
33
#########
44

5+
Version 2.0.0 (unreleased)
6+
==========================
7+
8+
* Change tests from `unittest` to `pytest`, almost complete code coverage.
9+
* Minimal Python version raised to 3.11.
10+
* Code cleanup and optimization for Python 3.11 features.
11+
* `~firebird.base.types` module:
12+
13+
- Change: Function `Conjunctive` renamed to `.conjunctive`.
14+
15+
* `~firebird.base.buffer` module:
16+
17+
- Added `.MemoryBuffer.get_raw` method.
18+
- Added `get_raw` method to `.BufferFactory`, `.BytesBufferFactory` and `.CTypesBufferFactory`.
19+
- Fix: `resize`, `read` and `read_number` now raise `BufferError` istead `IOError`.
20+
21+
* `~firebird.base.collections` module:
22+
23+
- `.DataList.__init__` parameter `frozen` is now keyword-only.
24+
- `.DataList.extract` parameter `copy` is now keyword-only.
25+
- `.DataList.sort` parameter `reverse` is now keyword-only.
26+
- `.DataList.split` parameter `frozen` is now keyword-only.
27+
- `.Registry.popitem` parameter `last` is now keyword-only.
28+
29+
* `~firebird.base.config` module:
30+
31+
- Deprecated `.create_config` function was removed.
32+
- Change: `DirectoryScheme` parameter `force_home` is now keyword only.
33+
- Change: `Option` parameters `required` and `default` are now keyword only.
34+
- Fix: Problem with name handling in `.ConfigOption.clear` and `set_value`.
35+
36+
* `~firebird.base.strconv` module:
37+
38+
- Fix: Problem with conversion of flags from string.
39+
40+
* Changed: The `~firebird.base.logging` module was completelly reworked.
41+
42+
* `~firebird.base.trace` module:
43+
44+
- Change: Parameter `context` was removed from `.traced` decorator
45+
- Change: Option `context` was removed from `.BaseTraceConfig`.
46+
- Change: Log function return value as `repr` rather than `str`.
47+
48+
49+
550
Version 1.8.0
651
=============
752

docs/conf.py

Lines changed: 45 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
# sys.path.insert(0, os.path.abspath('.'))
1616

1717
import sphinx_bootstrap_theme
18+
1819
from firebird.base.__about__ import __version__
1920

2021
# -- Project information -----------------------------------------------------
2122

22-
project = 'Firebird-base'
23-
copyright = '2020-2024, The Firebird Project'
24-
author = 'Pavel Císař'
23+
project = "Firebird-base"
24+
copyright = "2020-2025, The Firebird Project"
25+
author = "Pavel Císař"
2526

2627
# The short X.Y version
2728
version = __version__
@@ -36,47 +37,47 @@
3637
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3738
# ones.
3839
extensions = [
39-
'sphinx.ext.intersphinx',
40-
'sphinx.ext.autodoc',
41-
'sphinx.ext.napoleon',
42-
'sphinx.ext.viewcode',
43-
'sphinx.ext.autosectionlabel',
40+
"sphinx.ext.intersphinx",
41+
"sphinx.ext.autodoc",
42+
"sphinx.ext.napoleon",
43+
"sphinx.ext.viewcode",
44+
"sphinx.ext.autosectionlabel",
4445
#'sphinx_autodoc_typehints',
45-
'sphinx.ext.todo',
46+
"sphinx.ext.todo",
4647
#'sphinx.ext.coverage',
4748
]
4849

4950
# Add any paths that contain templates here, relative to this directory.
50-
templates_path = ['_templates']
51+
templates_path = ["_templates"]
5152

5253
# The suffix(es) of source filenames.
5354
# You can specify multiple suffix as a list of string:
5455
#
5556
# source_suffix = ['.rst', '.md']
56-
source_suffix = '.txt'
57+
source_suffix = ".txt"
5758

5859
# List of patterns, relative to source directory, that match files and
5960
# directories to ignore when looking for source files.
6061
# This pattern also affects html_static_path and html_extra_path.
61-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'requirements.txt']
62+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "requirements.txt"]
6263

63-
default_role = 'py:obj'
64+
default_role = "py:obj"
6465

6566
# -- Options for HTML output -------------------------------------------------
6667

67-
html_favicon = '_static/fb-favicon.png'
68+
html_favicon = "_static/fb-favicon.png"
6869

6970
# The theme to use for HTML and HTML Help pages. See the documentation for
7071
# a list of builtin themes.
7172
#
7273
#html_theme = 'alabaster'
73-
html_theme = 'bootstrap'
74+
html_theme = "bootstrap"
7475
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
7576

7677
# Add any paths that contain custom static files (such as style sheets) here,
7778
# relative to this directory. They are copied after the builtin static files,
7879
# so a file named "default.css" will overwrite the builtin "default.css".
79-
html_static_path = ['_static']
80+
html_static_path = ["_static"]
8081

8182
# bootstrap theme config
8283

@@ -91,7 +92,7 @@
9192
#'navbar_title': "Firebird-base",
9293

9394
# Tab name for entire site. (Default: "Site")
94-
'navbar_site_name': "Site",
95+
"navbar_site_name": "Site",
9596

9697
# A list of tuples containing pages or urls to link to.
9798
# Valid tuples should be in the following forms:
@@ -100,7 +101,7 @@
100101
# (name, "http://example.com", True) # arbitrary absolute url
101102
# Note the "1" or "True" value above as the third argument to indicate
102103
# an arbitrary url.
103-
'navbar_links': [
104+
"navbar_links": [
104105
("Introduction", "introduction"),
105106
("Modules", "modules"),
106107
("Index", "genindex"),
@@ -109,7 +110,7 @@
109110
],
110111

111112
# Render the next and previous page links in navbar. (Default: true)
112-
'navbar_sidebarrel': False,
113+
"navbar_sidebarrel": False,
113114

114115
# Render the current pages TOC in the navbar. (Default: true)
115116
#'navbar_pagenav': True,
@@ -119,7 +120,7 @@
119120

120121
# Global TOC depth for "site" navbar tab. (Default: 1)
121122
# Switching to -1 shows all levels.
122-
'globaltoc_depth': 3,
123+
"globaltoc_depth": 3,
123124

124125
# Include hidden TOCs in Site navbar?
125126
#
@@ -128,19 +129,19 @@
128129
# will break.
129130
#
130131
# Values: "true" (default) or "false"
131-
'globaltoc_includehidden': "false",
132+
"globaltoc_includehidden": "false",
132133

133134
# HTML navbar class (Default: "navbar") to attach to <div> element.
134135
# For black navbar, do "navbar navbar-inverse"
135-
'navbar_class': "navbar navbar-inverse",
136+
"navbar_class": "navbar navbar-inverse",
136137

137138
# Fix navigation bar to top of page?
138139
# Values: "true" (default) or "false"
139-
'navbar_fixed_top': "true",
140+
"navbar_fixed_top": "true",
140141

141142
# Location of link to source.
142143
# Options are "nav" (default), "footer" or anything else to exclude.
143-
'source_link_position': "none",
144+
"source_link_position": "none",
144145

145146
# Bootswatch (http://bootswatch.com/) theme.
146147
#
@@ -154,11 +155,11 @@
154155
# - Bootstrap 2: https://bootswatch.com/2
155156
# - Bootstrap 3: https://bootswatch.com/3
156157
#'bootswatch_theme': "united", # cerulean, flatly, lumen, materia, united, yeti
157-
'bootswatch_theme': "cerulean",
158+
"bootswatch_theme": "cerulean",
158159

159160
# Choose Bootstrap version.
160161
# Values: "3" (default) or "2" (in quotes)
161-
'bootstrap_version': "2",
162+
"bootstrap_version": "2",
162163
}
163164

164165
# -- Extension configuration -------------------------------------------------
@@ -168,26 +169,26 @@
168169
# Autodoc options
169170
# ---------------
170171
autodoc_default_options = {
171-
'content': 'both',
172-
'members': True,
173-
'member-order': 'groupwise',
174-
'undoc-members': True,
175-
'exclude-members': '__weakref__',
176-
'show-inheritance': True,
177-
'no-inherited-members': True,
172+
"content": "both",
173+
"members": True,
174+
"member-order": "groupwise",
175+
"undoc-members": True,
176+
"exclude-members": "__weakref__",
177+
"show-inheritance": True,
178+
"no-inherited-members": True,
178179
}
179180
set_type_checking_flag = True
180-
autodoc_class_signature = 'mixed'
181+
autodoc_class_signature = "mixed"
181182
always_document_param_types = True
182-
autodoc_typehints = 'both' # default 'signature'
183-
autodoc_typehints_format = 'short'
184-
autodoc_typehints_description_target = 'all'
185-
186-
autodoc_type_aliases = {'Item': '~firebird.base.collections.Item',
187-
'TypeSpec': '~firebird.base.collections.TypeSpec',
188-
'ItemExpr': '~firebird.base.collections.ItemExpr',
189-
'FilterExpr': '~firebird.base.collections.FilterExpr',
190-
'CheckExpr': '~firebird.base.collections.CheckExpr',
183+
autodoc_typehints = "both" # default 'signature'
184+
autodoc_typehints_format = "short"
185+
autodoc_typehints_description_target = "all"
186+
187+
autodoc_type_aliases = {"Item": "~firebird.base.collections.Item",
188+
"TypeSpec": "~firebird.base.collections.TypeSpec",
189+
"ItemExpr": "~firebird.base.collections.ItemExpr",
190+
"FilterExpr": "~firebird.base.collections.FilterExpr",
191+
"CheckExpr": "~firebird.base.collections.CheckExpr",
191192
}
192193

193194
# Napoleon options
@@ -208,7 +209,7 @@
208209
# -- Options for intersphinx extension ---------------------------------------
209210

210211
# Example configuration for intersphinx: refer to the Python standard library.
211-
intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}
212+
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
212213

213214
# -- Options for todo extension ----------------------------------------------
214215

docs/config.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,5 +371,4 @@ Functions
371371
=========
372372
.. autofunction:: has_verticals
373373
.. autofunction:: has_leading_spaces
374-
.. autofunction:: create_config
375374

docs/logging.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,16 @@ The following program is an example of small but complex enough code that you ca
146146
def interact(self, other: Person, message: str) -> Mood:
147147
print(f"[{other.name}] {message}")
148148
# >>> LOGGING
149-
get_logger(self, topic='Person').debug(f'Processing "{message}" from [{other.name}]')
149+
# Note that messages are normal strings that use f-strings interpolation.
150+
# You may specify values using keyword format:
151+
get_logger(self, topic='Person').debug('Processing "{message}" from [{other.name}]',
152+
message=message, other=other)
153+
# Or you can use a dictionary:
154+
# get_logger(self, topic="Person").debug('Processing "{message}" from [{other.name}]',
155+
# {'message': message, 'other': other})
156+
# You can also use f-strings directly, but they are ALWAYS evaluated, regardless
157+
# whether the message is written to log or not.
158+
# get_logger(self, topic='Person').debug(f'Processing "{message}" from [{other.name}]')
150159
# <<< LOGGING
151160
self.process(message)
152161
return self.mood
@@ -205,7 +214,9 @@ The following program is an example of small but complex enough code that you ca
205214
"Simulation of virtual agents meeting"
206215

207216
for person in persons:
217+
# >>> LOGGING
208218
person.log_context = name
219+
# <<< LOGGING
209220

210221
start = monotonic()
211222
print("Meeting started...")

0 commit comments

Comments
 (0)
0