Skip to content

Commit 61f8a5e

Browse files
dependabot[bot]kkleinpavelzw
authored
Bump actions/upload-artifact, fix wheel builds (#123)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/upload-artifact/releases">actions/upload-artifact's releases</a>.</em></p> <blockquote> <h2>v4.0.0</h2> <h2>What's Changed</h2> <p>The release of upload-artifact@v4 and download-artifact@v4 are major changes to the backend architecture of Artifacts. They have numerous performance and behavioral improvements.</p> <p>For more information, see the <a href="https://github.com/actions/toolkit/tree/main/packages/artifact"><code>@​actions/artifact</code></a> documentation.</p> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/vmjoseph"><code>@​vmjoseph</code></a> made their first contribution in <a href="https://redirect.github.com/actions/upload-artifact/pull/464">actions/upload-artifact#464</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/upload-artifact/compare/v3...v4.0.0">https://github.com/actions/upload-artifact/compare/v3...v4.0.0</a></p> <h2>v3.1.3</h2> <h2>What's Changed</h2> <ul> <li>chore(github): remove trailing whitespaces by <a href="https://github.com/ljmf00"><code>@​ljmf00</code></a> in <a href="https://redirect.github.com/actions/upload-artifact/pull/313">actions/upload-artifact#313</a></li> <li>Bump <code>@​actions/artifact</code> version to v1.1.2 by <a href="https://github.com/bethanyj28"><code>@​bethanyj28</code></a> in <a href="https://redirect.github.com/actions/upload-artifact/pull/436">actions/upload-artifact#436</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/actions/upload-artifact/compare/v3...v3.1.3">https://github.com/actions/upload-artifact/compare/v3...v3.1.3</a></p> <h2>v3.1.2</h2> <ul> <li>Update all <code>@actions/*</code> NPM packages to their latest versions- <a href="https://redirect.github.com/actions/upload-artifact/issues/374">#374</a></li> <li>Update all dev dependencies to their most recent versions - <a href="https://redirect.github.com/actions/upload-artifact/issues/375">#375</a></li> </ul> <h2>v3.1.1</h2> <ul> <li>Update actions/core package to latest version to remove <code>set-output</code> deprecation warning <a href="https://redirect.github.com/actions/upload-artifact/issues/351">#351</a></li> </ul> <h2>v3.1.0</h2> <h2>What's Changed</h2> <ul> <li>Bump <code>@​actions/artifact</code> to v1.1.0 (<a href="https://redirect.github.com/actions/upload-artifact/pull/327">actions/upload-artifact#327</a>) <ul> <li>Adds checksum headers on artifact upload (<a href="https://redirect.github.com/actions/toolkit/pull/1095">actions/toolkit#1095</a>) (<a href="https://redirect.github.com/actions/toolkit/pull/1063">actions/toolkit#1063</a>)</li> </ul> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/actions/upload-artifact/commit/c7d193f32edcb7bfad88892161225aeda64e9392"><code>c7d193f</code></a> Merge pull request <a href="https://redirect.github.com/actions/upload-artifact/issues/466">#466</a> from actions/v4-beta</li> <li><a href="https://github.com/actions/upload-artifact/commit/13131bb095770b4070a7477c3cd2d96e1c16d9f4"><code>13131bb</code></a> licensed cache</li> <li><a href="https://github.com/actions/upload-artifact/commit/4a6c273b9834f66a1d05c170dc3f80f9cdb9def1"><code>4a6c273</code></a> Merge branch 'main' into v4-beta</li> <li><a href="https://github.com/actions/upload-artifact/commit/f391bb91a3d3118aeca171c365bb319ece276b37"><code>f391bb9</code></a> Merge pull request <a href="https://redirect.github.com/actions/upload-artifact/issues/465">#465</a> from actions/robherley/v4-documentation</li> <li><a href="https://github.com/actions/upload-artifact/commit/9653d03c4b74c32144e02dae644fea70e079d4b3"><code>9653d03</code></a> Apply suggestions from code review</li> <li><a href="https://github.com/actions/upload-artifact/commit/875b63076402f25ef9d52c294c86ba4f97810575"><code>875b630</code></a> add limitations section</li> <li><a href="https://github.com/actions/upload-artifact/commit/ecb21463e93740a6be75c3116242169bfdbcb15a"><code>ecb2146</code></a> add compression example</li> <li><a href="https://github.com/actions/upload-artifact/commit/5e7604f84a055838f64ed68bb9904751523081ae"><code>5e7604f</code></a> trim some repeated info</li> <li><a href="https://github.com/actions/upload-artifact/commit/d6437d07581fe318a364512e6cf6b1dca6b4f92c"><code>d6437d0</code></a> naming</li> <li><a href="https://github.com/actions/upload-artifact/commit/1b561557037b4957d7d184e9aac02bec86c771eb"><code>1b56155</code></a> s/v4-beta/v4/g</li> <li>Additional commits viewable in <a href="https://github.com/actions/upload-artifact/compare/v3...v4">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/upload-artifact&package-manager=github_actions&previous-version=3&new-version=4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) You can trigger a rebase of this PR by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> > **Note** > Automatic rebases have been disabled on this pull request as it has been open for over 30 days. --------- Co-authored-by: kklein <kevin.klein@quantco.com> Co-authored-by: Pavel Zwerschke <pavelzw@gmail.com> Co-authored-by: Pavel Zwerschke <pavel.zwerschke@quantco.com>
1 parent 7a2bbd6 commit 61f8a5e

File tree

7 files changed

+41
-50
lines changed

7 files changed

+41
-50
lines changed

.github/workflows/build_and_publish.yml

+15-9
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,24 @@ jobs:
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
matrix:
15-
os: [ ubuntu-20.04, windows-2019, macos-11 ]
15+
# macos-13 is pre-ARM
16+
os: [ ubuntu-24.04, windows-2019, macos-13, macos-latest ]
1617

1718
steps:
1819
- uses: actions/checkout@v4
1920
with:
2021
fetch-depth: 0
2122

2223
- name: Build wheels
23-
uses: pypa/cibuildwheel@v2.21.1
24+
uses: pypa/cibuildwheel@7940a4c0e76eb2030e473a5f864f291f63ee879b # v2.21.3
25+
env:
26+
CIBW_SKIP: pp*
2427

25-
- uses: actions/upload-artifact@v3
28+
- uses: actions/upload-artifact@v4
2629
with:
30+
name: pytsql-wheel-${{ matrix.os }}
2731
path: ./wheelhouse/*.whl
32+
if-no-files-found: error
2833

2934
build_sdist:
3035
name: Build source distribution
@@ -37,22 +42,23 @@ jobs:
3742
- name: Build sdist
3843
run: pipx run build --sdist
3944

40-
- uses: actions/upload-artifact@v3
45+
- uses: actions/upload-artifact@v4
4146
with:
47+
name: pytsql-sdist
4248
path: dist/*.tar.gz
49+
if-no-files-found: error
4350

4451
upload_pypi:
4552
name: Upload to PyPI
4653
needs: [build_wheels, build_sdist]
54+
environment: pypi
4755
runs-on: ubuntu-latest
4856
if: github.event_name == 'release' && github.event.action == 'published'
4957
steps:
50-
- uses: actions/download-artifact@v3
58+
- uses: actions/download-artifact@v4
5159
with:
52-
name: artifact
60+
pattern: pytsql-*
61+
merge-multiple: true
5362
path: dist
5463

5564
- uses: pypa/gh-action-pypi-publish@v1.10.2
56-
with:
57-
user: __token__
58-
password: ${{ secrets.PYPI_TOKEN }}

.github/workflows/ci.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
fail-fast: true
2929
matrix:
30-
PYTHON_VERSION: ['3.8', '3.9', '3.10', '3.11']
30+
PYTHON_VERSION: ['3.9', '3.10', '3.11']
3131
OS: ['ubuntu-latest', 'windows-latest']
3232
steps:
3333
- name: Checkout branch
@@ -56,7 +56,7 @@ jobs:
5656
strategy:
5757
fail-fast: false
5858
matrix:
59-
PYTHON_VERSION: ['3.8', '3.9', '3.10', '3.11']
59+
PYTHON_VERSION: ['3.9', '3.10', '3.11']
6060
services:
6161
DB:
6262
image: mcr.microsoft.com/mssql/server:2019-latest

environment.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ channels:
33
- conda-forge
44
- nodefaults
55
dependencies:
6-
- python>=3.8
6+
- python>=3.9
77
- setuptools_scm
88
- pre-commit
99
- pytest
@@ -20,3 +20,4 @@ dependencies:
2020
- antlr4-python3-runtime==4.13.1 # keep `.github/workflows/update_grammar.yml` in sync
2121
- click
2222
- openjdk
23+
- compilers

pyproject.toml

+9-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
requires = ['setuptools', 'setuptools-scm', 'wheel']
33
build-backend = "setuptools.build_meta"
44

5+
[tool.setuptools_scm]
6+
version_scheme = "post-release"
7+
8+
59
[project]
610
name = "pytsql"
711
description = "`Pytsql` allows to run mssql sripts, typically run via GUIs, via CLI."
@@ -25,7 +29,6 @@ classifiers = [
2529
"License :: OSI Approved :: BSD License",
2630
"Operating System :: OS Independent",
2731
"Programming Language :: Python :: 3",
28-
"Programming Language :: Python :: 3.8",
2932
"Programming Language :: Python :: 3.9",
3033
"Programming Language :: Python :: 3.10",
3134
"Programming Language :: Python :: 3.11",
@@ -34,7 +37,7 @@ classifiers = [
3437
readme = "README.md"
3538
dynamic = ["version"]
3639

37-
requires-python = ">=3.8.0"
40+
requires-python = ">=3.9"
3841

3942
dependencies = [
4043
"sqlalchemy >=1.4",
@@ -70,8 +73,10 @@ module = "pytsql.grammar.*"
7073
follow_imports = "silent"
7174

7275
[tool.ruff]
73-
ignore = ["E501", "N803", "N806"]
7476
line-length = 88
77+
78+
[tool.ruff.lint]
79+
ignore = ["E501", "N803", "N806"]
7580
select = [
7681
# pyflakes
7782
"F",
@@ -84,8 +89,7 @@ select = [
8489
# pyupgrade
8590
"UP",
8691
]
87-
target-version = "py38"
8892
exclude=["src/pytsql/grammar/**/*.py"]
8993

90-
[tool.ruff.isort]
94+
[tool.ruff.lint.isort]
9195
known-first-party = ["pytsql"]

setup.py

-19
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,7 @@
11
import glob
22
import platform
3-
from time import time
43

54
import setuptools
6-
from setuptools_scm.version import ScmVersion
7-
8-
9-
def get_dev_timestamp(version: ScmVersion) -> str:
10-
"""Return a new distribution version string.
11-
12-
Returns the version found in the git tag if currently checked out commit has a tag.
13-
Otherwise, returns the version found in the most recent git tag, appended with
14-
`dev` and the current timestamp in seconds.
15-
"""
16-
17-
if version.exact:
18-
return version.format_with("{tag}")
19-
return version.format_with(f"{{tag}}.dev{int(time())}")
205

216

227
def get_platform() -> str:
@@ -61,10 +46,6 @@ def create_extension() -> setuptools.Extension:
6146
def run_setup():
6247
setuptools.setup(
6348
ext_modules=[create_extension()],
64-
use_scm_version={
65-
"version_scheme": get_dev_timestamp,
66-
"local_scheme": "dirty-tag",
67-
},
6849
)
6950

7051

src/pytsql/tsql.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import warnings
44
from pathlib import Path
55
from re import Match
6-
from typing import Any, Dict, List, Optional, Union
6+
from typing import Any, Optional, Union
77

88
import antlr4.tree.Tree
99
import sqlalchemy
@@ -28,7 +28,7 @@ def _code(path: Union[str, Path], encoding: str) -> str:
2828
return "\n".join(fh.readlines())
2929

3030

31-
def _process_replacement(line: str, parameters: Dict[str, Any]) -> str:
31+
def _process_replacement(line: str, parameters: dict[str, Any]) -> str:
3232
"""Appropriately replace a single <replace> statement."""
3333
new_line = line.format(**parameters)
3434
if None in parameters.values():
@@ -42,7 +42,7 @@ def _process_replacement(line: str, parameters: Dict[str, Any]) -> str:
4242

4343
def _parametrize(
4444
source: str,
45-
parameters: Dict[str, Any],
45+
parameters: dict[str, Any],
4646
start: str = _REPLACE_START,
4747
end: str = _REPLACE_END,
4848
) -> str:
@@ -93,7 +93,7 @@ def __init__(self):
9393
# session information is lost after the execution of a batch.
9494
# We therefore need to manually prepend it to all following
9595
# batches.
96-
self.dynamics: List[str] = []
96+
self.dynamics: list[str] = []
9797

9898
def visit(
9999
self, tree: TSqlParser.Sql_clausesContext, prepend_dynamics: bool = True
@@ -112,7 +112,7 @@ def visit(
112112

113113
return " ".join(dynamics + chunks)
114114

115-
def visitChildren(self, node: antlr4.ParserRuleContext) -> List[str]: # noqa: N802
115+
def visitChildren(self, node: antlr4.ParserRuleContext) -> list[str]: # noqa: N802
116116
if isinstance(node, TSqlParser.Print_statementContext):
117117
# Print statements are replaced by inserts into a temporary table so that they can be evaluated
118118
# at the right time and fetched afterwards.
@@ -129,15 +129,15 @@ def visitChildren(self, node: antlr4.ParserRuleContext) -> List[str]: # noqa: N
129129

130130
return result
131131

132-
def visitTerminal(self, node: antlr4.TerminalNode) -> List[str]: # noqa: N802
132+
def visitTerminal(self, node: antlr4.TerminalNode) -> list[str]: # noqa: N802
133133
return [str(node)]
134134

135-
def defaultResult(self) -> List[str]: # noqa: N802
135+
def defaultResult(self) -> list[str]: # noqa: N802
136136
return []
137137

138138
def aggregateResult( # noqa: N802
139-
self, aggregate: List[str], next_result: List[str]
140-
) -> List[str]:
139+
self, aggregate: list[str], next_result: list[str]
140+
) -> list[str]:
141141
return aggregate + next_result
142142

143143

@@ -158,7 +158,7 @@ def syntaxError( # noqa: N802
158158
raise ValueError(f"Error parsing SQL script: {error_message}")
159159

160160

161-
def _split(code: str, isolate_top_level_statements: bool = True) -> List[str]:
161+
def _split(code: str, isolate_top_level_statements: bool = True) -> list[str]:
162162
if not USE_CPP_IMPLEMENTATION:
163163
warnings.warn(
164164
"Can not find C++ version of the parser, Python version will be used instead."
@@ -215,7 +215,7 @@ def _fetch_and_clear_prints(conn: Connection):
215215
def executes(
216216
code: str,
217217
engine: sqlalchemy.engine.Engine,
218-
parameters: Optional[Dict[str, Any]] = None,
218+
parameters: Optional[dict[str, Any]] = None,
219219
isolate_top_level_statements=True,
220220
) -> None:
221221
"""Execute a given sql string through a sqlalchemy.engine.Engine connection.
@@ -250,7 +250,7 @@ def executes(
250250
def execute(
251251
path: Union[str, Path],
252252
engine: sqlalchemy.engine.Engine,
253-
parameters: Optional[Dict[str, Any]] = None,
253+
parameters: Optional[dict[str, Any]] = None,
254254
isolate_top_level_statements=True,
255255
encoding: str = "utf-8",
256256
) -> None:

tests/unit/test_py_vs_cpp.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import inspect
22
import re
3-
from typing import List
43
from unittest import mock
54

65
import pytest
@@ -36,7 +35,7 @@ def seed():
3635
GROUP BY nr, short_nr;"""
3736

3837

39-
def get_rule_labels(context_cls: ParserRuleContext) -> List[str]:
38+
def get_rule_labels(context_cls: ParserRuleContext) -> list[str]:
4039
init_func = context_cls.__init__
4140

4241
# Detect any context/token labels from the init function's assignments

0 commit comments

Comments
 (0)