Git Product home page Git Product logo

Comments (20)

asmeurer avatar asmeurer commented on July 17, 2024

Ah, so the version is there before the build, but it's not easy to get at because you can't just import dynd; dynd.__version__?

from conda-build.

mwiebe avatar mwiebe commented on July 17, 2024

No, the version isn't there before the build, it gets constructed from a 'git describe' call during the build, and can be retrieved from the package at that point.

from conda-build.

asmeurer avatar asmeurer commented on July 17, 2024

I see. We should probably allow a similar thing for the build string.

How should we implement it? Maybe some flag that indicates to get the version from some environment variable, which is set in the build script.

from conda-build.

mwiebe avatar mwiebe commented on July 17, 2024

Having the build script set it in an environment variable would work well, sure.

from conda-build.

asmeurer avatar asmeurer commented on July 17, 2024

Thoughts how to do this @ilanschnell?

from conda-build.

ilanschnell avatar ilanschnell commented on July 17, 2024

If the build script sets an environment variable, how can we access it after the build script is finished?

from conda-build.

mwiebe avatar mwiebe commented on July 17, 2024

If that's not feasible, I guess a different approach is needed

from conda-build.

ilanschnell avatar ilanschnell commented on July 17, 2024

The build script write a special file, e.g. named __version_build__.txt, into the source directory. If conda-build sees this file after the build script is executed, it adjusts the version and build number accordingly.

from conda-build.

teoliphant avatar teoliphant commented on July 17, 2024

Why not call it __version__.txt? --- Alternatively the build script or meta.yaml file could specify the name of the file to look for.

Do you always have write access to the source directory? Perhaps we can look for this in the build directory instead?

from conda-build.

ilanschnell avatar ilanschnell commented on July 17, 2024

The source directory is where things get build usually. There is always write access to the source directory, for example when you extract a tarball, you need to be able to write files like config.log, build/, or even apply patches to the source.

from conda-build.

asmeurer avatar asmeurer commented on July 17, 2024

Actually, one needs the ability to extract the source tarball there in the first place.

from conda-build.

ilanschnell avatar ilanschnell commented on July 17, 2024

Good point, Aaron!

from conda-build.

asmeurer avatar asmeurer commented on July 17, 2024

What should be placed in the meta.yaml for the version in this case? Nothing? A special placeholder?

from conda-build.

ilanschnell avatar ilanschnell commented on July 17, 2024

I would argue that nothing extra is put into the meta.yaml file. There can even be a version in it, but as soon as the special file is found, it uses that.

from conda-build.

asmeurer avatar asmeurer commented on July 17, 2024

OK, that is simple enough.

from conda-build.

mwiebe avatar mwiebe commented on July 17, 2024

I disagree, I think a special tag should go in the meta.yaml, so that if a bug prevents the version file creation, an error is raised instead of silently producing a junk version.

from conda-build.

ilanschnell avatar ilanschnell commented on July 17, 2024

I just tested this new feature and can verify that it works as expected.

from conda-build.

asmeurer avatar asmeurer commented on July 17, 2024

I have also updated the docs.

from conda-build.

ilanschnell avatar ilanschnell commented on July 17, 2024

Just as a reference, __conda_version__.txt is the name we decided on.

from conda-build.

github-actions avatar github-actions commented on July 17, 2024

Hi there, thank you for your contribution!

This issue has been automatically locked because it has not had recent activity after being closed.

Please open a new issue if needed.

Thanks!

from conda-build.

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.