Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Allow to manage project version with git tags #1034

Closed
wants to merge 1 commit into from

Conversation

4383
Copy link

@4383 4383 commented Apr 12, 2019

To avoid to manage textual version of a project allow poetry
to retrieve those informations directly from git tags.

To determine the current version number we currently retrieve
the highest available tag number.

If the version is not available in the pyproject.toml then
poetry try to retrieve version from git so project can continue
to manage these informations manually.

If the version is not available in the pyproject.toml and if
it's not a git repository then an exception is raised and we
retrieve the previous behavior of poetry.

Pull Request Check List

This is just a reminder about the most common mistakes. Please make sure that you tick all appropriate boxes. But please read our contribution guide at least once, it will save you unnecessary review cycles!

  • Added tests for changed code.
  • Updated documentation for changed code.

Note: If your Pull Request introduces a new feature or changes the current behavior, it should be based
on the develop branch. If it's a bug fix or only a documentation update, it should be based on the master branch.

If you have any questions to any of the points above, just submit and ask! This checklist is here to help you, not to deter you from contributing!

@4383
Copy link
Author

4383 commented Apr 12, 2019

Still work in progress.

But I want to discuss with you about the best design choices for this feature.

We can retrieve version from git by selecting the most highest tag (this the current design), or we can decide to retrieve the latest created tag.

I guess the highest version is the most common use case and in any way we can continue to retrieve the version number from pyproject.toml.

Do you have any opinions about this?

Thoughts?

To avoid to manage textual version of a project allow poetry
to retrieve those informations directly from git tags.

To determine the current version number we currently retrieve
the highest available tag number.

If the version is not available in the pyproject.toml then
poetry try to retrieve version from git so project can continue
to manage these informations manually.

If the version is not available in the pyproject.toml and if
it's not a git repository then an exception is raised and we
retrieve the previous behavior of poetry.
@aequitas
Copy link

There has already been some discussion on this topic, see:

Afaict this PR probably won't be merged as the maintainer prefers to use a plugin system for this: #672 (comment)

@techdragon
Copy link

I think this relates to #991 as well. If poetry was able to use more information from a git repo, some of the situations that would lead to #991 would go away, thus narrowing the scope of anything "new" that would be required to "fully" resolve #991.

@4383
Copy link
Author

4383 commented Apr 30, 2019

@techdragon not sure to see where my changes can help to solve your problem...
My changes in the current state only allow poetry to retrieve version of a project from git tag at build.

Of course in a second time my features can by reuse to implement new poetry features around projects informations harvesting or whatever you want but in the current state they don't do.

@webknjaz
Copy link

This should be done via plugins to have it done in a generic way.

@4383
Copy link
Author

4383 commented May 12, 2019

Given the number of poetry PRs and discussions on this topic who suggest to use plugins it's no use that I continue to keep this one opened.

Copy link

github-actions bot commented Mar 1, 2024

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants