Skip to content

ignore-vcs flag not working as expected #1649

@micha-b

Description

@micha-b

I was working on a project and I experienced some strange behavior when I tried packaging files that were ignored by git.

First I was unsure about the behavior but then I looked at the documentation regarding the ignore-vcs build flag (ignore-vcs docs) which seemed to be what I was looking for to solve my issue.
But after setting this flag to true the files were still not included in the output. (wheel)

I tried and tested a few things and I think the ignore-vcs flag has some kind of bug. (Or it's a skill issue on my side - I am still new to hatch and python packaging.)

I have created a small demo project which contains sources and instructions to reproduce the behavior.

The demo project shows three variants with different (partly unexpected behaviors):

  1. expected behavior: if ignore-vcs is not set, vcs ignored files are not part of the build output.
  2. unexpected behavior and my problem: if ignore-vcs is set, vcs ignored files are still not part of the build output.
  3. workaround / expected behavior: if there is no .gitignore file the files are part of the build output. (so for now I am deleting the .gitignore file before building)

If I need to provide more details do not hesitate to ask.
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions