fast-photographer-12719
11/10/2023, 9:40 AMfast-photographer-12719
11/10/2023, 9:43 AMproject/
- .git/
- code/
-- get_hash.py
- tests/
-- test_get_hash.py
I've tried putting the files or resources into the python_sources at project/BUILD but it doesn't seem to be doing anything when i run the tests. The tests fail as there is no .git folder.
python_sources(
name="root",
dependencies=[":git_folder"],
)
files(
name="git_folder",
sources=[".git:"],
)
fast-photographer-12719
11/10/2023, 10:50 AM10:28:29.58 [WARN] Unmatched glob from //:git_folder's `sources` field: ".git/:"
Do the file(s) exist? If so, check if the file(s) are in your `.gitignore` or the global `pants_ignore` option, which may result in Pants not being able to see the file(s) even though they exist on disk. Refer to <https://www.pantsbuild.org/v2.16/docs/troubleshooting#pants-cannot-find-a-file-in-your-project>.
However i've explicitly set .git to be included and ensure it's not ignored by pants.
[GLOBAL]
pants_version = "2.16.0"
pants_ignore=[
"/dist/",
"__pycache__",
"!.git"
]
fast-photographer-12719
11/10/2023, 11:04 AMfast-nail-55400
11/10/2023, 11:55 AMsources
field and not the target-like syntax which you were using. For example:
files(
name="git_folder",
sources=[".git/**"],
)
fast-nail-55400
11/10/2023, 11:55 AM.git/**
versus .git:
fast-nail-55400
11/10/2023, 11:56 AM.git
directory)fast-photographer-12719
11/10/2023, 11:56 AMfast-nail-55400
11/10/2023, 11:56 AMfast-photographer-12719
11/10/2023, 11:57 AMpants_ignore_use_gitignore = false
pants_ignore=[
"/dist/",
"__pycache__",
"!.git"
]
fast-nail-55400
11/10/2023, 11:57 AMfast-photographer-12719
11/10/2023, 11:58 AMfast-photographer-12719
11/10/2023, 2:40 PMgorgeous-winter-99296
11/10/2023, 2:41 PMvcs_version
could be helpful for you? https://www.pantsbuild.org/docs/generating-version-tagsfast-photographer-12719
11/10/2023, 2:49 PMfast-photographer-12719
11/13/2023, 9:33 AM