Skip to content

Commit 1e15292

Browse files
[garf-py] deps: add support for python 3.14
* Update Github Actions workflow for publishing the library to pypi (publish on version change, not tag being pushed). Change-Id: Id3e6322334585c97e8683911f668c0754fd2c352
1 parent 628576b commit 1e15292

File tree

4 files changed

+41
-44
lines changed

4 files changed

+41
-44
lines changed
Lines changed: 37 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,46 @@
1-
name: Publish Python package to PyPI
1+
name: Publish to PyPI - garf-io
22

33
on:
44
push:
5-
tags: [ "*-py" ]
6-
jobs:
7-
build:
8-
name: Build distribution
9-
runs-on: ubuntu-latest
5+
branches:
6+
- main
7+
paths:
8+
- 'py/**'
109

11-
steps:
12-
- uses: actions/checkout@v4
13-
- name: Set up Python
14-
uses: actions/setup-python@v5
15-
with:
16-
python-version: "3.x"
17-
- name: Install pypa/build
18-
run: >-
19-
python3 -m
20-
pip install
21-
build
22-
--user
23-
- name: Build a binary wheel and a source tarball
24-
run: python3 -m build py
25-
- name: Store the distribution packages
26-
uses: actions/upload-artifact@v4
27-
with:
28-
name: python-package-distributions
29-
path: dist/
30-
31-
publish-to-pypi:
32-
name: >-
33-
Publish Python package to PyPI
34-
needs:
35-
- build
10+
jobs:
11+
publish:
3612
runs-on: ubuntu-latest
3713
environment:
3814
name: pypi
39-
url: https://pypi.org/p/google-ads-api-report-fetcher
4015
permissions:
41-
id-token: write # IMPORTANT: mandatory for trusted publishing
42-
16+
id-token: write
4317
steps:
44-
- name: Download all the dists
45-
uses: actions/download-artifact@v4
46-
with:
47-
name: python-package-distributions
48-
path: dist/
49-
- name: Publish package to PyPI
50-
uses: pypa/gh-action-pypi-publish@release/v1
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v4
24+
25+
- name: Get versions and check for change
26+
id: version_check
27+
run: |
28+
PREV_VERSION=$(git show HEAD~1:py/google_ads_api_report_fetcher/__init__.py | grep -oE "__version__ = '([0-9]+\.[0-9]+\.[0-9]+)'" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
29+
CURRENT_VERSION=$(grep -oE "__version__ = '([0-9]+\.[0-9]+\.[0-9]+)'" py/google_ads_api_report_fetcher/__init__.py | grep -oE '[0-9]+\.[0-9]+\.[0-9]+')
30+
31+
if [[ "$CURRENT_VERSION" != "$PREV_VERSION" ]]; then
32+
echo "Version change detected: $PREV_VERSION -> $CURRENT_VERSION"
33+
echo "should_publish=true" >> $GITHUB_OUTPUT
34+
echo "new_version=$CURRENT_VERSION" >> $GITHUB_OUTPUT
35+
else
36+
echo "No version change. Skipping publish."
37+
echo "should_publish=false" >> $GITHUB_OUTPUT
38+
fi
39+
40+
- name: Build the package
41+
if: steps.version_check.outputs.should_publish == 'true'
42+
run: uv build py
43+
44+
- name: Publish to PyPI
45+
if: steps.version_check.outputs.should_publish == 'true'
46+
run: uv publish py/dist/*

.github/workflows/pytest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
17+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
1818

1919
steps:
2020
- uses: actions/checkout@v3

py/gaarf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@
2828
'AdsReportFetcher',
2929
]
3030

31-
__version__ = '1.17.1'
31+
__version__ = '1.17.2'

py/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies = [
1515
'garf-core',
1616
'garf-io',
1717
]
18-
requires-python = ">=3.9, <3.14"
18+
requires-python = ">=3.9"
1919
description = "Library for fetching reports from Google Ads API and saving them locally & remotely."
2020
readme = "README.md"
2121
classifiers = [
@@ -25,6 +25,7 @@ classifiers = [
2525
'Programming Language :: Python :: 3.11',
2626
'Programming Language :: Python :: 3.12',
2727
'Programming Language :: Python :: 3.13',
28+
'Programming Language :: Python :: 3.14',
2829
'Intended Audience :: Developers',
2930
'Topic :: Software Development :: Libraries :: Python Modules',
3031
'Operating System :: OS Independent',

0 commit comments

Comments
 (0)