thoth-station / kebechet

I'm Kebechet bot, goddess of freshness - I will keep your source code fresh and up-to-date
24 stars 20 forks source link

Add pyproject.toml to maintain version from Kebechet's version manager #1163

Closed shreekarSS closed 2 years ago

shreekarSS commented 2 years ago

Signed-off-by: Shreekara sshreeka@redhat.com

Related Issues and Dependencies

Fixes: https://github.com/thoth-station/kebechet/issues/1158

VannTen commented 2 years ago

I have a question: How do we handle version specified not in by the [project] section, but provided by the build backend ? I'm thinking specifically of setup like:

[project]
dynamic = ["version"]

[tool.setuptools-scm]
enabled = true

or

[project]
dynamic = ["version"]

[tool.setuptools.dynamic]
version = {attr = "thoth.document_sync.__version__"}

(I'm not sure it's possible in a general way, but in that case we might want to state that in the docs)

harshad16 commented 2 years ago

/hold

harshad16 commented 2 years ago

That is a valid point, we should check/address if the version is not in the project section.

KPostOffice commented 2 years ago

https://github.com/python-poetry/poetry/issues/144

An interesting thread about why "version" should never be put in source code and should instead be derived from package metadata when needed.

The basic argument here is that version should be set from package metadata, not the other way around.

KPostOffice commented 2 years ago

I'm not sure what this should mean for this PR, just a rabbit hole that I fell down when looking into Max's concern.

One way to just fix the issue raised is to recognize that json if version is a dictionary then it won't hold a proper string and to return early. If it is specified in a different file then the version manager should update it automatically already so throwing an exception would be wrong in this case.

harshad16 commented 2 years ago

I believe we are addressing the required pattern with PR. we are only updating the pyproject.toml version if it is the project section, or else it wouldn't be picked for updated. and we are describing this in our docs as well.

KPostOffice commented 2 years ago

I believe we are addressing the required pattern with PR. we are only updating the pyproject.toml version if it is the project section, or else it wouldn't be picked for updated. and we are describing this in our docs as well.

Oh yeah, I see what you mean

shreekarSS commented 2 years ago

/test pre-commit

KPostOffice commented 2 years ago

/retest

KPostOffice commented 2 years ago

/approve

sesheta commented 2 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: KPostOffice

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/thoth-station/kebechet/blob/master/OWNERS)~~ [KPostOffice] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment