Can't include a folder that is a subfolder of one excluded by gitignore
See original GitHub issue- OS version and name: Arch Linux
- Poetry version: 1.0.10
Relevant part of pyproject.toml
:
[tool.poetry]
authors = ["<...>"]
description = "Solution preparation optimization."
exclude = ["examples/*.xlsx", "src/preppy/z_*"]
include = ["docs/_build/latex/*.pdf", "docs/_build/html/", "examples/*.toml"]
name = "preppy"
readme = "README.md"
version = "0.1.18"
Relevant lines in .gitignore
:
# Sphinx documentation
docs/_build/
With the above configuration, my pdf documentation, docs/_build/latex/preppy.pdf
, is included, but the docs/_build/html/
folder is not.
If I change the include to…
include = ["docs/_build/latex/*.pdf", "docs/_build/html/*html", "examples/*.toml"]
…it does include the various *.html
files, but this isn’t sufficient as there are other artifacts and subfolders in html I also wish to include.
I thought maybe the issue was my syntax, so I tried the following variations, which didn’t work either:
include = ["docs/_build/latex/*.pdf", "docs/_build/html", "examples/*.toml"]
include = ["docs/_build/latex/*.pdf", "docs/_build/html/*", "examples/*.toml"]
It seems as if there is some issue in including a folder (but not a file or group of files) that is a subfolder of one ignored by .gitignore.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
git - .gitignore exclude folder but include specific subfolder
If you want to commit a specific subfolders of public , say for e.g. in your public/products directory you want to include files...
Read more >Gitignore - Exclude all except specific subdirectory · GitHub
Gitignore - Exclude all except specific subdirectory - .gitignore. ... If all files excluded and you will include only specific sub-directories.
Read more >gitignore exclude folder but include specific subfolder
1 Answer. If you exclude application/, then everything under it will always be excluded. For this question, you need to use unignore to...
Read more >gitignore Documentation - Git
It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn't list excluded directories for...
Read more >Gitignore exclude folder but include a subfolder
In a project using Git I have a folder that is added to .gitignore. But i needed to include a subfolder that is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hello @multipitch ,
currently
poetry
does not include a folder recursive (while it does for export). You can do it by using this patter:"docs/_build/html/**/*"
fin swimmer
Usually built files are files that are meant to be included in a distributed package but not included in version control, so I find this behavior very counterintuitive. If Poetry is going to continue to exclude VCS-ignored files, then at the minimum, the documentation should be REALLY explicit about that and have an example that includes something like
build/**/*
, since Path.glob()'s**
is quite confusing, and all the built files (including under subdirectories) are usually what someone would want to include.