Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not raise the "listing git files failed" error at build time #1093

Open
paulrougieux opened this issue Dec 30, 2024 · 0 comments
Open

Do not raise the "listing git files failed" error at build time #1093

paulrougieux opened this issue Dec 30, 2024 · 0 comments

Comments

@paulrougieux
Copy link

paulrougieux commented Dec 30, 2024

I see the following error during build time and I think that it shouldn't be raised or there should be another message saying that it is safe to ignore it.

    ERROR setuptools_scm._file_finders.git listing git files failed - pretending there aren't any

I asked this question on Stack Overflow https://stackoverflow.com/questions/79313343/how-to-fix-setuptools-scm-file-finders-git-listing-git-files-failed and got the following response :

"python3 -m build builds in 2 phases: 1st it builds sdist and then it builds wheel from the sdist in an isolated environment where there is no .git directory. It doesn't matter because at the wheel building phase version is already set in sdist and build gets the version from sdist, not from setuptools_scm. In short: you may safely ignore the error."

Reproducible example

cd /tmp/
mkdir setuptools_scm_example
cd setuptools_scm_example
git init
touch .gitignore
git add .
git commit -m "Initial commit"

Add the following to pyproject.toml

[build-system]
requires = ["setuptools>=61.0", "setuptools_scm>=7.0"]
build-backend = "setuptools.build_meta"

[project]
name = "example_package"
dynamic = ["version"]

[tool.setuptools_scm]
# No additional configuration needed, but can add if needed

Create and build a python package

mkdir -p example_package
touch example_package/__init__.py
echo "print('Hello from example package')" > example_package/__init__.py
python3 -m build

I see the error

ERROR setuptools_scm._file_finders.git listing git files failed - pretending there aren't any
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant