Skip to content

Commit 5bd7aec

Browse files
authored
Test against Python 3.13 pre-release (#619)
* Test against Python 3.13 pre-release * Skip tests for numpy on Python 3.13 Refs #619 (comment) * Try to avoid Python 3.13 cog differences * Hide \b characters in cli-reference * Fixed .rST warning
1 parent 17eb818 commit 5bd7aec

File tree

4 files changed

+30
-26
lines changed

4 files changed

+30
-26
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
13+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
1414
numpy: [0, 1]
1515
os: [ubuntu-latest, macos-latest, windows-latest, macos-14]
1616
# Skip 3.8 and 3.9 on macos-14 - it only has 3.10+
@@ -19,12 +19,15 @@ jobs:
1919
os: macos-14
2020
- python-version: "3.9"
2121
os: macos-14
22+
- python-version: "3.13"
23+
numpy: 1
2224
steps:
2325
- uses: actions/checkout@v4
2426
- name: Set up Python ${{ matrix.python-version }}
2527
uses: actions/setup-python@v5
2628
with:
2729
python-version: ${{ matrix.python-version }}
30+
allow-prereleases: true
2831
- uses: actions/cache@v4
2932
name: Configure pip caching
3033
with:

docs/cli-reference.rst

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ This page lists the ``--help`` for every ``sqlite-utils`` CLI sub-command.
8585
cog.out("::\n\n")
8686
result = CliRunner().invoke(cli.cli, [command, "--help"])
8787
output = result.output.replace("Usage: cli ", "Usage: sqlite-utils ")
88+
output = output.replace('\b', '')
8889
cog.out(textwrap.indent(output, ' '))
8990
cog.out("\n\n")
9091
.. ]]]
@@ -603,9 +604,9 @@ See :ref:`cli_convert`.
603604

604605
Convert columns using Python code you supply. For example:
605606

606-
sqlite-utils convert my.db mytable mycolumn \
607-
'"\n".join(textwrap.wrap(value, 10))' \
608-
--import=textwrap
607+
sqlite-utils convert my.db mytable mycolumn \
608+
'"\n".join(textwrap.wrap(value, 10))' \
609+
--import=textwrap
609610

610611
"value" is a variable with the column value to be converted.
611612

@@ -615,30 +616,30 @@ See :ref:`cli_convert`.
615616

616617
r.jsonsplit(value, delimiter=',', type=<class 'str'>)
617618

618-
Convert a string like a,b,c into a JSON array ["a", "b", "c"]
619+
Convert a string like a,b,c into a JSON array ["a", "b", "c"]
619620

620621
r.parsedate(value, dayfirst=False, yearfirst=False, errors=None)
621622

622-
Parse a date and convert it to ISO date format: yyyy-mm-dd
623-
624-
- dayfirst=True: treat xx as the day in xx/yy/zz
625-
- yearfirst=True: treat xx as the year in xx/yy/zz
626-
- errors=r.IGNORE to ignore values that cannot be parsed
627-
- errors=r.SET_NULL to set values that cannot be parsed to null
623+
Parse a date and convert it to ISO date format: yyyy-mm-dd
624+
625+
- dayfirst=True: treat xx as the day in xx/yy/zz
626+
- yearfirst=True: treat xx as the year in xx/yy/zz
627+
- errors=r.IGNORE to ignore values that cannot be parsed
628+
- errors=r.SET_NULL to set values that cannot be parsed to null
628629

629630
r.parsedatetime(value, dayfirst=False, yearfirst=False, errors=None)
630631

631-
Parse a datetime and convert it to ISO datetime format: yyyy-mm-ddTHH:MM:SS
632-
633-
- dayfirst=True: treat xx as the day in xx/yy/zz
634-
- yearfirst=True: treat xx as the year in xx/yy/zz
635-
- errors=r.IGNORE to ignore values that cannot be parsed
636-
- errors=r.SET_NULL to set values that cannot be parsed to null
632+
Parse a datetime and convert it to ISO datetime format: yyyy-mm-ddTHH:MM:SS
633+
634+
- dayfirst=True: treat xx as the day in xx/yy/zz
635+
- yearfirst=True: treat xx as the year in xx/yy/zz
636+
- errors=r.IGNORE to ignore values that cannot be parsed
637+
- errors=r.SET_NULL to set values that cannot be parsed to null
637638

638639
You can use these recipes like so:
639640

640-
sqlite-utils convert my.db mytable mycolumn \
641-
'r.jsonsplit(value, delimiter=":")'
641+
sqlite-utils convert my.db mytable mycolumn \
642+
'r.jsonsplit(value, delimiter=":")'
642643

643644
Options:
644645
--import TEXT Python modules to import

docs/python-api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2177,7 +2177,7 @@ The ``.has_counts_triggers`` property shows if a table has been configured with
21772177
>>> db["authors"].has_counts_triggers
21782178
True
21792179
2180-
.. _python_api_introspection_supports_strict
2180+
.. _python_api_introspection_supports_strict:
21812181
21822182
db.supports_strict
21832183
------------------

sqlite_utils/cli.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2871,9 +2871,9 @@ def _generate_convert_help():
28712871
Convert columns using Python code you supply. For example:
28722872
28732873
\b
2874-
sqlite-utils convert my.db mytable mycolumn \\
2875-
'"\\n".join(textwrap.wrap(value, 10))' \\
2876-
--import=textwrap
2874+
sqlite-utils convert my.db mytable mycolumn \\
2875+
'"\\n".join(textwrap.wrap(value, 10))' \\
2876+
--import=textwrap
28772877
28782878
"value" is a variable with the column value to be converted.
28792879
@@ -2892,16 +2892,16 @@ def _generate_convert_help():
28922892
for name in recipe_names:
28932893
fn = getattr(recipes, name)
28942894
help += "\n\nr.{}{}\n\n\b{}".format(
2895-
name, str(inspect.signature(fn)), fn.__doc__.rstrip()
2895+
name, str(inspect.signature(fn)), textwrap.dedent(fn.__doc__.rstrip())
28962896
)
28972897
help += "\n\n"
28982898
help += textwrap.dedent(
28992899
"""
29002900
You can use these recipes like so:
29012901
29022902
\b
2903-
sqlite-utils convert my.db mytable mycolumn \\
2904-
'r.jsonsplit(value, delimiter=":")'
2903+
sqlite-utils convert my.db mytable mycolumn \\
2904+
'r.jsonsplit(value, delimiter=":")'
29052905
"""
29062906
).strip()
29072907
return help

0 commit comments

Comments
 (0)