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

"poetry build" command is logging "fatal" errors when not inside a git repo #8728

Closed
4 tasks done
kevinpauli opened this issue Nov 29, 2023 · 2 comments · Fixed by python-poetry/poetry-core#684
Closed
4 tasks done
Labels
kind/bug Something isn't working as expected

Comments

@kevinpauli
Copy link

kevinpauli commented Nov 29, 2023

  • Poetry version: 1.7.1
  • Python version: 3.11.5
  • OS version and name: macOS 14.1.1
  • pyproject.toml:
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

Consider this very simple project:

.
├── dummy
│   └── __init__.py
└── pyproject.toml

The python file can be totally empty.

The pyproject.toml is

[tool.poetry]
name = "dummy"
version = "0.1.0"
description = ""
authors = ["Me"]
packages = [{ include = "dummy", from = "." }]


[tool.poetry.dependencies]
python = "^3.11"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

Note this is NOT a git repo, there is no .git folder. Now when I execute poetry build -vvv I get these "fatal" errors complaining about the fact that we are not in a git repo:

Using virtualenv: /Users/kpauli/opt/miniconda3/envs/dev
Building dummy (0.1.0)
  - Building sdist
fatal: not a git repository (or any of the parent directories): .git
  - Adding: /Users/kpauli/projects/dummy/__init__.py
  - Adding: pyproject.toml
  - Built dummy-0.1.0.tar.gz
  - Building wheel
fatal: not a git repository (or any of the parent directories): .git
  - Adding: /Users/kpauli/projects/dummy/dummy/__init__.py
Skipping: /Users/kpauli/projects/dummy/COPYING
Skipping: /Users/kpauli/projects/dummy/LICENSE
  - Built dummy-0.1.0-py3-none-any.whl

It looks like it still produced the targets however the fatal errors are tripping devops warning bells and causing me headaches.

If I just do a git init then the problem goes away.

Why would poetry build care if it is running inside a git repo or not?

This happens with multiple releases of poetry (1.7.1, 1.6.1) and in various environments (in Docker containers, and in my mac in a conda environment) so I think it must be something fundamental I am not understanding, or else considered a bug that maybe nobody has noticed?

@kevinpauli kevinpauli added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 29, 2023
@dimbleby
Copy link
Contributor

I expect all that's needed is stderr=subprocess.DEVNULL, here.

merge request surely welcome

Copy link

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 github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
@abn abn removed the status/triage This issue needs to be triaged label Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants