Skip to content

Installing from a source distribution fails w/poetry-dynamic-versioning #76

Closed
@nicholsn

Description

@nicholsn
Contributor

I created a linkml project using this cookiecutter and I'm distributing it via pypi where it is installed using a source distribution. However, I am getting an error from dumani that states RuntimeError: This does not appear to be a Git project.

It looks like the poetry-dynamic-versioning build backend requires the git history to be available but this is not present in the source distribution tarball.

The quick fix appears to be falling back to poetry.core.masonry.api rather than using the dynamic versioning plugin, but I'm curious if there is a known workaround for this issue.

Activity

pkalita-lbl

pkalita-lbl commented on Dec 2, 2023

@pkalita-lbl
Contributor

Hi @nicholsn sorry for not getting a chance to look at this sooner. I'm a little confused about the order of things here. The poetry-dynamic-versioning plugin is active during a poetry build which would produce a source distribution tarball with the correct version number (based on git history) baked in. What's the scenario where the poetry-dynamic-versioning is being called after the tarball is already created? Or am I totally misunderstanding what's going on?

added a commit that references this issue on Dec 8, 2023
5f7efdb
dalito

dalito commented on Dec 8, 2023

@dalito
Member

@nicholsn - Could you try my fix in #88? I don't deploy any model to PyPI myself.

I believe the problem was caused by the way the checkout is made in the action. By default tags are not checked out but peotry-dynamic-versioning needs them to work.

dalito

dalito commented on Dec 8, 2023

@dalito
Member

Just re-reading the issue... - From a source install (which is not a git repo) there is no way that the version can be determined dynamically.

It would be nevertheless interesting to know if the action has been producing a correct dynamic versions without #88.

nicholsn

nicholsn commented on Dec 8, 2023

@nicholsn
ContributorAuthor

@dalito and @pkalita-lbl, thanks for looking into this. A detail I should've included is that I'm using a private pypi (cloudsmith) and an internal github action to publish that's different than the one included in this cookiecutter.

It looks like the source distribution coming out of my internal pypi is the same as what is in source control and that it was not updated with any version info. I think pip is trying to generate the versioning on the fly and that is why dunamai since the git repo isn't present.

Do you think publishing a wheel to pypi would resolve this?

dalito

dalito commented on Dec 8, 2023

@dalito
Member

To me it is not fully clear if you build in a git repo/clone with the tag information present. Does git tag give you a list of tags? You could add git tag command to your pipeline and inspect the log.

Do you think publishing a wheel to pypi would resolve this?

No. A local build with poetry build should already produce correct source- or wheel-names with the version being part of the name. Is that the case?

pkalita-lbl

pkalita-lbl commented on Dec 14, 2023

@pkalita-lbl
Contributor

@nicholsn I'm still not quite sure I'm following exactly what's going on here. Maybe if you have time to walk me through it on a developer call sometime?

nicholsn

nicholsn commented on Dec 15, 2023

@nicholsn
ContributorAuthor

Thanks, @pkalita-lbl - I figured this out and it was an error on my end where my github action was only publishing the source tarball to our internal pypi registry. Fixing the action to publish the whl resolved the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @cmungall@nicholsn@dalito@pkalita-lbl

      Issue actions

        Installing from a source distribution fails w/poetry-dynamic-versioning · Issue #76 · linkml/linkml-project-cookiecutter