mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 09:24:31 +02:00
Test against Python 3.13 pre-release (#619)
* Test against Python 3.13 pre-release * Skip tests for numpy on Python 3.13 Refs https://github.com/simonw/sqlite-utils/pull/619#issuecomment-1998798451 * Try to avoid Python 3.13 cog differences * Hide \b characters in cli-reference * Fixed .rST warning
This commit is contained in:
parent
17eb8184d2
commit
5bd7aec4d2
4 changed files with 30 additions and 26 deletions
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
|
|
@ -10,7 +10,7 @@ jobs:
|
|||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
||||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
|
||||
numpy: [0, 1]
|
||||
os: [ubuntu-latest, macos-latest, windows-latest, macos-14]
|
||||
# Skip 3.8 and 3.9 on macos-14 - it only has 3.10+
|
||||
|
|
@ -19,12 +19,15 @@ jobs:
|
|||
os: macos-14
|
||||
- python-version: "3.9"
|
||||
os: macos-14
|
||||
- python-version: "3.13"
|
||||
numpy: 1
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
allow-prereleases: true
|
||||
- uses: actions/cache@v4
|
||||
name: Configure pip caching
|
||||
with:
|
||||
|
|
|
|||
|
|
@ -85,6 +85,7 @@ This page lists the ``--help`` for every ``sqlite-utils`` CLI sub-command.
|
|||
cog.out("::\n\n")
|
||||
result = CliRunner().invoke(cli.cli, [command, "--help"])
|
||||
output = result.output.replace("Usage: cli ", "Usage: sqlite-utils ")
|
||||
output = output.replace('\b', '')
|
||||
cog.out(textwrap.indent(output, ' '))
|
||||
cog.out("\n\n")
|
||||
.. ]]]
|
||||
|
|
@ -603,9 +604,9 @@ See :ref:`cli_convert`.
|
|||
|
||||
Convert columns using Python code you supply. For example:
|
||||
|
||||
sqlite-utils convert my.db mytable mycolumn \
|
||||
'"\n".join(textwrap.wrap(value, 10))' \
|
||||
--import=textwrap
|
||||
sqlite-utils convert my.db mytable mycolumn \
|
||||
'"\n".join(textwrap.wrap(value, 10))' \
|
||||
--import=textwrap
|
||||
|
||||
"value" is a variable with the column value to be converted.
|
||||
|
||||
|
|
@ -615,30 +616,30 @@ See :ref:`cli_convert`.
|
|||
|
||||
r.jsonsplit(value, delimiter=',', type=<class 'str'>)
|
||||
|
||||
Convert a string like a,b,c into a JSON array ["a", "b", "c"]
|
||||
Convert a string like a,b,c into a JSON array ["a", "b", "c"]
|
||||
|
||||
r.parsedate(value, dayfirst=False, yearfirst=False, errors=None)
|
||||
|
||||
Parse a date and convert it to ISO date format: yyyy-mm-dd
|
||||
|
||||
- dayfirst=True: treat xx as the day in xx/yy/zz
|
||||
- yearfirst=True: treat xx as the year in xx/yy/zz
|
||||
- errors=r.IGNORE to ignore values that cannot be parsed
|
||||
- errors=r.SET_NULL to set values that cannot be parsed to null
|
||||
Parse a date and convert it to ISO date format: yyyy-mm-dd
|
||||
|
||||
- dayfirst=True: treat xx as the day in xx/yy/zz
|
||||
- yearfirst=True: treat xx as the year in xx/yy/zz
|
||||
- errors=r.IGNORE to ignore values that cannot be parsed
|
||||
- errors=r.SET_NULL to set values that cannot be parsed to null
|
||||
|
||||
r.parsedatetime(value, dayfirst=False, yearfirst=False, errors=None)
|
||||
|
||||
Parse a datetime and convert it to ISO datetime format: yyyy-mm-ddTHH:MM:SS
|
||||
|
||||
- dayfirst=True: treat xx as the day in xx/yy/zz
|
||||
- yearfirst=True: treat xx as the year in xx/yy/zz
|
||||
- errors=r.IGNORE to ignore values that cannot be parsed
|
||||
- errors=r.SET_NULL to set values that cannot be parsed to null
|
||||
Parse a datetime and convert it to ISO datetime format: yyyy-mm-ddTHH:MM:SS
|
||||
|
||||
- dayfirst=True: treat xx as the day in xx/yy/zz
|
||||
- yearfirst=True: treat xx as the year in xx/yy/zz
|
||||
- errors=r.IGNORE to ignore values that cannot be parsed
|
||||
- errors=r.SET_NULL to set values that cannot be parsed to null
|
||||
|
||||
You can use these recipes like so:
|
||||
|
||||
sqlite-utils convert my.db mytable mycolumn \
|
||||
'r.jsonsplit(value, delimiter=":")'
|
||||
sqlite-utils convert my.db mytable mycolumn \
|
||||
'r.jsonsplit(value, delimiter=":")'
|
||||
|
||||
Options:
|
||||
--import TEXT Python modules to import
|
||||
|
|
|
|||
|
|
@ -2177,7 +2177,7 @@ The ``.has_counts_triggers`` property shows if a table has been configured with
|
|||
>>> db["authors"].has_counts_triggers
|
||||
True
|
||||
|
||||
.. _python_api_introspection_supports_strict
|
||||
.. _python_api_introspection_supports_strict:
|
||||
|
||||
db.supports_strict
|
||||
------------------
|
||||
|
|
|
|||
|
|
@ -2871,9 +2871,9 @@ def _generate_convert_help():
|
|||
Convert columns using Python code you supply. For example:
|
||||
|
||||
\b
|
||||
sqlite-utils convert my.db mytable mycolumn \\
|
||||
'"\\n".join(textwrap.wrap(value, 10))' \\
|
||||
--import=textwrap
|
||||
sqlite-utils convert my.db mytable mycolumn \\
|
||||
'"\\n".join(textwrap.wrap(value, 10))' \\
|
||||
--import=textwrap
|
||||
|
||||
"value" is a variable with the column value to be converted.
|
||||
|
||||
|
|
@ -2892,7 +2892,7 @@ def _generate_convert_help():
|
|||
for name in recipe_names:
|
||||
fn = getattr(recipes, name)
|
||||
help += "\n\nr.{}{}\n\n\b{}".format(
|
||||
name, str(inspect.signature(fn)), fn.__doc__.rstrip()
|
||||
name, str(inspect.signature(fn)), textwrap.dedent(fn.__doc__.rstrip())
|
||||
)
|
||||
help += "\n\n"
|
||||
help += textwrap.dedent(
|
||||
|
|
@ -2900,8 +2900,8 @@ def _generate_convert_help():
|
|||
You can use these recipes like so:
|
||||
|
||||
\b
|
||||
sqlite-utils convert my.db mytable mycolumn \\
|
||||
'r.jsonsplit(value, delimiter=":")'
|
||||
sqlite-utils convert my.db mytable mycolumn \\
|
||||
'r.jsonsplit(value, delimiter=":")'
|
||||
"""
|
||||
).strip()
|
||||
return help
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue