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

Add strip-dev as get_version argument #798

Closed
wants to merge 1 commit into from
Closed

Add strip-dev as get_version argument #798

wants to merge 1 commit into from

Conversation

dariocurr
Copy link

Hi, I'm @dariocurr and I am part of @buildnn.

We are trying to integrate setuptools-scm into our CI/CD, and it would be really helpful if we could use the strip-dev option through the python interface as well as from the CLI. That's why, with a few modifications, I made it possible.

I added some tests to make sure everything works as it should

@dariocurr dariocurr changed the title Add strip-dev as get version argument Add strip-dev as get_version argument Dec 28, 2022
@RonnyPfannschmidt
Copy link
Contributor

Thanks for providing this as example,

This is possibly in conflict with future plans for overrides and adding tag creation tools

Unfortunately I'm currently stretched and may not be able to give this the time it deserves within the next 2 weeksz

@dariocurr
Copy link
Author

dariocurr commented Dec 28, 2022

First of all, thank you for your time and attention.

I understand what you are saying and I hear you, but IMHO, from an agnostic point of view and without any pretension, this should also be possible in the next release solutions, so why didn't you provide it now?

Barring breaking changes, get_version should remain the python interface, shouldn't it?
Then it will be the entry point for the user and it would be useful, even in the next release, to add a parameter to strip the version.

@RonnyPfannschmidt
Copy link
Contributor

instead of a boolena behavior adding argument (which is sometimes a necessary stopgap for a cli tool,

this should either be a extra helper function one applies to the result of get-version or a version schema alltogether

i'll experiment a bit with configuration details, then get back

@RonnyPfannschmidt
Copy link
Contributor

rejecting this, i should b a different function to do the change and/or a version scheme passed in

@dariocurr
Copy link
Author

dariocurr commented Jan 25, 2023

How and when do you plan to implement this option?

@RonnyPfannschmidt
Copy link
Contributor

after #800 lands there wil be an example

right now, its really all about

in practice i recommen using

ver = packaging.version.Version("2.3.1.dev12")
clean = ver.base_version
assert clean == '2.3.1'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants