diff --git a/python-apipkg.changes b/python-apipkg.changes index f104497..b98121e 100644 --- a/python-apipkg.changes +++ b/python-apipkg.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Nov 30 17:05:54 UTC 2022 - Daniel Garcia + +- Generate the _version.py file in %prep to remove completely hatch-vcs from + pyproject to make it build and run tests correctly + ------------------------------------------------------------------- Wed Nov 30 16:45:02 UTC 2022 - Daniel Garcia diff --git a/python-apipkg.spec b/python-apipkg.spec index 6cab142..38f9e0e 100644 --- a/python-apipkg.spec +++ b/python-apipkg.spec @@ -61,7 +61,12 @@ can copy paste the ~200 lines of code into your project. # Set the package version static, not dynamic, to build without the .git folder sed -i ':a;N;$!ba;s/dynamic = \[[^]]*\]/version = "%{version}"/g' pyproject.toml # Remove hatch-vcs dep to avoid cycles +rm .gitignore sed -i '/tool.hatch.build.hooks.vcs/d' pyproject.toml +cat << EOF > src/apipkg/_version.py +version = "%{version}" +version_tuple = tuple(map(int, version.split("."))) +EOF %build %pyproject_wheel