Failing to use hatch-vcs with tox #31
-
I can't manage to have my package successfully installed in tox virtual environments. Example project: dummy
├── pyproject.toml
├── src
│ └── dummy
│ └── __init__.py
└── tox.ini
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling", "hatch-vcs"]
[project]
name = "dummy"
license = "Apache-2.0"
requires-python = ">=3.8"
dynamic = ["version"]
[tool.hatch.build]
packages = ["src/dummy"]
[tool.hatch.build.hooks.vcs]
version-file = "src/dummy/_version.py"
[tool.hatch.version]
source = "vcs"
[testenv:safety]
deps=
safety
commands=
safety check --full-report The
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Can you show more output? Also it would be helpful to see what options the safety environment has inherited from the base environment. |
Beta Was this translation helpful? Give feedback.
-
I will look into this tonight |
Beta Was this translation helpful? Give feedback.
-
The answer is to not define So a possible solution is to define this for the wheel target only and restrict what is included in the sdist as shown here. Instead of including only the |
Beta Was this translation helpful? Give feedback.
The answer is to not define
packages = ["src/dummy"]
for[tool.hatch.build]
which is like settingssources
to["src"]
and also keeps only the final component ("dummy"
) for the distributed sources.So a possible solution is to define this for the wheel target only and restrict what is included in the sdist as shown here.
Instead of including only the
"src"
directory one could also settool.hatch.build.only-packages = true
.