rapid-bird-7930005/02/2023, 5:34 PM
When running with Pants environments we get
VERSION = importlib.metadata.version("my_pkg")
I found some older thread that suggested to use python_distribution but it seems
E importlib.metadata.PackageNotFoundError: my_pkg
needs to be hardcoded there but we would prefer to leave version in the
. Is there any other ways we can do that with pyproject.toml?
enough-analyst-5443405/02/2023, 5:41 PM
rapid-bird-7930005/02/2023, 5:48 PM
enough-analyst-5443405/02/2023, 5:52 PM
without repeating the version via: https://www.pantsbuild.org/docs/reference-python_distribution#codegenerate_setupcode
rapid-bird-7930005/02/2023, 6:00 PM
pants.backend.python.goals.setup_py.InvalidSetupPyArgs: Missing a `version` kwarg in the `provides` field for tools/python/my-pkg:dist. See <https://www.pantsbuild.org/v2.14/docs/python-distributions>.
and added the dependency on the targets that call
python_distribution( name="dist", provides=python_artifact( name="my-pkg", ), generate_setup=False, )
but still seeing same error.
lives in same directory as the BUILD file target above
enough-analyst-5443405/02/2023, 6:43 PM