pypa / hatch

Modern, extensible Python project management
https://hatch.pypa.io/latest/
MIT License
5.87k stars 292 forks source link

`hatch build` silently doing nothing on Windows #1638

Open sponsfreixes opened 1 month ago

sponsfreixes commented 1 month ago

I have a project using pyproject.toml. Using Windows and PowerShell I can install it locally from source with pip install . or pip install -e . with no issues. I can also create the wheel and sdist fine with py -m build:

> py -m build
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
  - hatchling
* Getting build dependencies for sdist...
* Building sdist...
* Building wheel from sdist
* Creating isolated environment: venv+pip...
* Installing packages in isolated environment:
  - hatchling
* Getting build dependencies for wheel...
* Building wheel...
Successfully built my_awesome_project-1.0.0.tar.gz and my_awesome_project-1.0.0-py3-none-any.whl

But if I try to use hatch, it does nothing apart from showing some kind of header:

> hatch -v build
────────────────────────────────────────────────────────── sdist ───────────────────────────────────────────────────────────

Any thoughts?

ofek commented 1 month ago

show project configuration?

sponsfreixes commented 1 month ago

This is it (changed some content to anonymize it, as it's work related):

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
dynamic = ["version"]
name = "my-awesome-project"
description = "Best project"
requires-python = ">=3.8"
authors = [{ name = "Foo", email = "foo@mail.com" }]
readme='README.md'
classifiers = [
  "Development Status :: 5 - Production/Stable",
  "Programming Language :: Python :: 3.8",
  "Programming Language :: Python :: 3.9",
  "Programming Language :: Python :: 3.10",
  "Programming Language :: Python :: 3.11",
  "Programming Language :: Python :: 3.12",
  "Programming Language :: Python :: 3.13",
  'License :: Other/Proprietary License'
]
keywords=['keywords']

dependencies = [
  'orjson',
  'pydantic',
  'httpx',
]

[project.optional-dependencies]
langchain = [
'langchain_core',
'langchain'
  ]
docs = [
  "sphinx>7.2.2",
  "sphinx-design",
  "sphinx-copybutton",
  "sphinx-notfound-page",
  "sphinxext-opengraph",
  "myst-parser",
  "furo",
]
tests = [
#  "pytest",
#  "pytest-asyncio",
#  "typing-extensions; python_version<'3.9'",
]
dev = [
#  "my-awesome-project[langchain,tests]",
  "pre-commit",
  "hatch"
]

[project.urls]
Source = "https://github.com/foo/awesome-project"

[tool.hatch.version]
path = "src/awesome/__init__.py"

[tool.hatch.build.targets.sdist]
exclude = ['/docs', '/tests']

[tool.hatch.build.targets.wheel]
packages = ["src/awesome"]

[tool.pytest.ini_options]
addopts = ["--strict-markers", "--strict-config"]
xfail_strict = true

[tool.ruff]
src = ["src", "tests", "conftest.py", "examples", "docs"]

[tool.ruff.lint]
select = ["E4", "E7", "E9", "F", "I"]

[tool.ruff.lint.isort]
lines-between-types = 1
lines-after-imports = 2
known-first-party = [
  "src",
  "awesome",
  "tests",
]

[tool.mypy]
disallow_untyped_defs = true
show_error_codes = true
no_implicit_optional = true
warn_return_any = true
warn_unused_ignores = true
exclude = ["docs", "tests", "examples", "__try__" ]
sponsfreixes commented 1 month ago

It seems to be a problem with my virtual environment. I created a new one from scratch and with that one it works as expected. Let me know if you want to dig more into it, otherwise feel free to close the issue. Thanks!