tag-publish 1.4.0.dev2__tar.gz → 1.4.0.dev3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tag-publish
3
- Version: 1.4.0.dev2
3
+ Version: 1.4.0.dev3
4
4
  Summary: Tools used to publish Python packages, Docker images and Helm charts for GitHub tag and branch
5
5
  License: FreeBSD
6
6
  License-File: LICENSE
@@ -47,7 +47,7 @@ prospector-profile-utils = "1.27.0"
47
47
  types-requests = "2.33.0.20260712"
48
48
  types-pyyaml = "6.0.12.20260724"
49
49
  ruff = "0.15.21"
50
- pylint = "4.0.7"
50
+ pylint = "4.0.9"
51
51
 
52
52
  [tool.poetry-dynamic-versioning]
53
53
  enable = false
@@ -96,7 +96,7 @@ include = [
96
96
  ]
97
97
  requires-python = ">=3.11"
98
98
  dependencies = ["PyYAML<7,>=6", "security-md<2,>=1", "githubkit<1,>=0"]
99
- version = "1.4.0.dev2"
99
+ version = "1.4.0.dev3"
100
100
 
101
101
  [project.optional-dependencies]
102
102
  pypi = ["requests<3,>=2", "twine<7,>=6", "id<2,>=1"]
@@ -193,19 +193,26 @@ def _handle_pypi_publish(
193
193
  success = True
194
194
  pypi_config = config.get("pypi", {})
195
195
  if pypi_config:
196
- tag_publish.require_extra("pypi", "id", "requests", "twine")
197
- # Imported here because it depends on optional dependencies provided by the `pypi` extra.
198
- from tag_publish.lib import oidc # noqa: PLC0415
196
+ packages = [
197
+ package
198
+ for package in pypi_config.get("packages", [])
199
+ if package.get("group", tag_publish.configuration.PIP_PACKAGE_GROUP_DEFAULT) == group
200
+ ]
201
+ if packages:
202
+ tag_publish.require_extra("pypi", "id", "requests", "twine")
203
+ publish = version_type in pypi_config.get(
204
+ "versions_type",
205
+ tag_publish.configuration.PYPI_VERSIONS_DEFAULT,
206
+ )
207
+ if publish:
208
+ # Imported here because it depends on optional dependencies provided by the `pypi` extra.
209
+ from tag_publish.lib import oidc # noqa: PLC0415
199
210
 
200
- if "packages" in pypi_config:
201
- oidc.pypi_login()
211
+ # The trusted publisher is configured for the workflow that really publishes the packages,
212
+ # asking a token for another group would be refused by PyPI with `invalid-publisher`.
213
+ oidc.pypi_login()
202
214
 
203
- for package in pypi_config.get("packages", []):
204
- if package.get("group", tag_publish.configuration.PIP_PACKAGE_GROUP_DEFAULT) == group:
205
- publish = version_type in pypi_config.get(
206
- "versions_type",
207
- tag_publish.configuration.PYPI_VERSIONS_DEFAULT,
208
- )
215
+ for package in packages:
209
216
  folder = package.get("folder", tag_publish.configuration.PYPI_PACKAGE_FOLDER_DEFAULT)
210
217
  if dry_run:
211
218
  print(f"{'Publishing' if publish else 'Checking'} '{folder}' to pypi, skipping (dry run)")