forked from pool/python-apipkg
- Generate the _version.py file in %prep to remove completely hatch-vcs from
pyproject to make it build and run tests correctly OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-apipkg?expand=0&rev=15
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Wed Nov 30 17:05:54 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
|
||||
|
||||
- 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 <daniel.garcia@suse.com>
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user