poetry icon indicating copy to clipboard operation
poetry copied to clipboard

Debug level logging (-vvv) should report when a .gitignore file was used to ignore a potential package file

Open shaunco opened this issue 3 years ago • 3 comments

  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] I have searched the documentation and believe that my question is not covered.

Feature Request

After a very frustrating two days of trying to figure out why poetry build was silently ignoring all of the .py files in my package, I finally renamed a .gitignore file that was 3 parent directories above (../../../.gitignore) where I was running poetry build and my files were finally included.

While this is totally on me, as the docs point out that .gitignore files will be used, those two days would have been reduced to about 5 seconds if -vvv output something like:

Building myproj (0.1.0)
  - Building sdist
  - Ignoring: /home/test/some/dir/structure/myproj/myproj/__init__.py   (per /home/test/some/.gitignore)
  - Adding: pyproject.toml
  - Adding: README.md
  - Built myproj-0.1.0.tar.gz
  - Building wheel
  - Ignoring: /home/test/some/dir/structure/myproj/myproj/__init__.py   (per /home/test/some/.gitignore)
  - Ignoring: /home/test/some/dir/structure/myproj/myproj/test/__init__.py   (per /home/test/some/.gitignore)
Skipping: /home/test/some/dir/structure/myproj/myproj/LICENSE
Skipping: /home/test/some/dir/structure/myproj/myproj/COPYING
  - Built myproj-0.1.0-py3-none-any.whl

Where the lines that start with Ignoring is new, as currently it will just show:

Building myproj (0.1.0)
  - Building sdist
  - Adding: pyproject.toml
  - Adding: README.md
  - Built myproj-0.1.0.tar.gz
  - Building wheel
Skipping: /home/test/some/dir/structure/myproj/myproj/LICENSE
Skipping: /home/test/some/dir/structure/myproj/myproj/COPYING
  - Built myproj-0.1.0-py3-none-any.whl

shaunco avatar Sep 07 '22 22:09 shaunco

Code is here if you'd like to submit an MR

dimbleby avatar Sep 07 '22 22:09 dimbleby

@dimbleby I've got a local branch with a logger.debug call to print out the ignored files. Should I submit the PR against Poetry or Poetry-Core?

evanrittenhouse avatar Sep 14 '22 19:09 evanrittenhouse

the code is in poetry-core, that's where the MR will be

dimbleby avatar Sep 14 '22 20:09 dimbleby

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Mar 01 '24 09:03 github-actions[bot]