Giter Site home page Giter Site logo

Workflow question about dunamai HOT 2 CLOSED

mtkennerly avatar mtkennerly commented on May 16, 2024
Workflow question

from dunamai.

Comments (2)

supakeen avatar supakeen commented on May 16, 2024 1

Hey, thank you! poetry-dynamic-versioning is exactly the way I'd have expected things to work. I'll be using that and probably taking a look at it to add the 'replace placeholder in files' myself.

If I have any questions I'll contact you there, thanks again.

from dunamai.

mtkennerly avatar mtkennerly commented on May 16, 2024

Hello! I don't think you should commit the changes to pyproject.toml and _version.py. The committed values would just be placeholders like 0.0.0, since ultimately you only need the real version in the published artifacts. All you need is a script like an Invoke task to do something like this:

from invoke import task
from dunamai import Version

@task
def build(ctx):
    version = Version.from_git().serialize()
    ctx.run("echo __version__ = '{}' > _version.py".format(version))
    ctx.run("poetry version {}".format(version))
    ctx.run("poetry build")
    ctx.run("git checkout -- .")

Then the workflow would be:

  • Make the tag.
  • Run invoke build instead of poetry build to create an artifact with the new version.

Since you're using Poetry specifically, you may want to check out poetry-dynamic-versioning (I'm also the author). It doesn't currently create/modify _version.py, but I do plan to add that. Right now, it just sets the version in pyproject.toml during packaging and then reverts it after.

from dunamai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.