Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
chingor13 authored Jul 10, 2023
2 parents 5968aeb + e298666 commit c001b24
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

[1]: https://www.npmjs.com/package/release-please?activeTab=versions

## [15.11.1](https://github.com/googleapis/release-please/compare/v15.11.0...v15.11.1) (2023-07-10)


### Bug Fixes

* **deps:** Update dependency conventional-commits-filter to v3 ([#1976](https://github.com/googleapis/release-please/issues/1976)) ([20b8f34](https://github.com/googleapis/release-please/commit/20b8f345624f2a7e639df1a50ebda2719f9c2423))
* **python:** Warn on dynamic pyproject.toml versioning ([#1983](https://github.com/googleapis/release-please/issues/1983)) ([5ee5baa](https://github.com/googleapis/release-please/commit/5ee5baa0932d3435034b96183fed308eaf47ef73))

## [15.11.0](https://github.com/googleapis/release-please/compare/v15.10.5...v15.11.0) (2023-05-31)


Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "release-please",
"version": "15.11.0",
"version": "15.11.1",
"description": "generate release PRs based on the conventionalcommits.org spec",
"main": "./build/src/index.js",
"bin": "./build/src/bin/release-please.js",
Expand Down
11 changes: 10 additions & 1 deletion src/updaters/python/pyproject-toml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@
// limitations under the License.

import * as TOML from '@iarna/toml';
import {replaceTomlValue} from '../../util/toml-edit';
import {logger as defaultLogger, Logger} from '../../util/logger';
import {replaceTomlValue} from '../../util/toml-edit';
import {DefaultUpdater} from '../default';

// TODO: remove support for `poetry.tool` when Poetry will use `project`.

interface PyProjectContent {
name: string;
version: string;
dynamic?: string[];
}

/**
Expand Down Expand Up @@ -52,6 +53,14 @@ export class PyProjectToml extends DefaultUpdater {
const project = parsed.project || parsed.tool?.poetry;

if (!project?.version) {
// Throw warning if the version is dynamically generated.
if (project?.dynamic && project.dynamic.includes('version')) {
const msg =
"dynamic version found in 'pyproject.toml'. Skipping update.";
logger.warn(msg);
return content;
}

const msg = 'invalid file';
logger.error(msg);
throw new Error(msg);
Expand Down

0 comments on commit c001b24

Please sign in to comment.